Blame view

src/idl/dustem_plot_ext_notgood.pro 2.82 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
PRO dustem_plot_ext,st,st_model,_Extra=extra,help=help,UV=UV

;+
; NAME:
;     dustem_plot_ext
; PURPOSE:
;    Plots a Dustem extinction
; CATEGORY:
;    Dustem
; CALLING SEQUENCE:
;    dustem_plot_ext,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_ext,st,st_model,yr=[1.e-6,1.e0],/ysty,xr=[1.,400],/xsty
; MODIFICATION HISTORY:
;
;    Modified by VG with flags /UV,/IR
;
;    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_ext'
  goto,the_end
ENDIF

Ngrains=n_tags(st.sed)-2
colors=dustem_grains_colors(Ngrains)

;ytit=textoidl('extinction (cm^2/g)') & fact=1.
ytit=textoidl('\sigma_{ext} (1e-21 cm^2/H)') & mH=1.66e-24 & fact=mH*1.e21
tit='Dustem extinction'

;VG
if keyword_set(UV) then begin
	xtit=textoidl('wave number (\mum^-1)')
        xrange=1./st.ext.wav
	plot,xrange,/nodata,_Extra=extra,xtit=xtit,ytit=ytit,tit=tit
endif else begin
	xtit=textoidl('\lambda (\mum)')
        xrange=st.ext.wav
	plot_oo,xrange,/nodata,_Extra=extra,xtit=xtit,ytit=ytit,tit=tit
endelse
;VG

abs_tot=st.ext.abs_grain(0)*0.
sca_tot=st.ext.sca_grain(0)*0.
FOR i=0L,Ngrains-1 DO BEGIN
  oplot,xrange,(st.ext.abs_grain(i)+st.ext.sca_grain(i))*fact,color=colors(i),psym=psym
;  oplot,xrange,st.ext.abs_grain(i)*fact,color=colors(i-1),psym=psym
;  oplot,xrange,st.ext.sca_grain(i)*fact,color=colors(i-1),psym=psym,linestyle=2
  abs_tot=abs_tot+st.ext.abs_grain(i)*fact
  sca_tot=sca_tot+st.ext.sca_grain(i)*fact
ENDFOR
oplot,xrange,(abs_tot+sca_tot),color=255,psym=psym
;oplot,xrange,abs_tot*fact,color=255,psym=psym
;oplot,xrange,sca_tot*fact,color=255,psym=psym,linestyle=2

defsysv,'!dustem_data',exists=exists
if exists then begin
   if tag_exist(!dustem_data,'ext') then begin
      if keyword_set(UV) then begin
	 oploterror,1./(*!dustem_data.ext).wav,(*!dustem_data.ext).values,(*!dustem_data.ext).wav*0.,(*!dustem_data.ext).sigma,psym=4
      endif else begin
	 oploterror,(*!dustem_data.ext).wav,(*!dustem_data.ext).values,(*!dustem_data.ext).wav*0.,(*!dustem_data.ext).sigma,psym=4
      endelse
   endif
endif

the_end:

END