Skip to content

Commit

Permalink
re-insert the WCSAXES keyword to precede other WCS keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
jchiang87 committed Jun 6, 2019
1 parent aa75292 commit 699fc84
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/desc/imsim/camera_readout.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,12 @@ 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.
wcsaxes = output[0].header['WCSAXES']
del output[0].header['WCSAXES']
output[0].header.insert(5, ('WCSAXES', wcsaxes, ''))
if run_number is None:
run_number = self.visit
output[0].header['RUNNUM'] = str(run_number)
Expand Down

0 comments on commit 699fc84

Please sign in to comment.