Blame view

src/idl/dustem_plot_nuinu_em.pro 3.72 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
PRO dustem_plot_nuinu_em,st,_Extra=extra,help=help

;+
; NAME:
;     dustem_plot_nuinu_em
; PURPOSE:
;    Plots a Dustem spectrum
; CATEGORY:
;    Dustem
; CALLING SEQUENCE:
;    dustem_plot_fit_sed,st[,/help][,_extra=]
; INPUTS:
;    st        = Dustem model output 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=getenv('DUSTEM_RES')
;    st=dustem_read_all_res(dir)
;    dustem_plot_nuinu_em,st,yr=[1e-28,1.e-22],/ysty,xr=[1,5e3],/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_nuinu_em'
  goto,the_end
ENDIF

Ngrains=n_tags(st.sed)-2
9ccf7615   Jean-Philippe Bernard   modified to fit u...
47
colors=dustem_grains_colors(Ngrains,/cgplot)
427f1205   Jean-Michel Glorian   version 4.2 merged
48
49
50
51
52
53

xtit=textoidl('\lambda (\mum)')
;=== same plot as in Compiegne et al. 2010
ytit=textoidl('\nuI_\nu^{em} (W/m^2/sr for N_H=1.e20 H/cm^2)') & fact=1./4./!pi*1.e4/1.e7*1.e20
tit='Dustem Emitted Intensity'

9ccf7615   Jean-Philippe Bernard   modified to fit u...
54

427f1205   Jean-Michel Glorian   version 4.2 merged
55
i=1L
9ccf7615   Jean-Philippe Bernard   modified to fit u...
56
57
;plot_oo,st.sed.wav,st.sed.(i)*fact,/nodata,_Extra=extra,xtit=xtit,ytit=ytit,tit=tit
cgplot,st.sed.wav,st.sed.(i)*fact,/nodata,_Extra=extra,xtit=xtit,ytit=ytit,tit=tit,/xlog,/ylog
427f1205   Jean-Michel Glorian   version 4.2 merged
58
FOR i=1L,Ngrains DO BEGIN
9ccf7615   Jean-Philippe Bernard   modified to fit u...
59
60
61
  ;oplot,st.sed.wav,st.sed.(i)*fact,color=colors(i-1),psym=psym
  cgoplot,st.sed.wav,st.sed.(i)*fact,color=colors[i-1],psym=psym
  ;stop
427f1205   Jean-Michel Glorian   version 4.2 merged
62
ENDFOR
9ccf7615   Jean-Philippe Bernard   modified to fit u...
63
64
65
66
67
68
;oplot,st.sed.wav,st.sed.(i)*fact,color=255,psym=psym
cgoplot,st.sed.wav,st.sed.(i)*fact,color='black',psym=psym

;stop

;Remarks: not sure that the plot of the sed below actually works. See dustem_sed_plot.pro
36e8b879   Jean-Michel Glorian   update from deborah
69

427f1205   Jean-Michel Glorian   version 4.2 merged
70
defsysv,'!dustem_data',exists=exists
6730c3f8   Jean-Philippe Bernard   modified to be co...
71
72
73
74
IF exists THEN BEGIN
   IF ptr_valid(!dustem_data.sed) THEN BEGIN
     ind_filt=where((*!dustem_data.sed).filt_names NE 'SPECTRUM',count_filt)
     ind_spec=where((*!dustem_data.sed).filt_names EQ 'SPECTRUM',count_spec)
427f1205   Jean-Michel Glorian   version 4.2 merged
75

6730c3f8   Jean-Philippe Bernard   modified to be co...
76
     ;=== Plot the data
9ccf7615   Jean-Philippe Bernard   modified to fit u...
77
78
79
80
     ;use_col_data_spec=255
     ;use_col_data_filt=100
     use_col_data_spec='blue'
     use_col_data_filt='red'
6730c3f8   Jean-Philippe Bernard   modified to be co...
81
     IF count_spec NE 0 THEN BEGIN
9ccf7615   Jean-Philippe Bernard   modified to fit u...
82
83
84
       ;plotsym,0,/fill
       ;oplot,((*!dustem_data.sed).wav)(ind_spec),((*!dustem_data.sed).values)(ind_spec)*(3.e8/1.e-6/(*!dustem_data.sed).wav(ind_spec))/1.d20,psym=8,_extra=extra,color=use_col_data_spec,syms=0.5
       cgoplot,((*!dustem_data.sed).wav)[ind_spec],((*!dustem_data.sed).values)[ind_spec]*(3.e8/1.e-6/(*!dustem_data.sed).wav[ind_spec])/1.d20,psym='Filled Circle',_extra=extra,color=use_col_data_spec
6730c3f8   Jean-Philippe Bernard   modified to be co...
85
86
87
88
       err_bar,((*!dustem_data.sed).wav)(ind_spec),((*!dustem_data.sed).values)(ind_spec)*(3.e8/1.e-6/(*!dustem_data.sed).wav(ind_spec))/1.d20,yrms=3.*((*!dustem_data.sed).sigma)(ind_spec)/2.*(3.e8/1.e-6/(*!dustem_data.sed).wav(ind_spec))/1.d20,color=use_col_data_spec
     ENDIF
     IF count_filt NE 0 THEN BEGIN
       plotsym,0,/fill
9ccf7615   Jean-Philippe Bernard   modified to fit u...
89
90
       ;oplot,((*!dustem_data.sed).wav)(ind_filt),((*!dustem_data.sed).values)(ind_filt)*(3.e8/1.e-6/(*!dustem_data.sed).wav(ind_filt))/1.d20,psym=8,_extra=extra,color=use_col_data_filt
       cgoplot,((*!dustem_data.sed).wav)(ind_filt),((*!dustem_data.sed).values)(ind_filt)*(3.e8/1.e-6/(*!dustem_data.sed).wav(ind_filt))/1.d20,psym=8,_extra=extra,color=use_col_data_filt
6730c3f8   Jean-Philippe Bernard   modified to be co...
91
92
       err_bar,((*!dustem_data.sed).wav)(ind_filt),((*!dustem_data.sed).values)(ind_filt)*(3.e8/1.e-6/(*!dustem_data.sed).wav(ind_filt))/1.d20,yrms=3.*((*!dustem_data.sed).sigma)(ind_filt)/2*(3.e8/1.e-6/(*!dustem_data.sed).wav(ind_filt))/1.d20,color=use_col_data_filt
     ENDIF
427f1205   Jean-Michel Glorian   version 4.2 merged
93
   ENDIF
6730c3f8   Jean-Philippe Bernard   modified to be co...
94
ENDIF
427f1205   Jean-Michel Glorian   version 4.2 merged
95
96
97
98

the_end:

END