Commit ab7bdcb33c68b2eb3f610757e4c4f1c4e83c9ba5
1 parent
33d72651
Exists in
master
Updated write and read methods for binary FITS outputs to be consistent with new plugin structure
Showing
2 changed files
with
16 additions
and
11 deletions
Show diff stats
src/idl/dustem_read_fits_table.pro
@@ -317,7 +317,7 @@ IF Nplugin NE 0 THEN BEGIN | @@ -317,7 +317,7 @@ IF Nplugin NE 0 THEN BEGIN | ||
317 | FOR i=0L,Nplugin-1 DO BEGIN | 317 | FOR i=0L,Nplugin-1 DO BEGIN |
318 | ;stop | 318 | ;stop |
319 | ;(*!dustem_plugin).(i).spec=ptr_new(str_plugin[i]) | 319 | ;(*!dustem_plugin).(i).spec=ptr_new(str_plugin[i]) |
320 | - (*!dustem_plugin).(i).spec=str_plugin[i] | 320 | + (*!dustem_plugin)[i].spec=str_plugin[i] |
321 | header=*headers_plugin[i] | 321 | header=*headers_plugin[i] |
322 | pluggin_name=strtrim(sxpar(header,'PLUGIN'),2) | 322 | pluggin_name=strtrim(sxpar(header,'PLUGIN'),2) |
323 | pluggin_scope=strtrim(sxpar(header,'SCOPE'),2) | 323 | pluggin_scope=strtrim(sxpar(header,'SCOPE'),2) |
@@ -329,8 +329,9 @@ IF Nplugin NE 0 THEN BEGIN | @@ -329,8 +329,9 @@ IF Nplugin NE 0 THEN BEGIN | ||
329 | ii=ii+1 | 329 | ii=ii+1 |
330 | ENDWHILE | 330 | ENDWHILE |
331 | paramtags=paramtags[1:*] | 331 | paramtags=paramtags[1:*] |
332 | - (*!dustem_plugin).(i).scope=ptr_new(pluggin_scope) | ||
333 | - (*!dustem_plugin).(i).PARAMTAG=ptr_new(paramtags) | 332 | + ;(*!dustem_plugin).(i).scope=ptr_new(pluggin_scope) |
333 | + (*!dustem_plugin)[i].scope=pluggin_scope | ||
334 | + (*!dustem_plugin)[i].PARAMTAG=ptr_new(paramtags) | ||
334 | ENDFOR | 335 | ENDFOR |
335 | ENDIF | 336 | ENDIF |
336 | 337 |
src/idl/dustem_write_fits_table.pro
@@ -188,16 +188,20 @@ ENDIF ELSE BEGIN | @@ -188,16 +188,20 @@ ENDIF ELSE BEGIN | ||
188 | unit_predicted_spectra_pol=-1 | 188 | unit_predicted_spectra_pol=-1 |
189 | unit_predicted_extinctions_pol=-1 | 189 | unit_predicted_extinctions_pol=-1 |
190 | ENDELSE | 190 | ENDELSE |
191 | -;==== add the pluggins spectra | ||
192 | -plugin_tags=tag_names(*!dustem_plugin) | 191 | +;==== add the spectra from plugins |
192 | +plugin_tags=(*!dustem_plugin).name | ||
193 | ind=where(plugin_tags NE 'NONE',Nplugins) | 193 | ind=where(plugin_tags NE 'NONE',Nplugins) |
194 | + | ||
195 | +;;stop | ||
194 | IF Nplugins NE 0 THEN BEGIN | 196 | IF Nplugins NE 0 THEN BEGIN |
195 | unit_plugins=lonarr(Nplugins) | 197 | unit_plugins=lonarr(Nplugins) |
196 | str_plugins=strarr(Nplugins) | 198 | str_plugins=strarr(Nplugins) |
197 | FOR i=0L,Nplugins-1 DO BEGIN | 199 | FOR i=0L,Nplugins-1 DO BEGIN |
198 | - mwrfits,*((*!dustem_plugin).(i).spec),file | 200 | + ;mwrfits,*((*!dustem_plugin).(i).spec),file |
201 | + mwrfits,*((*!dustem_plugin)[i].spec),file | ||
199 | unit_plugins[i]=unit | 202 | unit_plugins[i]=unit |
200 | - str_plugins[i]=plugin_tags[i] | 203 | +; str_plugins[i]=plugin_tags[i] |
204 | + str_plugins[i]=(*!dustem_plugin)[i].name | ||
201 | unit=unit+1 | 205 | unit=unit+1 |
202 | ENDFOR | 206 | ENDFOR |
203 | ENDIF ELSE BEGIN ;This is the case where there are no plugins involved | 207 | ENDIF ELSE BEGIN ;This is the case where there are no plugins involved |
@@ -371,10 +375,10 @@ sxaddpar,header_predicted_extinctions,'TITLE','OUTPUT BEST FIT PER-GRAIN AND TOT | @@ -371,10 +375,10 @@ sxaddpar,header_predicted_extinctions,'TITLE','OUTPUT BEST FIT PER-GRAIN AND TOT | ||
371 | FOR i=0L,Nplugins-1 DO BEGIN | 375 | FOR i=0L,Nplugins-1 DO BEGIN |
372 | header=*header_plugins[i] | 376 | header=*header_plugins[i] |
373 | sxaddpar,header,'PLUGIN',str_plugins[i],'Plugin name' | 377 | sxaddpar,header,'PLUGIN',str_plugins[i],'Plugin name' |
374 | - sxaddpar,header,'SCOPE',*((*!dustem_plugin).(i).scope),'Plugin scope' | ||
375 | - tags=*((*!dustem_plugin).(i).paramtag) | 378 | + sxaddpar,header,'SCOPE',(*!dustem_plugin)[i].scope,'Plugin scope' |
379 | + tags=*((*!dustem_plugin)[i].paramtag) | ||
376 | FOR j=0L,n_elements(tags)-1 DO BEGIN | 380 | FOR j=0L,n_elements(tags)-1 DO BEGIN |
377 | - sxaddpar,header,'TAGN'+strtrim(j+1,2),(*((*!dustem_plugin).(i).paramtag))[j],'Plugin parameter tag' | 381 | + sxaddpar,header,'TAGN'+strtrim(j+1,2),(*((*!dustem_plugin)[i].paramtag))[j],'Plugin parameter tag' |
378 | ENDFOR | 382 | ENDFOR |
379 | header_plugins[i]=ptr_new(header) | 383 | header_plugins[i]=ptr_new(header) |
380 | ENDFOR | 384 | ENDFOR |
@@ -423,7 +427,7 @@ IF !run_pol EQ 1 THEN BEGIN | @@ -423,7 +427,7 @@ IF !run_pol EQ 1 THEN BEGIN | ||
423 | mwrfits,dustem_st.polext,file | 427 | mwrfits,dustem_st.polext,file |
424 | ENDIF | 428 | ENDIF |
425 | FOR i=0L,Nplugins-1 DO BEGIN | 429 | FOR i=0L,Nplugins-1 DO BEGIN |
426 | - mwrfits,*((*!dustem_plugin).(i).spec),file,*header_plugins[i] | 430 | + mwrfits,*((*!dustem_plugin)[i].spec),file,*header_plugins[i] |
427 | ENDFOR | 431 | ENDFOR |
428 | 432 | ||
429 | message,'================================================',/info | 433 | message,'================================================',/info |