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 d546943
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions python/lsst/pipe/tasks/dcrAssembleCoadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,9 @@ def run(self, skyInfo, tempExpRefList, imageScalerList, weightList,
"""
templateCoadd = supplementaryData.templateCoadd
baseMask = templateCoadd.mask.clone()
# The variance plane is for each subfilter
# and should be proportionately lower than the full-band image
baseVariance = templateCoadd.variance.clone()/self.config.dcrNumSubfilters
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 +452,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 +766,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 +785,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 +807,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 d546943

Please sign in to comment.