avoid TTYPE etc. FITS warnings when writing frames with fibermaps #1479
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An unintended side effect of PR #1454 to support fibermap reading with astropy 4.3.1 (i.e. by using fitsio instead and then putting into an astropy Table), was a bunch of warning messages when trying to write it back out as part of
desispec.io.frame.write_frame
due to it usingastropy.io.fits.convenience.table_to_hdu
:Current master produces 178 warning messages per call to table_to_hdu (which gets multiplied by 30 when wrapped by the pipeline for 30 cameras in parallel...)
This PR uses
desispec.io.util.addkeys
indesispec.io.fibermap.read_fibermap
to not put these keys into thefibermap.meta
dictionary in the first place:Note: this isn't a complete solution because the comments associated with each header keyword still get lost, but they were getting lost before anyway. PR #1459 is fixing that when creating the original fibermap, but we'll need more work downstream to make full use of that. This PR just just trying to quiet down the 5k warning messages when writing frames.