Commit ab7bdcb33c68b2eb3f610757e4c4f1c4e83c9ba5

Authored by Annie Hughes
1 parent 33d72651
Exists in master

Updated write and read methods for binary FITS outputs to be consistent with new plugin structure

src/idl/dustem_read_fits_table.pro
... ... @@ -317,7 +317,7 @@ IF Nplugin NE 0 THEN BEGIN
317 317 FOR i=0L,Nplugin-1 DO BEGIN
318 318 ;stop
319 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 321 header=*headers_plugin[i]
322 322 pluggin_name=strtrim(sxpar(header,'PLUGIN'),2)
323 323 pluggin_scope=strtrim(sxpar(header,'SCOPE'),2)
... ... @@ -329,8 +329,9 @@ IF Nplugin NE 0 THEN BEGIN
329 329 ii=ii+1
330 330 ENDWHILE
331 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 335 ENDFOR
335 336 ENDIF
336 337  
... ...
src/idl/dustem_write_fits_table.pro
... ... @@ -188,16 +188,20 @@ ENDIF ELSE BEGIN
188 188 unit_predicted_spectra_pol=-1
189 189 unit_predicted_extinctions_pol=-1
190 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 193 ind=where(plugin_tags NE 'NONE',Nplugins)
  194 +
  195 +;;stop
194 196 IF Nplugins NE 0 THEN BEGIN
195 197 unit_plugins=lonarr(Nplugins)
196 198 str_plugins=strarr(Nplugins)
197 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 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 205 unit=unit+1
202 206 ENDFOR
203 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 375 FOR i=0L,Nplugins-1 DO BEGIN
372 376 header=*header_plugins[i]
373 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 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 382 ENDFOR
379 383 header_plugins[i]=ptr_new(header)
380 384 ENDFOR
... ... @@ -423,7 +427,7 @@ IF !run_pol EQ 1 THEN BEGIN
423 427 mwrfits,dustem_st.polext,file
424 428 ENDIF
425 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 431 ENDFOR
428 432  
429 433 message,'================================================',/info
... ...