dustem_show_file_dependencies.pro
8.86 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
PRO dustem_show_file_dependencies,help=help $
,outfile=outfile $
,compfile=compfile $
,steps=steps
;+
; NAME:
; dustem_show_file_dependencies
;
; PURPOSE:
; Generate a list of routines used during a DustEMWrap run
;
; CATEGORY:
; DustEMWrap, Distributed, Low-Level, Development
;
; CALLING SEQUENCE:
; dustem_show_file_dependencies[,help=help][,outfile=]
;
; INPUTS:
; None
;
; OPTIONAL INPUT PARAMETERS:
; outfile = string, .xcat file (and path) with list of compiled routines and
; functions. Default is './DustEMWrap_dependencies.xcat'
; compfile = string, .xcat file (and path) with list of unused
; routines in !dustem_wrap_soft_dir/src/idl/.
; Default is './DustEMWrap_unused_routines.xcat'
;
; OUTPUTS:
;
; OPTIONAL OUTPUT PARAMETERS:
;
; ACCEPTED KEY-WORDS:
; help = If set, print this help
; steps = Stop after each proc
;
; 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 JPB Apr-2022
; 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_show_file_dependencies'
goto,the_end
END
use_outfile='./DustEMWrap_dependencies_extra.xcat'
use_compfile='./DustEMWrap_unused_routines.xcat'
if keyword_set(outfile) then use_outfile=outfile
if keyword_set(compfile) then use_compfile=compfile
; HERE IS WHERE YOU PUT THE TOP-LEVEL ROUTINES TO RUN
;===== The following is the list of non regression tests performed under idl and fawlty
dustem_init,/wrap
dustem_init,/wrap,/plot
dustem_init,model='LD01',/wrap,/plot
dustem_init,model='DL01_RV3P1_BC6',/wrap,/plot
dustem_init,model='WD01',/wrap,/plot
;;dustem_init,model='J13',/wrap,/plot,/pol ; this should fail
dustem_init,model='G17_MODELA',/wrap,/plot,/pol
dustem_init,model='G17_MODELB',/wrap,/plot,/pol
dustem_init,model='G17_MODELD',/wrap,/plot,/pol,grain_keywords=['?','plaw','?'],st_model=g17model_params,/noerase
dustem_init,model='G17_MODELD',/wrap,/plot,/pol,grain_keywords=['?','logn-pol','logn-pol'],st_model=g17model_logn_params,/noerase
dustem_run_example,'MC10',show="all"
;;if keyword_set(steps) then stop
dustem_run_example,'DBP90',show="rfield"
;;if keyword_set(steps) then stop
dustem_run_example,'DL01',show="emis"
;;if keyword_set(steps) then stop
dustem_run_example,'DL07',show="extir"
;;if keyword_set(steps) then stop
dustem_run_example,'G17_MODELA',show="all"
;;if keyword_set(steps) then stop
dustem_run_example,'G17_MODELB',show="polsed"
;;if keyword_set(steps) then stop
dustem_run_example,'G17_MODELC',show="polext"
;;if keyword_set(steps) then stop
dustem_run_example,'G17_MODELD',show="align"
;;if keyword_set(steps) then stop
dustem_run_example,'J13',show="extuv"
;;if keyword_set(steps) then stop
dustem_run_example,'WD01_RV5P5B',show=["alb","sdist"]
;;if keyword_set(steps) then stop
dustem_run_example,'MC10',show="all"
;;if keyword_set(steps) then stop
dustem_run_example,'DBP90',show="all"
;;if keyword_set(steps) then stop
dustem_run_example,'COMPIEGNE_ETAL10',show="all"
dustem_run_example,'DL01',show="all"
dustem_run_example,'DL01_RV3P1_BC6',show="all"
;;dustem_run_example,'DL01_RV5P5B_BC3',show="all" ; model removed from 2023 release
;;dustem_run_example,'DL01_RV5P5B_BC0',show="all" ; model removed from 2023 releaset
dustem_run_example,'DL07',show="extir"
dustem_run_example,'G17_MODELA',show="all"
dustem_run_example,'G17_MODELB',show="all"
dustem_run_example,'G17_MODELC',show="all"
dustem_run_example,'G17_MODELD',show="all"
dustem_run_example,'J13',show="all"
dustem_run_example,'AJ13',show="all"
dustem_run_example,'WD01_RV5P5B',show="all"
dustem_run_example,'LD01',show="all"
dustem_make_polarization_sed_example,model='G17_MODELA',outfile=!dustem_dat+'pol_sed_G17A.xcat'
dustem_make_polarization_sed_example,model='G17_MODELB',outfile=!dustem_dat+'pol_sed_G17B.xcat'
dustem_make_polarization_sed_example,model='G17_MODELC',outfile=!dustem_dat+'pol_sed_G17C.xcat'
dustem_make_polarization_sed_example,model='G17_MODELD',outfile=!dustem_dat+'pol_sed_G17D.xcat'
dustem_make_polarization_ext_example,model='G17_MODELA',outfile=!dustem_dat+'pol_ext_G17A.xcat'
dustem_make_polarization_ext_example,model='G17_MODELB',outfile=!dustem_dat+'pol_ext_G17B.xcat'
dustem_make_polarization_ext_example,model='G17_MODELC',outfile=!dustem_dat+'pol_ext_G17C.xcat'
dustem_make_polarization_ext_example,model='G17_MODELD',outfile=!dustem_dat+'pol_ext_G17D.xcat'
dustem_fit_intensity_example,Nitermax=2
dustem_fit_intensity_example,Nitermax=2,/noobj
dustem_fit_intensity_example,Nitermax=2,postscript=!dustem_dat+'dustemwrap_fit_intensity_example.ps'
dustem_fit_spectro_example,Nitermax=2
dustem_fit_spectro_example,Nitermax=2,/noob
dustem_fit_spectro_example,Nitermax=2,postscript=!dustem_dat+'dustemwrap_fit_spectro_example.ps'
dustem_fit_intensity_mbb_example,Nitermax=2
dustem_fit_intensity_mbb_example,Nitermax=2,/noobj
dustem_fit_intensity_mbb_example,Nitermax=2,postscript=!dustem_dat+'dustemwrap_fit_intensity_mbb_example.ps'
;;dustem_fit_polarization_example,Nitermax=2,model='DL01' ; should fail
dustem_fit_polarization_example,Nitermax=2
dustem_fit_polarization_example,Nitermax=2,/noobj
dustem_fit_polarization_example,Nitermax=2,postscript=!dustem_dat+'dustemwrap_fit_polarization_example.ps'
dustem_fit_polarization_example,Nitermax=3,sed_file=!dustem_dat+'pol_sed_G17D.xcat'
;;dustem_make_polarization_ext_example,model='MC10' ; should fail
dustem_fit_ext_example,Nitermax=2
dustem_fit_ext_example,Nitermax=2,/noobj
dustem_fit_ext_example,Nitermax=2,postscript=!dustem_dat+'dustemwrap_fit_ext_example.ps'
;;dustem_fit_ext_pol_example,model='J13' ; should fail
dustem_fit_ext_pol_example,Nitermax=3
dustem_fit_ext_pol_example,Nitermax=3,/noobj
dustem_fit_ext_pol_example,Nitermax=2,postscript=!dustem_dat+'dustemwrap_fit_ext_pol_example.ps'
dustem_fit_ext_pol_example,Nitermax=3,ext_file=!dustem_dat+'pol_ext_G17D.xcat'
dustem_fit_sed_ext_stokesi_example
dustem_fit_sed_ext_stokesi_example,/noobj
dustem_fit_sed_ext_stokesi_example, postscript=!dustem_dat+'dustemwrap_fit_sed_ext_stokesi_example.ps'
dustem_fit_sed_ext_pol_example,Nitermax=2
dustem_fit_sed_ext_pol_example,Nitermax=2, postscript=!dustem_dat+'dustemwrap_fit_sed_ext_pol_example.ps'
dustem_fit_sed_ext_pol_example,Nitermax=2,/noobj
dustem_fit_sed_ext_pol_example,Nitermax=2,ext_file=!dustem_dat+'pol_ext_G17D.xcat'
dustem_fit_sed_ext_pol_example,Nitermax=2,ext_file=!dustem_dat+'pol_ext_G17D.xcat',sed_file=!dustem_dat+'pol_sed_G17D.xcat'
dustem_myisrf_example,Nitermax=3
dustem_myisrf_example,Nitermax=3,/noobj
dustem_myisrf_example,Nitermax=2, postscript=!dustem_dat+'dustemwrap_myisrf_example.ps'
dustem_stellarpopisrf_example,Nitermax=3
dustem_stellarpopisrf_example,Nitermax=3,/noobj
dustem_stellarpopisrf_example,Nitermax=2, postscript=!dustem_dat+'dustemwrap_stellarpop_example.ps'
dustem_extract_sed_example
;dustem_fitsio_example,/nostop
; END LIST OF TOP-LEVEL ROUTINES
; CONSTRUCT A STRUCTURE WITH ROUTINES THAT WERE COMPILED DURING ABOVE RUNS
help,/function,output=ff
help,/pro,output=pp
ff=ff[1:*]
pp=pp[2:*]
nff=n_elements(ff)
npp=n_elements(pp)
one_func={name:'',path:'',args:ptr_new()}
one_pro={name:'',path:'',args:ptr_new()}
func_list=replicate(one_func,nff)
pro_list=replicate(one_pro,npp)
message,'Found '+string(nff)+' functions',/info
FOR i=0L,nff-1 DO BEGIN
str=strcompress(ff(i))
vv=str_sep(str,' ')
func_list(i).name=vv(0)
func_list(i).args=ptr_new(vv(1:*))
wh=which_pro(strlowcase(func_list(i).name))
func_list(i).path=wh(0)
ENDFOR
message,'Found '+string(npp)+' routines',/info
FOR i=0L,npp-1 DO BEGIN
str=strcompress(pp(i))
vv=str_sep(str,' ')
pro_list(i).name=vv(0)
pro_list(i).args=ptr_new(vv(1:*))
wh=which_pro(strlowcase(pro_list(i).name))
pro_list(i).path=wh(0)
ENDFOR
one_st={name:'',path:''}
st=replicate(one_st,nff+npp)
st.name=[func_list.name,pro_list.name]
st.path=[func_list.path,pro_list.path]
;=== remove empty names
ind=where(st.name NE '')
st=st(ind)
;=== remove empty path (are entries without .pro)
ind=where(st.path NE '')
st=st(ind)
;=== order by path
order=sort(st.path)
st=st(order)
write_xcat,st,use_outfile,/wiki
write_xcat,st,use_outfile
message,'Wrote '+use_outfile,/info
; CONSTRUCT A STRUCTURE WITH ROUTINES IN SRC/IDL THAT WERE NOT
; COMPILED DURING THE EXAMPLES
allpro=file_search(!dustem_wrap_soft_dir+'src/idl/*pro',count=nall)
match2,st.path,allpro,a,b
idx=where(b eq -1, ct)
if ct ne 0 then begin
ust=replicate(one_st,ct)
ust.path=allpro[idx]
ust.name=strupcase(file_basename(allpro[idx],'.pro'))
write_xcat,ust,use_compfile
message,'Wrote '+use_compfile,/info
end else begin
message,'No unused DustEMWrap routines',/info
end
stop
the_end:
END