Skip to content

Commit

Permalink
Merge pull request #887 from lsst/tickets/DM-42154
Browse files Browse the repository at this point in the history
DM-42154: Fix multiband task so that turning off matches is protected.
  • Loading branch information
erykoff authored Feb 13, 2024
2 parents 15edbfe + 3d6e9c9 commit dec0668
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions python/lsst/pipe/tasks/multiBand.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,12 @@ def setDefaults(self):
self.measurement.plugins['base_PixelFlags'].masksFpCenter = ['CLIPPED', 'SENSOR_EDGE',
'INEXACT_PSF', 'STREAK']

def validate(self):
super().validate()

if not self.doMatchSources and self.doWriteMatchesDenormalized:
raise ValueError("Cannot set doWriteMatchesDenormalized if doMatchSources is False.")


class MeasureMergedCoaddSourcesTask(PipelineTask):
"""Deblend sources from main catalog in each coadd seperately and measure.
Expand Down Expand Up @@ -528,12 +534,13 @@ def __init__(self, schema=None, peakSchema=None, refObjLoader=None, initInputs=N
def runQuantum(self, butlerQC, inputRefs, outputRefs):
inputs = butlerQC.get(inputRefs)

refObjLoader = ReferenceObjectLoader([ref.datasetRef.dataId for ref in inputRefs.refCat],
inputs.pop('refCat'),
name=self.config.connections.refCat,
config=self.config.refObjLoader,
log=self.log)
self.match.setRefObjLoader(refObjLoader)
if self.config.doMatchSources:
refObjLoader = ReferenceObjectLoader([ref.datasetRef.dataId for ref in inputRefs.refCat],
inputs.pop('refCat'),
name=self.config.connections.refCat,
config=self.config.refObjLoader,
log=self.log)
self.match.setRefObjLoader(refObjLoader)

# Set psfcache
# move this to run after gen2 deprecation
Expand Down

0 comments on commit dec0668

Please sign in to comment.