Skip to content

Commit

Permalink
Replace deprecated readMetadata
Browse files Browse the repository at this point in the history
Move import to top of file: this was originally in daf_butler which did not
have an afw dependency, but obs_base does so we do not need to defer imports.
  • Loading branch information
parejkoj committed Nov 4, 2020
1 parent 7191b3b commit 375c065
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/lsst/obs/base/formatters/fitsExposure.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
from astro_metadata_translator import fix_header
from lsst.daf.base import PropertySet
from lsst.daf.butler import Formatter
# Do not use ExposureFitsReader.readMetadata because that strips
# out lots of headers and there is no way to recover them
from lsst.afw.fits import readMetadata
from lsst.afw.image import ExposureFitsReader, ImageFitsReader, MaskFitsReader, MaskedImageFitsReader
# Needed for ApCorrMap to resolve properly
from lsst.afw.math import BoundedField # noqa: F401
Expand Down Expand Up @@ -105,9 +108,6 @@ def readMetadata(self):
metadata : `~lsst.daf.base.PropertyList`
Header metadata.
"""
# Do not use ExposureFitsReader.readMetadata because that strips
# out lots of headers and there is no way to recover them
from lsst.afw.image import readMetadata
md = readMetadata(self.fileDescriptor.location.path)
fix_header(md)
return md
Expand Down

0 comments on commit 375c065

Please sign in to comment.