Blame view

src/idl/dustem_show_file_dependencies.pro 8.67 KB
f25d808a   Annie Hughes   updated regressio...
1
2
3
4
PRO dustem_show_file_dependencies,help=help $
                                  ,outfile=outfile $
                                  ,compfile=compfile $
                                  ,steps=steps
11e99b65   Annie Hughes   first commit
5

11e99b65   Annie Hughes   first commit
6
7
8
;+
; NAME:
;    dustem_show_file_dependencies
6f5410a4   Annie Hughes   added simplistic ...
9
;
11e99b65   Annie Hughes   first commit
10
; PURPOSE:
6f5410a4   Annie Hughes   added simplistic ...
11
12
;    Generate a list of routines used during a DustEMWrap run
;
11e99b65   Annie Hughes   first commit
13
; CATEGORY:
77c41759   Annie Hughes   added init wrapte...
14
;    DustEMWrap, Distributed, Low-Level, Development
6f5410a4   Annie Hughes   added simplistic ...
15
;
11e99b65   Annie Hughes   first commit
16
; CALLING SEQUENCE:
77c41759   Annie Hughes   added init wrapte...
17
;    dustem_show_file_dependencies[,help=help][,outfile=]
6f5410a4   Annie Hughes   added simplistic ...
18
;
11e99b65   Annie Hughes   first commit
19
20
; INPUTS:
;    None
6f5410a4   Annie Hughes   added simplistic ...
21
;
11e99b65   Annie Hughes   first commit
22
; OPTIONAL INPUT PARAMETERS:
50bb5343   Annie Hughes   minor changes to ...
23
24
;    outfile = string, .xcat file (and path) with list of compiled routines and
;            functions. Default is './DustEMWrap_dependencies.xcat'
6f5410a4   Annie Hughes   added simplistic ...
25
;    compfile = string, .xcat file (and path) with list of unused
f25d808a   Annie Hughes   updated regressio...
26
27
;            routines in !dustem_wrap_soft_dir/src/idl/.
;            Default is './DustEMWrap_unused_routines.xcat'
ea8fc831   Annie Hughes   latest complete ...
28
;
11e99b65   Annie Hughes   first commit
29
; OUTPUTS:
6f5410a4   Annie Hughes   added simplistic ...
30
;
11e99b65   Annie Hughes   first commit
31
; OPTIONAL OUTPUT PARAMETERS:
6f5410a4   Annie Hughes   added simplistic ...
32
;
11e99b65   Annie Hughes   first commit
33
34
; ACCEPTED KEY-WORDS:
;    help      = If set, print this help
f25d808a   Annie Hughes   updated regressio...
35
36
;    steps     = Stop after each proc
;  
11e99b65   Annie Hughes   first commit
37
38
; COMMON BLOCKS:
;    None
6f5410a4   Annie Hughes   added simplistic ...
39
;
11e99b65   Annie Hughes   first commit
40
41
; SIDE EFFECTS:
;    None
6f5410a4   Annie Hughes   added simplistic ...
42
;
11e99b65   Annie Hughes   first commit
43
44
45
; RESTRICTIONS:
;    The DustEM fortran code must be installed
;    The DustEMWrap IDL code must be installed
6f5410a4   Annie Hughes   added simplistic ...
46
;
11e99b65   Annie Hughes   first commit
47
; PROCEDURES AND SUBROUTINES USED:
77c41759   Annie Hughes   added init wrapte...
48
;    
11e99b65   Annie Hughes   first commit
49
; EXAMPLES
f25d808a   Annie Hughes   updated regressio...
50
; 
11e99b65   Annie Hughes   first commit
51
; MODIFICATION HISTORY:
f25d808a   Annie Hughes   updated regressio...
52
;    Written by JPB Apr-2022
11e99b65   Annie Hughes   first commit
53
54
;    Evolution details on the DustEMWrap gitlab.
;    See http://dustemwrap.irap.omp.eu/ for FAQ and help.  
f25d808a   Annie Hughes   updated regressio...
55
56
;+
  
11e99b65   Annie Hughes   first commit
57
58
59
60
61
if keyword_set(help) then begin 
  doc_library,'dustem_show_file_dependencies'
  goto,the_end
END

50bb5343   Annie Hughes   minor changes to ...
62
use_outfile='./DustEMWrap_dependencies.xcat'
6f5410a4   Annie Hughes   added simplistic ...
63
use_compfile='./DustEMWrap_unused_routines.xcat'
50bb5343   Annie Hughes   minor changes to ...
64
if keyword_set(outfile) then use_outfile=outfile
6f5410a4   Annie Hughes   added simplistic ...
65
if keyword_set(compfile) then use_compfile=compfile
50bb5343   Annie Hughes   minor changes to ...
66
67

; HERE IS WHERE YOU PUT THE TOP-LEVEL ROUTINES TO RUN 
d86a4188   Jean-Philippe Bernard   added a call with...
68
;===== The following is the list of non regression tests performed under idl and fawlty
f25d808a   Annie Hughes   updated regressio...
69
70

dustem_init,/wrap
77c41759   Annie Hughes   added init wrapte...
71
dustem_init,/wrap,/plot
f25d808a   Annie Hughes   updated regressio...
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
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

6f5410a4   Annie Hughes   added simplistic ...
103
dustem_run_example,'MC10',show="all"
f25d808a   Annie Hughes   updated regressio...
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
;;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 release

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='/tmp/pol_sed_G17A.xcat'
dustem_make_polarization_sed_example,model='G17_MODELB',outfile='/tmp/pol_sed_G17B.xcat'
dustem_make_polarization_sed_example,model='G17_MODELC',outfile='/tmp/pol_sed_G17C.xcat'
dustem_make_polarization_sed_example,model='G17_MODELD',outfile='/tmp/pol_sed_G17D.xcat'

dustem_make_polarization_ext_example,model='G17_MODELA',outfile='/tmp/pol_ext_G17A.xcat'
dustem_make_polarization_ext_example,model='G17_MODELB',outfile='/tmp/pol_ext_G17B.xcat'
dustem_make_polarization_ext_example,model='G17_MODELC',outfile='/tmp/pol_ext_G17C.xcat'
dustem_make_polarization_ext_example,model='G17_MODELD',outfile='/tmp/pol_ext_G17D.xcat'

dustem_fit_intensity_example,Nitermax=2
dustem_fit_intensity_example,Nitermax=2,/noobj
dustem_fit_intensity_example,Nitermax=2,postscript='/tmp/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='/tmp/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='/tmp/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='/tmp/dustemwrap_fit_polarization_example.ps'
dustem_fit_polarization_example,Nitermax=3,sed_file='/tmp/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='/tmp/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='/tmp/dustemwrap_fit_ext_pol_example.ps'
dustem_fit_ext_pol_example,Nitermax=3,ext_file='/tmp/pol_ext_G17D.xcat'


dustem_fit_sed_ext_stokesi_example 
dustem_fit_sed_ext_stokesi_example,/noobj 
dustem_fit_sed_ext_stokesi_example, postscript='/tmp/dustemwrap_fit_sed_ext_stokesi_example.ps'


dustem_fit_sed_ext_pol_example,Nitermax=2
dustem_fit_sed_ext_pol_example,Nitermax=2, postscript='/tmp/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='/tmp/pol_ext_G17D.xcat'
dustem_fit_sed_ext_pol_example,Nitermax=2,ext_file='/tmp/pol_ext_G17D.xcat',sed_file='/tmp/pol_sed_G17D.xcat'

dustem_myisrf_example,Nitermax=3
dustem_myisrf_example,Nitermax=3,/noobj
dustem_myisrf_example,Nitermax=2, postscript='/tmp/dustemwrap_myisrf_example.ps'

dustem_stellarpopisrf_example,Nitermax=3
dustem_stellarpopisrf_example,Nitermax=3,/noobj
dustem_stellarpopisrf_example,Nitermax=2, postscript='/tmp/dustemwrap_stellarpop_example.ps'


;dustem_fitsio_example,/nostop
0dda35a7   Jean-Philippe Bernard   modified to inclu...
197

50bb5343   Annie Hughes   minor changes to ...
198
199
; END LIST OF TOP-LEVEL ROUTINES

6f5410a4   Annie Hughes   added simplistic ...
200
; CONSTRUCT A STRUCTURE WITH ROUTINES THAT WERE COMPILED DURING ABOVE RUNS
11e99b65   Annie Hughes   first commit
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
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)

50bb5343   Annie Hughes   minor changes to ...
253
write_xcat,st,use_outfile,/wiki
79c1bf1f   Annie Hughes   write to screen w...
254
write_xcat,st,use_outfile
50bb5343   Annie Hughes   minor changes to ...
255
message,'Wrote '+use_outfile,/info
11e99b65   Annie Hughes   first commit
256

6f5410a4   Annie Hughes   added simplistic ...
257
258
259
260

; 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)
c8f2e8b7   Annie Hughes   fixed error in fi...
261
match2,st.path,allpro,a,b
6f5410a4   Annie Hughes   added simplistic ...
262
263
264
265
idx=where(b eq -1, ct)
if ct ne 0 then begin
   ust=replicate(one_st,ct)
   ust.path=allpro[idx]
ea8fc831   Annie Hughes   latest complete ...
266
   ust.name=strupcase(file_basename(allpro[idx],'.pro'))
6f5410a4   Annie Hughes   added simplistic ...
267
268
269
270
271
272
273
274
   write_xcat,ust,use_compfile
   message,'Wrote '+use_compfile,/info
end else begin
   message,'No unused DustEMWrap routines',/info
end


stop
11e99b65   Annie Hughes   first commit
275
276
the_end:
END