Skip to content

Commit

Permalink
add further explanation in comment for re-inserting WCSAXES keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
jchiang87 committed Jun 9, 2019
1 parent 699fc84 commit ef7e897
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python/desc/imsim/camera_readout.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,10 @@ def write_fits_file(self, outfile, overwrite=True, run_number=None,
"""
output = fits.HDUList(fits.PrimaryHDU())
output[0].header = self.eimage[0].header
# Re-insert the WCSAXES keyword to precede any other WCS
# keywords as stipulated in the FITS Standard, version 4.0,
# section 8.2.
# Since `.header` acts like an unordered dict when set like
# this, we need to re-insert the WCSAXES keyword to precede
# any other WCS keywords as stipulated in the FITS Standard,
# version 4.0, section 8.2.
wcsaxes = output[0].header['WCSAXES']
del output[0].header['WCSAXES']
output[0].header.insert(5, ('WCSAXES', wcsaxes, ''))
Expand Down

0 comments on commit ef7e897

Please sign in to comment.