Skip to content

Commit

Permalink
Use new wcs metadata stripping code.
Browse files Browse the repository at this point in the history
  • Loading branch information
isullivan committed May 5, 2023
1 parent e2358d3 commit 30b4697
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/lsst/obs/base/_fitsRawFormatterBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ def readMetadata(self):

def stripMetadata(self):
"""Remove metadata entries that are parsed into components."""
self._createSkyWcsFromMetadata()
try:
lsst.afw.geom.stripWcsMetadata(self.metadata)
except TypeError as e:
log.warning("Cannot create a valid WCS from metadata: %s", e.args[0])

def makeVisitInfo(self):
"""Construct a VisitInfo from metadata.
Expand Down Expand Up @@ -234,6 +237,8 @@ def makeWcs(self, visitInfo, detector):
"See warnings in log messages for details."
)
return skyWcs
else:
self.stripMetadata()

return self.makeRawSkyWcsFromBoresight(
visitInfo.getBoresightRaDec(), visitInfo.getBoresightRotAngle(), detector
Expand Down

0 comments on commit 30b4697

Please sign in to comment.