Skip to content

Commit

Permalink
Merge pull request #919 from lsst/tickets/DM-42981
Browse files Browse the repository at this point in the history
DM-42981: Maintain previous behavior for astrometry errors
  • Loading branch information
parejkoj committed Apr 23, 2024
2 parents 14a832a + 4451e3c commit b195f7a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions python/lsst/pipe/tasks/calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import lsst.pipe.base as pipeBase
import lsst.pipe.base.connectionTypes as cT
import lsst.afw.table as afwTable
from lsst.meas.astrom import AstrometryTask, displayAstrometry, denormalizeMatches
from lsst.meas.astrom import AstrometryTask, displayAstrometry, denormalizeMatches, AstrometryError
from lsst.meas.algorithms import LoadReferenceObjectsConfig, SkyObjectsTask
import lsst.daf.base as dafBase
from lsst.afw.math import BackgroundList
Expand Down Expand Up @@ -634,12 +634,13 @@ def run(self, exposure, background=None,
astromMatches = None
matchMeta = None
if self.config.doAstrometry:
astromRes = self.astrometry.run(
exposure=exposure,
sourceCat=sourceCat,
)
astromMatches = astromRes.matches
matchMeta = astromRes.matchMeta
try:
astromRes = self.astrometry.run(exposure=exposure, sourceCat=sourceCat)
astromMatches = astromRes.matches
matchMeta = astromRes.matchMeta
except AstrometryError as e:
# Maintain old behavior of not stopping for astrometry errors.
self.log.warning(e)
if exposure.getWcs() is None:
if self.config.requireAstrometry:
raise RuntimeError(f"WCS fit failed for {idGenerator} and requireAstrometry "
Expand Down

0 comments on commit b195f7a

Please sign in to comment.