From e92813c809dfd56d7a261d749dc1133a952365b1 Mon Sep 17 00:00:00 2001 From: Eli Rykoff Date: Wed, 15 Apr 2026 20:11:07 -0700 Subject: [PATCH 1/2] Turn off negative polarity detections when doing background re-estimation. --- python/lsst/meas/algorithms/detection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/lsst/meas/algorithms/detection.py b/python/lsst/meas/algorithms/detection.py index 4dc00ff56..03c2a5f8a 100644 --- a/python/lsst/meas/algorithms/detection.py +++ b/python/lsst/meas/algorithms/detection.py @@ -617,7 +617,7 @@ def applyThreshold(self, middle, bbox, factor=1.0, factorNeg=None): self.config.minPixels ) results.positive.setRegion(bbox) - if self.config.reEstimateBackground or self.config.thresholdPolarity != "positive": + if self.config.thresholdPolarity != "positive": results.negativeThreshold = self.makeThreshold(middle, "negative", factor=factorNeg) results.negative = afwDet.FootprintSet( middle, From c114ea1db3db115b61935a0e99039628fdb97687 Mon Sep 17 00:00:00 2001 From: Eli Rykoff Date: Wed, 15 Apr 2026 20:11:49 -0700 Subject: [PATCH 2/2] Change to positive polarity for adaptive threshold backgrounds. --- python/lsst/meas/algorithms/adaptive_thresholds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/lsst/meas/algorithms/adaptive_thresholds.py b/python/lsst/meas/algorithms/adaptive_thresholds.py index 1d5e3179c..3373164e4 100644 --- a/python/lsst/meas/algorithms/adaptive_thresholds.py +++ b/python/lsst/meas/algorithms/adaptive_thresholds.py @@ -193,7 +193,7 @@ def run(self, table, exposure, initialThreshold=None, initialThresholdMultiplier adaptiveDetectionConfig.reEstimateBackground = False adaptiveDetectionConfig.doTempWideBackground = True adaptiveDetectionConfig.tempWideBackground.binSize = 512 - adaptiveDetectionConfig.thresholdPolarity = "both" + adaptiveDetectionConfig.thresholdPolarity = "positive" self.log.info("Using adaptive detection with thresholdValue = %.2f and multiplier = %.1f", adaptiveDetectionConfig.thresholdValue, adaptiveDetectionConfig.includeThresholdMultiplier)