Blame view

src/idl/dustem_plot_extinction.pro 2.36 KB
e69bf245   Jean-Philippe Bernard   improved
1
PRO dustem_plot_extinction,st,st_model,_extra=_extra,help=help
788b55b9   Jean-Philippe Bernard   added
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

;+
; NAME:
;     dustem_plot_extinction
; PURPOSE:
;    Plots a Dustem extinction
; CATEGORY:
;    Dustem
; CALLING SEQUENCE:
;    dustem_plot_extinction,st,st_model[,/help][,_extra=]
; INPUTS:
;    st        = Dustem model output structure
;    st_model  = Dustem model parameters structure
; OPTIONAL INPUT PARAMETERS:
;    _extra    = extra parameters for the plot routine
; OUTPUTS:
;    None
; OPTIONAL OUTPUT PARAMETERS:
;    None
; ACCEPTED KEY-WORDS:
;    help      = If set, print this help
; COMMON BLOCKS:
;    None
; SIDE EFFECTS:
;    model is plotted
; RESTRICTIONS:
;    The dustem idl wrapper must be installed
; PROCEDURE:
;    None
; EXAMPLES
;    dustem_init,/wrap
;    dir_in=getenv('DUSTEM_SOFT_DIR')+'/src/dustem3.8_web/'
;    st_model=dustem_read_all(dir_in)
;    dir=getenv('DUSTEM_RES')
;    st=dustem_read_all_res(dir_in)
;    loadct,13
;    dustem_plot_extinction,st,st_model,yr=[1.e-6,1.e0],/ysty,xr=[1.,400],/xsty
; MODIFICATION HISTORY:
;    Written by J.-Ph. Bernard
;    see evolution details on the dustem cvs maintained at CESR
;    Contact J.-Ph. Bernard (Jean-Philippe.Bernard@cesr.fr) in case of problems.
;-

IF keyword_set(help) THEN BEGIN
  doc_library,'dustem_plot_extinction'
  goto,the_end
ENDIF

788b55b9   Jean-Philippe Bernard   added
50
51
Ngrains=st_model.Ngrains

e69bf245   Jean-Philippe Bernard   improved
52
colors=dustem_grains_colors(Ngrains,/cgplot)
788b55b9   Jean-Philippe Bernard   added
53

e69bf245   Jean-Philippe Bernard   improved
54
mH=1.66e-24              ;g 
9ccf7615   Jean-Philippe Bernard   modified to fit u...
55
fact=mH*1.e21
788b55b9   Jean-Philippe Bernard   added
56
57
58

;stop

e69bf245   Jean-Philippe Bernard   improved
59
60
;st.ext is supposed to be in cm^2/g (of dust)

788b55b9   Jean-Philippe Bernard   added
61
i=0L
9ccf7615   Jean-Philippe Bernard   modified to fit u...
62
ffact=fact*st_model.grains[i].MDUST_O_MH
e69bf245   Jean-Philippe Bernard   improved
63
64
65
66
67
68
yr=[0,2.5]
xr=[1,10]
;cgplot,1./st.ext.wav,st.ext.EXT_TOT,color='red',xtit=xtit,ytit=ytit,tit=tit,yr=yr,/ysty,xr=xr,/xsty
cgplot,1./st.ext.wav,st.ext.EXT_TOT,color='red',_extra=_extra
abs_tot=st.ext.abs_grain[i]*0.
sca_tot=st.ext.sca_grain[i]*0.
788b55b9   Jean-Philippe Bernard   added
69
FOR i=0L,Ngrains-1 DO BEGIN
e69bf245   Jean-Philippe Bernard   improved
70
71
72
73
74
75
76
77
  ;ffact=fact*st_model.grains[i].MDUST_O_MH
  ffact=1.            ;because it looks as if the values are already in 1e-21 cm^2/H
  abs=st.ext.abs_grain[i]*ffact
  sca=st.ext.sca_grain[i]*ffact
  ext=abs+sca
  cgoplot,1./(st.ext.wav),abs,color=colors[i],psym=psym,linestyle=1
  cgoplot,1./(st.ext.wav),sca,color=colors[i],psym=psym,linestyle=2
  cgoplot,1./(st.ext.wav),ext,color=colors[i],psym=psym,linestyle=0
9ccf7615   Jean-Philippe Bernard   modified to fit u...
78
79
  abs_tot=abs_tot+st.ext.abs_grain[i]*ffact
  sca_tot=sca_tot+st.ext.sca_grain[i]*ffact
788b55b9   Jean-Philippe Bernard   added
80
ENDFOR
e69bf245   Jean-Philippe Bernard   improved
81
82
83
total_extinction=abs_tot+sca_tot

cgoplot,1./(st.ext.wav),total_extinction,color='black',psym=psym
788b55b9   Jean-Philippe Bernard   added
84
85

the_end:
e69bf245   Jean-Philippe Bernard   improved
86
;stop
788b55b9   Jean-Philippe Bernard   added
87
88

END