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

;+
; NAME:
;     dustem_plot_extinction
5deeb77c   Annie Hughes   updated help
6
;
788b55b9   Jean-Philippe Bernard   added
7
; PURPOSE:
5deeb77c   Annie Hughes   updated help
8
9
;    Plots a DustEM extinction curve
;
788b55b9   Jean-Philippe Bernard   added
10
; CATEGORY:
5deeb77c   Annie Hughes   updated help
11
12
;    DustEM, Plotting, Low-Level
;
788b55b9   Jean-Philippe Bernard   added
13
14
; CALLING SEQUENCE:
;    dustem_plot_extinction,st,st_model[,/help][,_extra=]
5deeb77c   Annie Hughes   updated help
15
;
788b55b9   Jean-Philippe Bernard   added
16
17
18
; INPUTS:
;    st        = Dustem model output structure
;    st_model  = Dustem model parameters structure
5deeb77c   Annie Hughes   updated help
19
;
788b55b9   Jean-Philippe Bernard   added
20
21
; OPTIONAL INPUT PARAMETERS:
;    _extra    = extra parameters for the plot routine
5deeb77c   Annie Hughes   updated help
22
;
788b55b9   Jean-Philippe Bernard   added
23
24
; OUTPUTS:
;    None
5deeb77c   Annie Hughes   updated help
25
;
788b55b9   Jean-Philippe Bernard   added
26
27
; OPTIONAL OUTPUT PARAMETERS:
;    None
5deeb77c   Annie Hughes   updated help
28
;
788b55b9   Jean-Philippe Bernard   added
29
30
; ACCEPTED KEY-WORDS:
;    help      = If set, print this help
5deeb77c   Annie Hughes   updated help
31
;
788b55b9   Jean-Philippe Bernard   added
32
33
; COMMON BLOCKS:
;    None
5deeb77c   Annie Hughes   updated help
34
;
788b55b9   Jean-Philippe Bernard   added
35
36
; SIDE EFFECTS:
;    model is plotted
5deeb77c   Annie Hughes   updated help
37
;
788b55b9   Jean-Philippe Bernard   added
38
; RESTRICTIONS:
5deeb77c   Annie Hughes   updated help
39
40
;    The DustEMWrap idl code must be installed
;
788b55b9   Jean-Philippe Bernard   added
41
42
; PROCEDURE:
;    None
5deeb77c   Annie Hughes   updated help
43
;
788b55b9   Jean-Philippe Bernard   added
44
45
; EXAMPLES
;    dustem_init,/wrap
5deeb77c   Annie Hughes   updated help
46
;    dir_in=getenv('DUSTEM_SOFT_DIR')
788b55b9   Jean-Philippe Bernard   added
47
48
49
50
51
;    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
5deeb77c   Annie Hughes   updated help
52
;
788b55b9   Jean-Philippe Bernard   added
53
54
; MODIFICATION HISTORY:
;    Written by J.-Ph. Bernard
5deeb77c   Annie Hughes   updated help
55
56
;    Evolution details on the DustEMWrap gitlab.
;    See http://dustemwrap.irap.omp.eu/ for FAQ and help.  
788b55b9   Jean-Philippe Bernard   added
57
58
;-

5deeb77c   Annie Hughes   updated help
59

788b55b9   Jean-Philippe Bernard   added
60
61
62
63
64
IF keyword_set(help) THEN BEGIN
  doc_library,'dustem_plot_extinction'
  goto,the_end
ENDIF

788b55b9   Jean-Philippe Bernard   added
65
66
Ngrains=st_model.Ngrains

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

e69bf245   Jean-Philippe Bernard   improved
69
mH=1.66e-24              ;g 
9ccf7615   Jean-Philippe Bernard   modified to fit u...
70
fact=mH*1.e21
788b55b9   Jean-Philippe Bernard   added
71
72
73

;stop

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

788b55b9   Jean-Philippe Bernard   added
76
i=0L
9ccf7615   Jean-Philippe Bernard   modified to fit u...
77
ffact=fact*st_model.grains[i].MDUST_O_MH
e69bf245   Jean-Philippe Bernard   improved
78
79
80
81
82
83
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
84
FOR i=0L,Ngrains-1 DO BEGIN
e69bf245   Jean-Philippe Bernard   improved
85
86
87
88
89
90
91
92
  ;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...
93
94
  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
95
ENDFOR
e69bf245   Jean-Philippe Bernard   improved
96
97
98
total_extinction=abs_tot+sca_tot

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

the_end:
e69bf245   Jean-Philippe Bernard   improved
101
;stop
788b55b9   Jean-Philippe Bernard   added
102
103

END