Blame view

src/idl/dustem_show_file_dependencies.pro 5.26 KB
6f5410a4   Annie Hughes   added simplistic ...
1
PRO dustem_show_file_dependencies,help=help,outfile=outfile,compfile=compfile
11e99b65   Annie Hughes   first commit
2

11e99b65   Annie Hughes   first commit
3
4
5
;+
; NAME:
;    dustem_show_file_dependencies
6f5410a4   Annie Hughes   added simplistic ...
6
;
11e99b65   Annie Hughes   first commit
7
; PURPOSE:
6f5410a4   Annie Hughes   added simplistic ...
8
9
;    Generate a list of routines used during a DustEMWrap run
;
11e99b65   Annie Hughes   first commit
10
; CATEGORY:
77c41759   Annie Hughes   added init wrapte...
11
;    DustEMWrap, Distributed, Low-Level, Development
6f5410a4   Annie Hughes   added simplistic ...
12
;
11e99b65   Annie Hughes   first commit
13
; CALLING SEQUENCE:
77c41759   Annie Hughes   added init wrapte...
14
;    dustem_show_file_dependencies[,help=help][,outfile=]
6f5410a4   Annie Hughes   added simplistic ...
15
;
11e99b65   Annie Hughes   first commit
16
17
; INPUTS:
;    None
6f5410a4   Annie Hughes   added simplistic ...
18
;
11e99b65   Annie Hughes   first commit
19
; OPTIONAL INPUT PARAMETERS:
50bb5343   Annie Hughes   minor changes to ...
20
21
;    outfile = string, .xcat file (and path) with list of compiled routines and
;            functions. Default is './DustEMWrap_dependencies.xcat'
6f5410a4   Annie Hughes   added simplistic ...
22
23
;    compfile = string, .xcat file (and path) with list of unused
;    routines in !dustem_wrap_soft_dir/src/idl/. Default is './DustEMWrap_unused_routines.xcat'
11e99b65   Annie Hughes   first commit
24
; OUTPUTS:
6f5410a4   Annie Hughes   added simplistic ...
25
;
11e99b65   Annie Hughes   first commit
26
; OPTIONAL OUTPUT PARAMETERS:
6f5410a4   Annie Hughes   added simplistic ...
27
;
11e99b65   Annie Hughes   first commit
28
29
; ACCEPTED KEY-WORDS:
;    help      = If set, print this help
6f5410a4   Annie Hughes   added simplistic ...
30
;
11e99b65   Annie Hughes   first commit
31
32
; COMMON BLOCKS:
;    None
6f5410a4   Annie Hughes   added simplistic ...
33
;
11e99b65   Annie Hughes   first commit
34
35
; SIDE EFFECTS:
;    None
6f5410a4   Annie Hughes   added simplistic ...
36
;
11e99b65   Annie Hughes   first commit
37
38
39
; RESTRICTIONS:
;    The DustEM fortran code must be installed
;    The DustEMWrap IDL code must be installed
6f5410a4   Annie Hughes   added simplistic ...
40
;
11e99b65   Annie Hughes   first commit
41
; PROCEDURES AND SUBROUTINES USED:
77c41759   Annie Hughes   added init wrapte...
42
;    
11e99b65   Annie Hughes   first commit
43
; EXAMPLES
77c41759   Annie Hughes   added init wrapte...
44
 ; 
11e99b65   Annie Hughes   first commit
45
46
47
48
49
50
51
52
53
54
; MODIFICATION HISTORY:
;    Written by JPB Apr-2011
;    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

50bb5343   Annie Hughes   minor changes to ...
55
use_outfile='./DustEMWrap_dependencies.xcat'
6f5410a4   Annie Hughes   added simplistic ...
56
use_compfile='./DustEMWrap_unused_routines.xcat'
50bb5343   Annie Hughes   minor changes to ...
57
if keyword_set(outfile) then use_outfile=outfile
6f5410a4   Annie Hughes   added simplistic ...
58
if keyword_set(compfile) then use_compfile=compfile
50bb5343   Annie Hughes   minor changes to ...
59
60

; HERE IS WHERE YOU PUT THE TOP-LEVEL ROUTINES TO RUN 
7fb01a01   Jean-Philippe Bernard   modified to get a...
61
62
63
64


;/Users/jpb/Soft_Libraries/dustem-wrapper_idl/src/idl/dustem_run_example.pro
;/Users/jpb/Soft_Libraries/dustem-wrapper_idl/src/idl/dustem_stellarpopisrf_example.pro
d86a4188   Jean-Philippe Bernard   added a call with...
65
;===== The following is the list of non regression tests performed under idl and fawlty
77c41759   Annie Hughes   added init wrapte...
66
dustem_init,/wrap,/plot
6f5410a4   Annie Hughes   added simplistic ...
67
dustem_run_example,'MC10',show="all"
c8f2e8b7   Annie Hughes   fixed error in fi...
68
69
70
dustem_make_polarization_sed_example,model='G17_MODELD',outfile='./pol_sed_G17D.xcat'
dustem_fit_intensity_example,Nitermax=5,fits_save_and_restore='/tmp/mysavefile1.fits'
dustem_fit_intensity_example,Nitermax=1,/noobj
d0f68bb6   Jean-Philippe Bernard   replaced system v...
71
dustem_fit_intensity_mbb_example,Nitermax=1,postscript='/tmp/dustemwrap_postcript_example.ps'
c8f2e8b7   Annie Hughes   fixed error in fi...
72
73
74
75
76
77
78
79
80
81
82
83
dustem_fit_polarization_example,Nitermax=1,fits_save_and_restore='/tmp/mysavefile2.fits'
dustem_make_polarization_ext_example,model='G17_MODELD',outfile='./pol_ext_G17D.xcat'
dustem_make_polarization_ext_example,model='G17_MODELA',outfile='./pol_ext_G17A.xcat'
dustem_fit_ext_example,Nitermax=1,fits_save_and_restore='/tmp/mysavefile3.fits'
dustem_fit_ext_pol_example,Nitermax=3,fits_save_and_restore='/tmp/mysavefile4.fits'
;following fails in the write_fits_table
dustem_fit_ext_pol_example,Nitermax=3,ext_file='./pol_ext_G17D.xcat';,fits_save_and_restore='/tmp/mysavefile5.fits'
dustem_fit_sed_ext_pol_example,Nitermax=2,fits_save_and_restore='/tmp/mysavefile6.fits'
;following fails in the write_fits_table
;dustem_fit_sed_ext_pol_example,Nitermax=5,fits_save_and_restore='/tmp/mysavefile7.fits',ext_file='./pol_ext_G17D.xcat',sed_file='./pol_sed_G17D.xcat'
dustem_fit_sed_ext_pol_example,Nitermax=5,ext_file='./pol_ext_G17D.xcat',sed_file='./pol_sed_G17D.xcat'

8e55ab4d   Jean-Philippe Bernard   removed frequency...
84
;=== for some reason plot goes red here under fawlty
e52e8a3e   Jean-Philippe Bernard   improved
85
;=== and fails when run with only the minimal dustemwrap installed (stellar . txt file is missing)
c8f2e8b7   Annie Hughes   fixed error in fi...
86
;dustem_myisrf_example,Nitermax=1,fits_save_and_restore='/tmp/mysavefile5.fits'
e52e8a3e   Jean-Philippe Bernard   improved
87
;=== fails when run with only the minimal dustemwrap installed (stellar . txt file is missing)
c8f2e8b7   Annie Hughes   fixed error in fi...
88
;dustem_stellarpopisrf_example,Nitermax=1,fits_save_and_restore='/tmp/mysavefile6.fits'
0dda35a7   Jean-Philippe Bernard   modified to inclu...
89

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

6f5410a4   Annie Hughes   added simplistic ...
92
; CONSTRUCT A STRUCTURE WITH ROUTINES THAT WERE COMPILED DURING ABOVE RUNS
11e99b65   Annie Hughes   first commit
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
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 ...
145
write_xcat,st,use_outfile,/wiki
79c1bf1f   Annie Hughes   write to screen w...
146
write_xcat,st,use_outfile
50bb5343   Annie Hughes   minor changes to ...
147
message,'Wrote '+use_outfile,/info
11e99b65   Annie Hughes   first commit
148

6f5410a4   Annie Hughes   added simplistic ...
149
150
151
152

; 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...
153
match2,st.path,allpro,a,b
6f5410a4   Annie Hughes   added simplistic ...
154
155
156
157
158
159
160
161
162
163
164
165
166
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[xx],'.pro'))
   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
167
168
the_end:
END