Skip to content

Commit

Permalink
Add matchMeta to data returned by PhotoCalTask.run
Browse files Browse the repository at this point in the history
Also updated the example to use the simplified arguments to makeMatchMetadata
  • Loading branch information
r-owen committed Mar 6, 2016
1 parent 8f66f60 commit 65bd475
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 1 addition & 5 deletions examples/calibrateTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,7 @@ def loadAndMatch(self, exposure, sourceCat):
return pipeBase.Struct(
refCat = refCat,
matches = matches,
matchMeta = createMatchMetadata(
bbox = exposure.getBBox(),
wcs = exposure.getWcs(),
filterName = FilterName,
),
matchMeta = createMatchMetadata(exposure),
)

def run(display=False):
Expand Down
3 changes: 2 additions & 1 deletion python/lsst/pipe/tasks/calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ def calibrate(self, exposure, exposureIdInfo, background=None, icSourceCat=None)
# compute photometric calibration
photoRes = pipeBase.Struct(
matches = None,
matchMeta = None,
)
if self.config.doPhotoCal:
try:
Expand Down Expand Up @@ -434,7 +435,7 @@ def calibrate(self, exposure, exposureIdInfo, background=None, icSourceCat=None)
sourceCat = procRes.sourceCat,
astromMatches = astromRes.matches,
photoMatches = photoRes.matches,
matchMeta = astromRes.matchMeta,
matchMeta = astromRes.matchMeta if astromRes.matchMeta is not None else photoRes.matchMeta,
)

def getSchemaCatalogs(self):
Expand Down
3 changes: 3 additions & 0 deletions python/lsst/pipe/tasks/photoCal.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from lsst.afw.image import abMagFromFlux, abMagErrFromFluxErr, fluxFromABMag, Calib
import lsst.afw.display.ds9 as ds9
from lsst.meas.algorithms import getRefFluxField
from lsst.meas.astrom import createMatchMetadata
from .colorterms import ColortermLibrary

__all__ = ["PhotoCalTask", "PhotoCalConfig"]
Expand Down Expand Up @@ -589,6 +590,7 @@ def run(self, exposure, matches, doSelectUnresolved=True):
- calib ------- \link lsst::afw::image::Calib\endlink object containing the zero point
- arrays ------ Magnitude arrays returned be PhotoCalTask.extractMagArrays
- matches ----- Final ReferenceMatchVector, as returned by PhotoCalTask.selectMatches.
- matchMeta --- Metadata needed to unpersist matches (an lsst.daf.base.PropertyList)
The exposure is only used to provide the name of the filter being calibrated (it may also be
used to generate debugging plots).
Expand Down Expand Up @@ -677,6 +679,7 @@ def run(self, exposure, matches, doSelectUnresolved=True):
calib = calib,
arrays = arrays,
matches = matches,
matchMeta = createMatchMetadata(exposure),
zp = r.zp,
sigma = r.sigma,
ngood = r.ngood,
Expand Down

0 comments on commit 65bd475

Please sign in to comment.