Closed pllim closed 1 year ago
Particularly, I cannot find where I am supposed to stick the GWCS object in the tree in a way that an existing ASDF in FITS parser that I know works for JWST data, would work here.
For writing JWST-like files you will likely want to use an appropriate DataModel like the ImageModel https://stdatamodels.readthedocs.io/en/latest/api/jwst.datamodels.ImageModel.html#jwst.datamodels.ImageModel
Are you saying that, if I have some image HDU (that is not really JWST data) and GWCS, there is no way I can put it into ASDF in FITS? Your example does not mention where I should put the GWCS in the tree. And I thought GWCS is the whole reason why we use this?
The file format places no restriction on where the GWCS is located in the tree. If you'd like the file to be compatible with JWST tools you're better off using a DataModel.
There is no requirement to use AsdfInFits for GWCS: https://gwcs.readthedocs.io/en/latest/#save-a-wcs-object-as-a-pure-asdf-file
It's okay. I don't need the distortion, so I found an easier way to do what I wanted without GWCS, so I don't have to use this.
https://stdatamodels.readthedocs.io/en/latest/asdf_in_fits.html#writing-asdfinfits-files
This section currently does not tell me how to write out a ASDF-in-FITS file that is what I would expect JWST would use. I have a legit
ImageHDU
and a GWCS to go with it. I don't know how to write that out to a "ASDF in FITS" format even after reading this doc.