From 4e77b7a3679d58fab6271b388bc814e311acabc4 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 cb74ca300e..7103849478 100644 --- a/python/lsst/pipe/tasks/mergeMeasurements.py +++ b/python/lsst/pipe/tasks/mergeMeasurements.py @@ -263,8 +263,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)