dustem_fitsio_example.pro
5.36 KB
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
PRO dustem_fitsio_example,help=help
;+
; NAME:
; dustem_fitsio_example
;
; PURPOSE:
; Testing the save/restore FITS files
;
; CATEGORY:
; DustEMWrap, Distributed, Low-Level, Development
;
; CALLING SEQUENCE:
; dustem_fitsio_example
;
; INPUTS:
; None
;
; OPTIONAL INPUT PARAMETERS:
;
; OUTPUTS:
;
; OPTIONAL OUTPUT PARAMETERS:
;
; ACCEPTED KEY-WORDS:
; help = print this help
;
; COMMON BLOCKS:
; None
;
; SIDE EFFECTS:
; None
;
; RESTRICTIONS:
; The DustEM fortran code must be installed
; The DustEMWrap IDL code must be installed
;
; PROCEDURES AND SUBROUTINES USED:
;
; EXAMPLES
;
; MODIFICATION HISTORY:
; Written by AH Apr-2023
; Evolution details on the DustEMWrap gitlab.
; See http://dustemwrap.irap.omp.eu/ for FAQ and help.
;+
if keyword_set(help) then begin
doc_library,'dustem_fitsio_example'
goto,the_end
END
dustem_fit_intensity_example,Nitermax=2,fits_save='/tmp/example_fit_intensity_only.fits'
;exit/.reset
dustem_read_fits_table,filename='/tmp/example_fit_intensity_only.fits',dustem_st=dustem_spectra_st
yr=[1.00e-4,1.00E2] ; y-axis limits
xr=[1.00E0,6.00e4] ; x-axis limits
tit='FIT INTENSITY EXAMPLE' ; plot title
ytit=textoidl('I_\nu (MJy/sr) for N_H=10^{20} H/cm^2') ; y-axis title
xtit=textoidl('\lambda (\mum)') ; x-axis title
res=*(*!dustem_fit).CURRENT_PARAM_VALUES
dustemwrap_plot,res,xr=xr,/xstyle,yr=yr,/ysty,/ylog,/xlog,title=tit+' (From Saved FITS file)'
stop
dustem_fit_spectro_example,Nitermax=2,fits_save='/tmp/example_fit_spectro.fits'
;exit/.reset
dustem_read_fits_table,filename='/tmp/example_fit_spectro_only.fits',dustem_st=dustem_spectra_st
xr = [1.,5e5]
yr = [5e-8,1.00e6]
tit='FIT SPECTRO EXAMPLE' ; plot title
res=*(*!dustem_fit).CURRENT_PARAM_VALUES
dustemwrap_plot,res,xr=xr,/xstyle,yr=yr,/ysty,/ylog,/xlog,title=tit+' (From Saved FITS file)'
stop
dustem_fit_intensity_mbb_example,Nitermax=2,fits_save='/tmp/example_fit_mbb.fits'
;exit/.reset
dustem_read_fits_table,filename='/tmp/example_fit_mbb.fits',dustem_st=dustem_spectra_st
yr=[1.00e-4,1.00E2] ; y-axis limits
xr=[1.00E0,6.00e4] ; x-axis limits
tit='MBB FIT EXAMPLE' ; plot title
ytit=textoidl('I_\nu (MJy/sr) for N_H=10^{20} H/cm^2') ; y-axis title
xtit=textoidl('\lambda (\mum)') ; x-axis title
res=*(*!dustem_fit).CURRENT_PARAM_VALUES
dustemwrap_plot,res,xr=xr,/xstyle,yr=yr,/ysty,/ylog,/xlog,title=tit+' (From Saved FITS file)'
stop
dustem_fit_polarization_example,Nitermax=2,fits_save='/tmp/example_fit_polar.fits'
;exit/.reset
dustem_read_fits_table,filename='/tmp/example_fit_polar.fits',dustem_st=dustem_spectra_st
yr=[1.00e-4,1.00E2] ; y-axis limits
xr=[1.00E0,6.00e4] ; x-axis limits
tit='FIT POLARISATION SED EXAMPLE' ; plot title
res=*(*!dustem_fit).CURRENT_PARAM_VALUES
dustemwrap_plot,res,xr=xr,/xstyle,yr=yr,/ysty,/ylog,/xlog,title=tit+' (From Saved FITS file)'
stop
dustem_fit_ext_example,Nitermax=2,fits_save='/tmp/example_fit_ext.fits'
;exit/.reset
dustem_read_fits_table,filename='/tmp/example_fit_ext.fits',dustem_st=dustem_spectra_st
xr=[0.01,30]
yr=[1.00E-10,10]
tit='FIT EXTINCTION EXAMPLE' ; plot title
res=*(*!dustem_fit).CURRENT_PARAM_VALUES
dustemwrap_plot,res,xr=xr,/xstyle,yr=yr,/ysty,/ylog,/xlog,title=tit+' (From Saved FITS file)'
stop
dustem_fit_ext_pol_example,Nitermax=2,fits_save='/tmp/example_fit_ext_polar.fits'
;exit/.reset
dustem_read_fits_table,filename='/tmp/example_fit_ext_polar.fits',dustem_st=dustem_spectra_st
xr=[0.01,30]
yr=[1.00E-10,50]
tit='FIT POLARISED EXTINCTION EXAMPLE' ; plot title
res=*(*!dustem_fit).CURRENT_PARAM_VALUES
dustemwrap_plot,res,st=dustem_st,xr=xr,/xstyle,yr=yr,/ysty,/ylog,/xlog,title=tit+' (From Saved FITS file)'
stop
dustem_fit_sed_ext_stokesi_example,Nitermax=2,fits_save='/tmp/example_fit_sed_ext_stokesi.fits'
;exit/.reset
dustem_read_fits_table,filename='/tmp/example_fit_sed_ext_stokesi.fits',dustem_st=dustem_spectra_st
xr_x = [0.01,30]
yr_x = [5.00E-8,10]
xr_m = [1.,5e5]
yr_m = [5e-8,1.00e6]
tit_m='Spectral Energy Distribution'
tit_x='Dust Optical Depth'
tit='FIT STOKESI EXTINCTION AND EMISSION EXAMPLE' ; plot title
res=*(*!dustem_fit).CURRENT_PARAM_VALUES
dustemwrap_plot,res,st=dustem_st,xr_x=xr_x,xr_m=xr_m,/xstyle,yr_x=yr_x,yr_m=yr_m,/ysty,/ylog,/xlog,title=tit+' (From Saved FITS file)'
stop
dustem_fit_sed_ext_pol_example,Nitermax=2,fits_save='/tmp/example_fit_sed_ext_polar.fits'
;exit/.reset
dustem_read_fits_table,filename='/tmp/example_fit_sed_ext_polar.fits',dustem_st=dustem_spectra_st
xr_x = [0.01,30]
yr_x = [5.00E-8,10]
xr_m = [1.,5e5]
yr_m = [5e-8,1.00e6]
tit_m='Spectral Energy Distribution'
tit_x='Dust Optical Depth'
tit='FIT POLARISED EXTINCTION AND EMISSION EXAMPLE' ; plot title
res=*(*!dustem_fit).CURRENT_PARAM_VALUES
dustemwrap_plot,res,st=dustem_st,xr_x=xr_x,xr_m=xr_m,/xstyle,yr_x=yr_x,yr_m=yr_m,/ysty,/ylog,/xlog,title=tit+' (From Saved FITS file)'
stop
dustem_myisrf_example,Nitermax=2,fits_save='/tmp/example_fit_isrf.fits'
;exit/.reset
dustem_read_fits_table,filename='/tmp/example_fit_isrf.fits',dustem_st=dustem_spectra_st
xr_m = [1.,5e5]
yr_m = [5e-8,1.00e6]
tit_m='Spectral Energy Distribution'
tit='FIT WITH USER ISRF EXAMPLE' ; plot title
res=*(*!dustem_fit).CURRENT_PARAM_VALUES
dustemwrap_plot,res,st=dustem_st,xr_m=xr_m,/xstyle,yr_m=yr_m,/ysty,/ylog,/xlog,title=tit+' (From Saved FITS file)'
;=== fails when run with only the minimal dustemwrap installed (stellar . txt file is missing)
dustem_stellarpopisrf_example,Nitermax=3
; END LIST OF TOP-LEVEL ROUTINES
end