Blame view

src/idl/Other/read_draine.pro 7.23 KB
427f1205   Jean-Michel Glorian   version 4.2 merged
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
FUNCTION read_draine,plot_it=plot_it

;+
; NAME:
;       read_draine
; CALLING SEQUENCE:
;       st=read_draine([/plot_it])
; PURPOSE:
;	Reads Draine's optical properties for bulk material and
;	spheriacl grains
; INPUTS:
;       None
; OPTIONAL INPUT:
;       None
; OUTPUTS:
;       st with the following structure
;       st.gra:              Graphite optical properties vs wavelengths
;       st.sil:              Astronomical Silicates optical properties vs wavelengths
;       st.Sil_spheres:      Astronomical Silicates spherical grains Qabs,Qsca,g vs wavelengths
;       st.Sil_spheres_smth: Same as above, but smoothed in UV vs wavelengths
;       st.Gra_spheres:      Graphite spherical grains Qabs,Qsca,g vs wavelengths
;       st.SiC_spheres:      SiC spherical grains Qabs,Qsca,g vs wavelengths
;       st.PAH_neutral:      Neutral PAH Qabs,Qsca,g vs wavelengths
;       st.PAH_ion:          Ionized PAH Qabs,Qsca,g vs wavelengths
; PROCEDURE AND SUBROUTINE USED
;       read_draine_qabs.pro
; SIDE EFFECTS:
;       Requires the DUSTEM_DRAINE_DATA_DIR to be set
; MODIFICATION HISTORY:
;       See cvs logs
;       Written by JPB Mai-2009
;-

silent=1

;==== Read Graphite dielectric function
one_st={wav_mu:0.,e1_1:0.,e2:0.,Ren_1:0.,Imn:0.}

; ICOMP=18: Draine 2003 graphite E parallel to c    
;  0.0100 = grain radius (micron)
;   20.00 = grain temperature (K)
;     386 = number of wavelengths
;  wave(um)      eps_1-1    eps_2      Re(n)-1     Im(n)

dir=getenv('DUSTEM_DRAINE_DATA_DIR')+'/Gra_diel_func/'
file=dir+'callindex.out_CpaD03_0.01.txt'
readcol,file,wav_mu,e1_1,e2,Ren_1,Imn,silent=silent
Ncol=n_elements(wav_mu)
st=replicate(one_st,Ncol)
st.wav_mu=wav_mu
st.e1_1=e1_1
st.e2=e2
st.Ren_1=Ren_1
st.Imn=Imn

st_gra_CpaD03_0p01=st

dir=getenv('DUSTEM_DRAINE_DATA_DIR')+'/Gra_diel_func/'
file=dir+'callindex.out_CpaD03_0.10.txt'
readcol,file,wav_mu,e1_1,e2,Ren_1,Imn,silent=silent
Ncol=n_elements(wav_mu)
st=replicate(one_st,Ncol)
st.wav_mu=wav_mu
st.e1_1=e1_1
st.e2=e2
st.Ren_1=Ren_1
st.Imn=Imn

st_gra_CpaD03_0p1=st

dir=getenv('DUSTEM_DRAINE_DATA_DIR')+'/Gra_diel_func/'
file=dir+'callindex.out_CpeD03_0.01.txt'
readcol,file,wav_mu,e1_1,e2,Ren_1,Imn,silent=silent
Ncol=n_elements(wav_mu)
st=replicate(one_st,Ncol)
st.wav_mu=wav_mu
st.e1_1=e1_1
st.e2=e2
st.Ren_1=Ren_1
st.Imn=Imn

st_gra_CpeD03_0p01=st

dir=getenv('DUSTEM_DRAINE_DATA_DIR')+'/Gra_diel_func/'
file=dir+'callindex.out_CpeD03_0.10.txt'
readcol,file,wav_mu,e1_1,e2,Ren_1,Imn,silent=silent
Ncol=n_elements(wav_mu)
st=replicate(one_st,Ncol)
st.wav_mu=wav_mu
st.e1_1=e1_1
st.e2=e2
st.Ren_1=Ren_1
st.Imn=Imn

st_gra_CpeD03_0p1=st

st_gra={st_gra_CpaD03_0p01:st_gra_CpaD03_0p01, $  ;C parallel for a=0.01 mic
        st_gra_CpaD03_0p1:st_gra_CpaD03_0p1, $    ;C parallel for a=0.1 mic
        st_gra_CpeD03_0p01:st_gra_CpeD03_0p01, $   ;C orth for a=0.01 mic
        st_gra_CpeD03_0p1:st_gra_CpeD03_0p1}     ;C orth for a=0.1 mic

IF keyword_set(plot_it) THEN BEGIN
  yr=[1e-6,1e4]
  plot,st_gra.ST_GRA_CPAD03_0P01.wav_mu,st_gra.ST_GRA_CPAD03_0P01.e1_1,/xlog,/ylog,yr=yr,/ysty
  oplot,st_gra.ST_GRA_CPAD03_0P1.wav_mu,st_gra.ST_GRA_CPAD03_0P1.e1_1,linestyle=2
  oplot,st_gra.ST_GRA_CPAD03_0P01.wav_mu,st_gra.ST_GRA_CPAD03_0P01.e2,color=100
  oplot,st_gra.ST_GRA_CPAD03_0P1.wav_mu,st_gra.ST_GRA_CPAD03_0P1.e2,color=100,linestyle=2
ENDIF

;stop

;==== Read Astronomical Silicate dielectric function
one_st={wav_mu:0.,e1_1:0.,e2:0.,Ren_1:0.,Imn:0.}

; ICOMP=17: Draine 2003 astrosilicate               
;  0.1000 = grain radius (micron)
;   20.00 = grain temperature (K)
;     837 = number of wavelengths
;  wave(um)      eps_1-1    eps_2      Re(n)-1     Im(n)

dir=getenv('DUSTEM_DRAINE_DATA_DIR')+'/Sil_diel_func/'
file=dir+'callindex.out_silD03.txt'
readcol,file,wav_mu,e1_1,e2,Ren_1,Imn,silent=silent
Ncol=n_elements(wav_mu)
st=replicate(one_st,Ncol)
st.wav_mu=wav_mu
st.e1_1=e1_1
st.e2=e2
st.Ren_1=Ren_1
st.Imn=Imn

st_sil=st

IF keyword_set(plot_it) THEN BEGIN
  tit='Astronomical Silicates'
  xtit='wav (mic)' & ytit='Re(n)-1, Im(n)'
  plot,st_sil.wav_mu,st_sil.Ren_1,/xlog,/ylog,yr=yr,/ysty,tit=tit,xtit=xtit,ytit=ytit
  oplot,st_sil.wav_mu,st_sil.Imn,color=100
ENDIF

;==== Read Spherical particles Qabs

;==== Silicates
dir=getenv('DUSTEM_DRAINE_DATA_DIR')+'/Particles/Sil/'
file=dir+'Sil_21'

st=read_draine_qabs(file)
Nsize=n_elements(st.size)

IF keyword_set(plot_it) THEN BEGIN
  ytit='Qabs/a' & tit='Silicate Spheres'
  FOR i=0L,Nsize-1 DO BEGIN
    IF i EQ 0 THEN BEGIN
      plot,st(i).wav_mu,st(i).qabs/st(i).size,/xlog,/ylog,yr=yr,tit=tit,xtit=xtit,ytit=ytit
    ENDIF ELSE BEGIN
      oplot,st(i).wav_mu,st(i).qabs/st(i).size
    ENDELSE
  ENDFOR
ENDIF

st_part_Si=st

;==== Graphite
;Graphite, 1/3-2/3 approximation, T=25K  

dir=getenv('DUSTEM_DRAINE_DATA_DIR')+'/Particles/Gra/'
file=dir+'Gra_21'

st=read_draine_qabs(file)
Nsize=n_elements(st.size)

IF keyword_set(plot_it) THEN BEGIN
  ytit='Qabs/a' & tit='Graphite Spheres'
  FOR i=0L,Nsize-1 DO BEGIN
    IF i EQ 0 THEN BEGIN
      plot,st(i).wav_mu,st(i).qabs/st(i).size,/xlog,/ylog,yr=yr,tit=tit,xtit=xtit,ytit=ytit
    ENDIF ELSE BEGIN
      oplot,st(i).wav_mu,st(i).qabs/st(i).size
    ENDELSE
  ENDFOR
ENDIF

st_part_Gra=st

;==== SiC

dir=getenv('DUSTEM_DRAINE_DATA_DIR')+'/Particles/SiC/'
file=dir+'SiC_21'

st=read_draine_qabs(file)
Nsize=n_elements(st.size)

IF keyword_set(plot_it) THEN BEGIN
  ytit='Qabs/a' & tit='SiC Spheres'
  FOR i=0L,Nsize-1 DO BEGIN
    IF i EQ 0 THEN BEGIN
      plot,st(i).wav_mu,st(i).qabs/st(i).size,/xlog,/ylog,yr=yr,tit=tit,xtit=xtit,ytit=ytit
    ENDIF ELSE BEGIN
      oplot,st(i).wav_mu,st(i).qabs/st(i).size
    ENDELSE
  ENDFOR
ENDIF

st_part_SiC=st

;==== Smoothed UV Silicates

dir=getenv('DUSTEM_DRAINE_DATA_DIR')+'/Particles/SmthUV_Sil/'
file=dir+'suvSil_21'

st=read_draine_qabs(file)
Nsize=n_elements(st.size)

IF keyword_set(plot_it) THEN BEGIN
  ytit='Qabs/a' & tit='Smoothed UV Silicates Spheres'
  FOR i=0L,Nsize-1 DO BEGIN
    IF i EQ 0 THEN BEGIN
      plot,st(i).wav_mu,st(i).qabs/st(i).size,/xlog,/ylog,yr=yr,tit=tit,xtit=xtit,ytit=ytit
    ENDIF ELSE BEGIN
      oplot,st(i).wav_mu,st(i).qabs/st(i).size
    ENDELSE
  ENDFOR
ENDIF

st_part_SmthUV_Sil=st

;==== Neutral PAH
dir=getenv('DUSTEM_DRAINE_DATA_DIR')+'/Particles/PAH/'
file=dir+'PAHneu_30'

st=read_draine_qabs(file)
Nsize=n_elements(st.size)

IF keyword_set(plot_it) THEN BEGIN
  ytit='Qabs/a' & tit='Neutral PAH'
  FOR i=0L,Nsize-1 DO BEGIN
    IF i EQ 0 THEN BEGIN
      plot,st(i).wav_mu,st(i).qabs/st(i).size,/xlog,/ylog,yr=yr,tit=tit,xtit=xtit,ytit=ytit
    ENDIF ELSE BEGIN
      oplot,st(i).wav_mu,st(i).qabs/st(i).size
    ENDELSE
  ENDFOR
ENDIF

st_part_PAHneu=st

;==== Ionized PAH
dir=getenv('DUSTEM_DRAINE_DATA_DIR')+'/Particles/PAH/'
file=dir+'PAHion_30'

st=read_draine_qabs(file)
Nsize=n_elements(st.size)

IF keyword_set(plot_it) THEN BEGIN
ytit='Qabs/a' & tit='Ionized PAH'
  FOR i=0L,Nsize-1 DO BEGIN
    IF i EQ 0 THEN BEGIN
      plot,st(i).wav_mu,st(i).qabs/st(i).size,/xlog,/ylog,yr=yr,tit=tit,xtit=xtit,ytit=ytit
    ENDIF ELSE BEGIN
      oplot,st(i).wav_mu,st(i).qabs/st(i).size
    ENDELSE
  ENDFOR
ENDIF

st_part_PAHion=st

;=== create final structure
st={gra:st_gra, $
    sil:st_sil, $
    Sil_spheres:st_part_Si, $
    Gra_spheres:st_part_Gra, $
    SiC_spheres:st_part_SiC, $
    Sil_spheres_smth:st_part_SmthUV_Sil, $
    PAH_neutral:st_part_PAHneu, $
    PAH_ion:st_part_PAHion}

RETURN,st

END