Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow other ways to store wavelength Solutions #53

Closed
simontorres opened this issue Apr 5, 2017 · 4 comments
Closed

Allow other ways to store wavelength Solutions #53

simontorres opened this issue Apr 5, 2017 · 4 comments
Labels
enhancement March 2024 Sprint Solve long standing issues and implement new requirements.
Milestone

Comments

@simontorres
Copy link
Member

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.

@simontorres simontorres added this to the Beta Version milestone Apr 5, 2017
@cbaorion
Copy link
Collaborator

cbaorion commented Apr 5, 2017

I agree.

@simontorres
Copy link
Member Author

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)))

@simontorres simontorres added the March 2024 Sprint Solve long standing issues and implement new requirements. label Mar 6, 2024
@simontorres
Copy link
Member Author

We need to revisit this because of #384

@simontorres
Copy link
Member Author

This is kind of redundant, please focus attention in #384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement March 2024 Sprint Solve long standing issues and implement new requirements.
Projects
None yet
Development

No branches or pull requests

2 participants