Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-42981: Maintain previous behavior for astrometry errors #919

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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