diff --git a/python/lsst/eotest/image_utils.py b/python/lsst/eotest/image_utils.py index cf386e3..ff7c402 100644 --- a/python/lsst/eotest/image_utils.py +++ b/python/lsst/eotest/image_utils.py @@ -26,7 +26,9 @@ def __init__(self, infile, hdu=0): except: # This exception occurs when DM stack encounters a "." in # a FITS header keyword. - self.header = fits.open(infile)[hdu].header + with fits.open(infile) as hdulist: + self.header = dict() + self.header.update(hdulist[hdu].header) def get(self, key): return self(key)