Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-41008: Do not include bands with no data in merge measurements #838

Merged
merged 2 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions python/lsst/pipe/tasks/mergeMeasurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,13 @@ def run(self, catalogs):
if hasPseudoFilter:
break

isBad = any(inputRecord.get(flag) for flag in self.badFlags)
if isBad or inputRecord.get(self.fluxFlagKey) or inputRecord.get(self.instFluxErrKey) == 0:
isBad = (
any(inputRecord.get(flag) for flag in self.badFlags)
or inputRecord["deblend_dataCoverage"] == 0
or inputRecord.get(self.fluxFlagKey)
or inputRecord.get(self.instFluxErrKey) == 0
)
if isBad:
sn = 0.
else:
sn = inputRecord.get(self.instFluxKey)/inputRecord.get(self.instFluxErrKey)
Expand Down
6 changes: 3 additions & 3 deletions python/lsst/pipe/tasks/multiBand.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,14 +560,14 @@ def runQuantum(self, butlerQC, inputRefs, outputRefs):
if self.config.doAddFootprints:
modelData = inputs.pop('scarletModels')
if self.config.doConserveFlux:
imageForResdistibution = inputs['exposure']
imageForRedistribution = inputs['exposure']
else:
imageForResdistibution = None
imageForRedistribution = None
updateCatalogFootprints(
modelData=modelData,
catalog=sources,
band=inputRefs.exposure.dataId["band"],
imageForResdistibution=imageForResdistibution,
imageForRedistribution=imageForRedistribution,
removeScarletData=True,
updateFluxColumns=True,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_isPrimaryFlag.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def testIsScarletPrimaryFlag(self):
modelData=modelData,
catalog=catalog,
band="test",
imageForResdistibution=coadds["test"],
imageForRedistribution=coadds["test"],
removeScarletData=True,
updateFluxColumns=True,
)
Expand Down