Skip to content

Commit

Permalink
CalibrateTask: remove createMatchMeta
Browse files Browse the repository at this point in the history
The task of creating the match metadata has been moved to its principal
consumer: LoadReferenceObjectsTask. Some slight restructuring was required
to adjust here.
  • Loading branch information
PaulPrice committed Sep 5, 2017
1 parent eba51f8 commit ada503d
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions python/lsst/pipe/tasks/calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
import lsst.pex.config as pexConfig
import lsst.pipe.base as pipeBase
import lsst.afw.table as afwTable
from lsst.meas.astrom import (AstrometryTask, displayAstrometry,
createMatchMetadata, denormalizeMatches)
from lsst.meas.astrom import AstrometryTask, displayAstrometry, denormalizeMatches
from lsst.meas.extensions.astrometryNet import LoadAstrometryNetObjectsTask
from lsst.obs.base import ExposureIdInfo
import lsst.daf.base as dafBase
Expand Down Expand Up @@ -425,11 +424,6 @@ def run(self, dataRef, exposure=None, background=None, icSourceCat=None,
elif exposure is None:
raise RuntimeError("doUnpersist false; exposure must be provided")

if self.config.doWrite and self.config.doAstrometry:
matchMeta = createMatchMetadata(exposure, border=self.pixelMargin)
else:
matchMeta = None

exposureIdInfo = dataRef.get("expIdInfo")

calRes = self.calibrate(
Expand All @@ -446,7 +440,7 @@ def run(self, dataRef, exposure=None, background=None, icSourceCat=None,
background=calRes.background,
sourceCat=calRes.sourceCat,
astromMatches=calRes.astromMatches,
matchMeta=matchMeta,
matchMeta=calRes.matchMeta,
)

return calRes
Expand Down Expand Up @@ -523,13 +517,15 @@ def calibrate(self, exposure, exposureIdInfo=None, background=None,
# perform astrometry calibration:
# fit an improved WCS and update the exposure's WCS in place
astromMatches = None
matchMeta = None
if self.config.doAstrometry:
try:
astromRes = self.astrometry.run(
exposure=exposure,
sourceCat=sourceCat,
)
astromMatches = astromRes.matches
matchMeta = astromRes.matchMeta
except Exception as e:
if self.config.requireAstrometry:
raise
Expand Down Expand Up @@ -566,6 +562,7 @@ def calibrate(self, exposure, exposureIdInfo=None, background=None,
background=background,
sourceCat=sourceCat,
astromMatches=astromMatches,
matchMeta=matchMeta,
)

def writeOutputs(self, dataRef, exposure, background, sourceCat,
Expand Down

0 comments on commit ada503d

Please sign in to comment.