From b5bc03e858fe04bd1aa0dcf2918e97a9d0fa03e4 Mon Sep 17 00:00:00 2001 From: fred3m Date: Mon, 2 Oct 2023 16:27:58 -0700 Subject: [PATCH] Do not include bands with no data in merge measurements --- python/lsst/pipe/tasks/mergeMeasurements.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python/lsst/pipe/tasks/mergeMeasurements.py b/python/lsst/pipe/tasks/mergeMeasurements.py index 1a6beefffd..856ebe0d31 100644 --- a/python/lsst/pipe/tasks/mergeMeasurements.py +++ b/python/lsst/pipe/tasks/mergeMeasurements.py @@ -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)