Skip to content

Commit

Permalink
Allow wcslib to "fix" the headers
Browse files Browse the repository at this point in the history
This allows it to compute MJD-OBS from DATE-OBS, which is needed to work
around astropy/astropy#11248. Unfortunately
that also means that FITS files with OBSGEO-X/Y/Z headers will spew out
warnings due to astropy/astropy#10365, but
that's better than crashing.
  • Loading branch information
bmerry committed Jan 13, 2021
1 parent 67aabc8 commit adb6e23
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions katsdpimageutils/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ def write_image(input_file, output_file, width=1024, height=768, dpi=DEFAULT_DPI
"""

with fits.open(input_file) as hdus:
# Fixing disabled due to https://github.com/astropy/astropy/issues/10365
wcs = WCS(hdus[0], fix=False)
wcs = WCS(hdus[0])
if slices is None:
slices = ('x', 'y') + (0,) * (wcs.pixel_n_dim - 2)
ax_select = tuple(slice(None) if s in ('x', 'y') else s for s in slices[::-1])
Expand Down

0 comments on commit adb6e23

Please sign in to comment.