specutils icon indicating copy to clipboard operation
specutils copied to clipboard

Fix for Tabular-fits reader/writer fix

Open kelle opened this issue 2 years ago • 19 comments

This PR modifies the tabular-fits writer to put the header information in BOTH HDU0 and HDU1 based on the conversation in #905 .

Other folks are welcome to modify this PR.

Broke out the testing of the update_header method into its own test.

fits compressed currently failing but I think that might be a file/memory handling thing which I may have accidentally broken in the test file.

Remaining Todo:

  • [x] fix broken fits_compressed test
  • [ ] add more tests
  • [ ] add test that makes sure COMMENT and HISTORY keywords are perserved
  • [x] make sure reader is doing what we expect
  • [x] fix update_header behavior and tests.

kelle avatar Nov 22 '23 20:11 kelle

At some point as part of the read method, the Header object gets converted into an OrderedDict. Not sure where that's happening...I don't see that in the tabular_fits_loader function.

kelle avatar Nov 22 '23 21:11 kelle

I think the trouble is in Table.read which I guess changes everything to an ordered dictionary....FML.

kelle avatar Nov 22 '23 21:11 kelle

Added this to the reader and all is now well

tab.meta = fits.getheader(file_obj, 0)

kelle avatar Nov 22 '23 21:11 kelle