Skip to content

Commit

Permalink
Make sure the ignore_missing_end option gets added to fits.open kwarg…
Browse files Browse the repository at this point in the history
…s only if it’s not already present.
  • Loading branch information
astrofrog committed Apr 4, 2016
1 parent 068a276 commit 8a5e96b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion glue/core/data_factories/fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,11 @@ def casalike_cube(filename, **kwargs):
from astropy.io import fits

result = Data()
with fits.open(filename, ignore_missing_end=True, **kwargs) as hdulist:

if 'ignore_missing_end' not in kwargs:
kwargs['ignore_missing_end'] = True

with fits.open(filename, **kwargs) as hdulist:
array = hdulist[0].data
header = hdulist[0].header
result.coords = coordinates_from_header(header)
Expand Down

0 comments on commit 8a5e96b

Please sign in to comment.