Skip to content

Commit

Permalink
Force variance plane to be unchanged in DcrAssembleCoaddTask
Browse files Browse the repository at this point in the history
  • Loading branch information
isullivan committed Dec 7, 2018
1 parent 5a0743d commit 73c39f7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions python/lsst/pipe/tasks/dcrAssembleCoadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ def run(self, skyInfo, tempExpRefList, imageScalerList, weightList,
"""
templateCoadd = supplementaryData.templateCoadd
baseMask = templateCoadd.mask.clone()
baseVariance = templateCoadd.variance.clone()
spanSetMaskList = self.findArtifacts(templateCoadd, tempExpRefList, imageScalerList)
# Note that the mask gets cleared in ``findArtifacts``, but we want to preserve the mask.
templateCoadd.setMask(baseMask)
Expand Down Expand Up @@ -449,7 +450,8 @@ def run(self, skyInfo, tempExpRefList, imageScalerList, weightList,
dcrCoadds = self.fillCoadd(dcrModels, skyInfo, tempExpRefList, weightList,
calibration=self.scaleZeroPoint.getCalib(),
coaddInputs=templateCoadd.getInfo().getCoaddInputs(),
mask=baseMask)
mask=baseMask,
variance=baseVariance)
coaddExposure = self.stackCoadd(dcrCoadds)
return pipeBase.Struct(coaddExposure=coaddExposure, nImage=nImage,
dcrCoadds=dcrCoadds, dcrNImages=dcrNImages)
Expand Down Expand Up @@ -762,7 +764,7 @@ def stackCoadd(self, dcrCoadds):
return coaddExposure

def fillCoadd(self, dcrModels, skyInfo, tempExpRefList, weightList, calibration=None, coaddInputs=None,
mask=None):
mask=None, variance=None):
"""Create a list of coadd exposures from a list of masked images.
Parameters
Expand All @@ -781,6 +783,8 @@ def fillCoadd(self, dcrModels, skyInfo, tempExpRefList, weightList, calibration=
A record of the observations that are included in the coadd.
mask : `lsst.afw.image.Mask`, optional
Optional mask to override the values in the final coadd.
variance : `lsst.afw.image.Image`, optional
Optional variance plane to override the values in the final coadd.
Returns
-------
Expand All @@ -801,6 +805,8 @@ def fillCoadd(self, dcrModels, skyInfo, tempExpRefList, weightList, calibration=
coaddExposure.setMaskedImage(model[skyInfo.bbox])
if mask is not None:
coaddExposure.setMask(mask)
if variance is not None:
coaddExposure.setVariance(variance)
dcrCoadds.append(coaddExposure)
return dcrCoadds

Expand Down

0 comments on commit 73c39f7

Please sign in to comment.