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 9b3f8c6
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 @@ -380,4 +383,6 @@ def attachComponentsFromMetadata(self, exposure):
info.setWcs(self.makeWcs(info.getVisitInfo(), info.getDetector()))
# We don't need to call stripMetadata() here because it has already
# been stripped during creation of the WCS.

self.stripMetadata()
exposure.setMetadata(self.metadata)

0 comments on commit 9b3f8c6

Please sign in to comment.