dustem_make_empty_fortran_st.pro
1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FUNCTION dustem_make_empty_fortran_st,Ngrains
;This makes an empty fortran structure.
;May have to be adapted for polarized models ...
;st=dustem_make_empty_fortran_st(3)
;IDL> help,st,/str
;** Structure <b4023ea8>, 2 tags, length=57600, data length=54400, refs=1:
; SED STRUCT -> <Anonymous> Array[800]
; EXT STRUCT -> <Anonymous> Array[800]
;IDL> help,st.ext
;<Expression> STRUCT = -> <Anonymous> Array[800]
;IDL> help,st.sed
;<Expression> STRUCT = -> <Anonymous> Array[800]
;IDL> help,st.sed,/str
;** Structure <c4007d08>, 5 tags, length=40, data length=36, refs=2:
; WAV FLOAT 0.0400000
; EM_GRAIN_1 DOUBLE 0.0000000
; EM_GRAIN_2 DOUBLE 0.0000000
; EM_GRAIN_3 DOUBLE 0.0000000
; EM_TOT DOUBLE 0.0000000
;IDL> help,st.ext,/str
;** Structure <b4020c68>, 4 tags, length=32, data length=32, refs=2:
; WAV FLOAT 0.0400000
; ABS_GRAIN FLOAT Array[3]
; SCA_GRAIN FLOAT Array[3]
; EXT_TOT FLOAT 0.00000
lambir=dustem_get_wavelengths()
Nwavs=n_elements(lambir)
;do the sed structure
instruc='one_st={wav:0.,'
FOR i=0L,Ngrains-1 DO BEGIN
instruc=instruc+'em_grain_'+strtrim(i+1,2)+':0.,'
ENDFOR
instruc=instruc+'em_tot:0.}'
toto=execute(instruc)
sed_st=replicate(one_st,Nwavs)
sed_st.wav=lambir
;do the ext structure
abs_g=fltarr(Ngrains)
ext_g=fltarr(Ngrains)
one_st={wav:0.,abs_grain:abs_g,sca_grain:abs_g,ext_tot:0.}
ext_st=replicate(one_st,Nwavs)
ext_st.wav=lambir
st={sed:sed_st,ext:ext_st}
RETURN,st
END