diff --git a/python/lsst/ip/diffim/getTemplate.py b/python/lsst/ip/diffim/getTemplate.py index 02ba35d5..1aa3d462 100644 --- a/python/lsst/ip/diffim/getTemplate.py +++ b/python/lsst/ip/diffim/getTemplate.py @@ -19,6 +19,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . import collections +import dataclasses import numpy as np @@ -86,6 +87,13 @@ class GetTemplateConnections( name="{fakesType}{coaddName}Diff_templateExp{warpTypeSuffix}", ) + def __init__(self, *, config=None): + if config.requireCoaddAtGraphBuild: + self.coaddExposures = dataclasses.replace( + self.coaddExposures, + deferGraphConstraint=False, + ) + class GetTemplateConfig( pipeBase.PipelineTaskConfig, pipelineConnections=GetTemplateConnections @@ -120,6 +128,12 @@ class GetTemplateConfig( doc="Minimum fraction of unmasked pixels needed to set the" " HIGH_VARIANCE mask plane.", ) + requireCoaddAtGraphBuild = pexConfig.Field( + dtype=bool, + default=False, + doc="If True, include the coadd dataset existence in the" + "initial butler query during QuantumGraph generation.", + ) def setDefaults(self): # Use a smaller cache: per SeparableKernel.computeCache, this should