Commit 355953bcc15f333f084e64c41982798f50492b3b
1 parent
07c38c5f
Exists in
master
modifs because gdl does not accept keywords with same name as functions
Showing
4 changed files
with
16 additions
and
17 deletions
Show diff stats
src/idl/dustem_activate_plugins.pro
... | ... | @@ -80,7 +80,7 @@ endelse |
80 | 80 | ;PART WHERE THE PLUGINS RUN ACCORDING TO THEIR SCOPES. |
81 | 81 | |
82 | 82 | ;normal (additive) plugins come first as they can be used by other plugins |
83 | -;The ISRF plugin is next - we can always change its scope however we please to. DustEm runs here. This is with the /dustem_run keyword. | |
83 | +;The ISRF plugin is next - we can always change its scope however we please to. DustEm runs here. This is with the /force_dustem_run keyword. | |
84 | 84 | ;The plugins that use the DustEM output come next - we can always change their 'common' scope |
85 | 85 | |
86 | 86 | ;IF /avoid is used the specified scopes are avoided. They're considered when /avoid is missing. |
... | ... | @@ -91,7 +91,7 @@ dustem_run_plugins, p_dim ,param_descs, param_values, param_func, ['*STELLAR*',' |
91 | 91 | ;=== it would run fine if avoid was set to 1 |
92 | 92 | ;IC: I think the segmentation fault comes from the fact that the user wants to use models that have the /pol keyword in the GRAIN.DAT file without being in polarization mode. |
93 | 93 | |
94 | -dustem_run_plugins, p_dim ,param_descs, param_values, param_func, ['*STELLAR*','*ISRF*'] ,dustem_run=1,st=st ;dustem output is available at this step. | |
94 | +dustem_run_plugins, p_dim ,param_descs, param_values, param_func, ['*STELLAR*','*ISRF*'] ,force_dustem_run=1,st=st ;dustem output is available at this step. | |
95 | 95 | |
96 | 96 | ;added this small condition to ensure that dustem is run |
97 | 97 | ;(if no ISRF plugin is used) | ... | ... |
src/idl/dustem_compute_sed.pro
... | ... | @@ -59,11 +59,10 @@ IF keyword_set(help) THEN BEGIN |
59 | 59 | ENDIF |
60 | 60 | |
61 | 61 | IF not keyword_set(st) THEN BEGIN |
62 | - dustem_activate_plugins,p_dim/(*(*!dustem_fit).param_init_values),st=st | |
62 | + dustem_activate_plugins,p_dim/(*(*!dustem_fit).param_init_values),st=st | |
63 | 63 | ENDIF |
64 | 64 | |
65 | 65 | ; Convert into MJy/sr/1d20 |
66 | - | |
67 | 66 | fact = 1.e4*(*!dustem_HCD)/(4.*!pi)/(3.e8/1.e-6/st.sed.wav)*1.e20/1.e7 ;this is correct despite the way it is presented (1.e4/1e.7*1e.20=1.e17 which is the factor to convert from ergs to Mega Janskys) |
68 | 67 | SED_spec = st.sed.em_tot * fact |
69 | 68 | ... | ... |
src/idl/dustem_run_plugins.pro
... | ... | @@ -5,7 +5,7 @@ PRO dustem_run_plugins, p_dim ,$ |
5 | 5 | scopes,$ |
6 | 6 | st=st,$ |
7 | 7 | avoid=avoid,$ |
8 | - dustem_run=dustem_run,$ | |
8 | + force_dustem_run=force_dustem_run,$ | |
9 | 9 | help=help |
10 | 10 | |
11 | 11 | ;+ |
... | ... | @@ -20,7 +20,7 @@ PRO dustem_run_plugins, p_dim ,$ |
20 | 20 | ; DustEMWrap, Distributed, Mid-Level, Plugins |
21 | 21 | ; |
22 | 22 | ; CALLING SEQUENCE: |
23 | -; dustem_run_plugins,p_dim,param_descs,param_values,scopes,[,st][,avoid][,dustem_run][,/help] | |
23 | +; dustem_run_plugins,p_dim,param_descs,param_values,scopes,[,st][,avoid][,force_dustem_run][,/help] | |
24 | 24 | ; |
25 | 25 | ; INPUTS: |
26 | 26 | ; p_dim = parameter values |
... | ... | @@ -31,7 +31,7 @@ PRO dustem_run_plugins, p_dim ,$ |
31 | 31 | ; |
32 | 32 | ; OPTIONAL INPUT PARAMETERS: |
33 | 33 | ; avoid = scopes should be avoided |
34 | -; dustem_run = Dustem should be run | |
34 | +; force_dustem_run = Dustem should be run | |
35 | 35 | ; |
36 | 36 | ; OUTPUTS: |
37 | 37 | ; None |
... | ... | @@ -55,7 +55,7 @@ PRO dustem_run_plugins, p_dim ,$ |
55 | 55 | ; PROCEDURES AND SUBROUTINES USED: |
56 | 56 | ; |
57 | 57 | ; EXAMPLES |
58 | -; dustem_activate_plugins, p_min, pram_descs, param_values, param_func, scopes, st=st, avoid=avoid, dustem_run=dustem_run | |
58 | +; dustem_run_plugins, p_min, param_descs, param_values, param_func, scopes, st=st, avoid=avoid, /force_dustem_run | |
59 | 59 | ; |
60 | 60 | ; MODIFICATION HISTORY: |
61 | 61 | ; Written by IC |
... | ... | @@ -76,7 +76,7 @@ IF (tag_names(*!dustem_plugin))(0) EQ 'NONE' THEN goto, the_end |
76 | 76 | |
77 | 77 | ;Just to be sure |
78 | 78 | if not keyword_set(avoid) then avoid=0 |
79 | -if not keyword_set(dustem_run) then dustem_run=0 | |
79 | +if not keyword_set(force_dustem_run) then force_dustem_run=0 | |
80 | 80 | |
81 | 81 | ;stop |
82 | 82 | |
... | ... | @@ -135,7 +135,7 @@ IF ~test_all_scopes THEN BEGIN |
135 | 135 | |
136 | 136 | ;==============Dry run of the plugins to obtain their scopes and run them accordingly============== |
137 | 137 | |
138 | - str='toto='+ftn+'(scope=scope)' & str=str(0) | |
138 | + str='toto='+ftn+'(scope=scope)' & str=str[0] | |
139 | 139 | toto=execute(str) |
140 | 140 | ((*!dustem_plugin).(k).scope)=ptr_new(scope) |
141 | 141 | |
... | ... | @@ -177,7 +177,8 @@ FOR i=0L,n_elements(scopes)-1 DO BEGIN |
177 | 177 | ;Now locating the indices of this scope in !dustem_plugin. |
178 | 178 | |
179 | 179 | FOR j=0L,n_tags(*!dustem_plugin)-1 DO BEGIN |
180 | - | |
180 | + | |
181 | + stop | |
181 | 182 | test = strcmp((*((*!dustem_plugin).(j).scope)),scope_to_match,strlen(scope_to_match),/FOLD_CASE) EQ 1 |
182 | 183 | |
183 | 184 | IF test and keyword_set(avoid) THEN BEGIN |
... | ... | @@ -271,10 +272,9 @@ ENDFOR |
271 | 272 | |
272 | 273 | |
273 | 274 | the_end: |
274 | -if keyword_set(dustem_run) then begin ;and idd gt 0. : remved this so that dustem is always run when the keyword is mentioned. | |
275 | +if keyword_set(force_dustem_run) then begin ;and idd gt 0. : remved this so that dustem is always run when the keyword is mentioned. | |
275 | 276 | st = dustem_run(p_dim) |
276 | 277 | !dustem_current = ptr_new(st) |
277 | 278 | endif |
278 | 279 | |
279 | - | |
280 | 280 | END | ... | ... |
src/idl/dustem_run_prediction_example.pro
... | ... | @@ -8,6 +8,7 @@ PRO dustem_run_prediction_example, model $ |
8 | 8 | ,show=show $ |
9 | 9 | ,fits_save=fits_save $ |
10 | 10 | ,noobj=noobj $ |
11 | + ,noexit=noexit $ | |
11 | 12 | ,help=help |
12 | 13 | |
13 | 14 | ;+ |
... | ... | @@ -204,7 +205,6 @@ dustem_Uext=dustem_Iext*0. |
204 | 205 | |
205 | 206 | ;== Now we have a predicted SED (I), we fill up a structure that we |
206 | 207 | ;== will write to the sed_outfile |
207 | -;== if you | |
208 | 208 | sed.stokesI=dustem_Ised |
209 | 209 | sed.stokesQ=dustem_Qsed |
210 | 210 | sed.stokesU=dustem_Used |
... | ... | @@ -247,9 +247,9 @@ message,'Wrote '+use_ext_outfile,/continue |
247 | 247 | |
248 | 248 | ;=== MAKE A PLOT TO VISUALISE THE OUTPUT |
249 | 249 | IF !dustem_noobj THEN BEGIN |
250 | - dustemwrap_plot_noobj,*(*!dustem_fit).CURRENT_PARAM_VALUES,st=dummy,xr=xr,/xstyle,yr=yr,/ysty,/ylog,/xlog,title=tit | |
250 | + dustemwrap_plot_noobj,pval,st=dummy,xr=xr,/xstyle,yr=yr,/ysty,/ylog,/xlog,title=tit | |
251 | 251 | ENDIF ELSE BEGIN |
252 | - dustemwrap_plot,*(*!dustem_fit).CURRENT_PARAM_VALUES,st=dummy,xr=xr,/xstyle,yr=yr,/ysty,/ylog,/xlog,title=tit | |
252 | + dustemwrap_plot,pval,st=dummy,xr=xr,/xstyle,yr=yr,/ysty,/ylog,/xlog,title=tit | |
253 | 253 | ENDELSE |
254 | 254 | |
255 | 255 | |
... | ... | @@ -260,6 +260,6 @@ ENDIF |
260 | 260 | |
261 | 261 | the_end: |
262 | 262 | message,'Finished dustem_run_prediction_example',/info |
263 | -stop | |
263 | +if keyword_set(noexit) then stop | |
264 | 264 | |
265 | 265 | END | ... | ... |