You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This topic was brought up at the UNC meeting. The argument is that, since in order to write a linear solution in the header we are linearizing the data therefore we are re-sampling it. The request was to allow the data to be written as a table of wavelength and intensity (maybe multi-extension fits).
I need to look this up in more details. I would discard writting non-linear solutions in the header since the documentation is poor and is really complicated.
The text was updated successfully, but these errors were encountered:
I'm still not in favor of writing fits files as tables because the model information is lost.
To recover it would be necessary to do a fit, again information is lost and errors not tracked.
Some people might not need to recover the model information.
As an alternative solution for this is to use adsf+gwcs, I'm still not fully confidant with these tools but in general they allow to serialize arrays and models.
For example, to write:
from asdf import AsdfFile
f = AsdfFile()
print(f.tree)
# will print {}
# adding attributes, poly is an astropy.modeling.Model instance, wavelength
# and intensity are arrays.
f.tree['model'] = poly
f.tree['wavelength'] = wavelength
f.tree['flux'] = intensity
# finally write to a file
f.write_to('testfile.asdf')
To read:
ff=asdf.open('testfile.asdf')
# how access attributes or fields in the tree.ff.tree['model'](range(len(intensity)))
This topic was brought up at the UNC meeting. The argument is that, since in order to write a linear solution in the header we are linearizing the data therefore we are re-sampling it. The request was to allow the data to be written as a table of wavelength and intensity (maybe multi-extension fits).
I need to look this up in more details. I would discard writting non-linear solutions in the header since the documentation is poor and is really complicated.
The text was updated successfully, but these errors were encountered: