From 41fe47d4575b9aeaf5b0ea763c0b537ee08f301f Mon Sep 17 00:00:00 2001 From: Josh Meyers Date: Mon, 15 Apr 2024 14:35:03 -0700 Subject: [PATCH] Add forceUniquePairs config --- python/lsst/ts/wep/task/pairTask.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/python/lsst/ts/wep/task/pairTask.py b/python/lsst/ts/wep/task/pairTask.py index c2d5eeea2..8bbfc5985 100644 --- a/python/lsst/ts/wep/task/pairTask.py +++ b/python/lsst/ts/wep/task/pairTask.py @@ -74,6 +74,11 @@ class ExposurePairerConfig(pexConfig.Config): default=0.1, ) + forceUniquePairs = pexConfig.Field[bool]( + doc="If True, force each extra exposure to be paired with a unique intra exposure.", + default=True, + ) + class ExposurePairer(pipeBase.Task): ConfigClass = ExposurePairerConfig @@ -168,6 +173,12 @@ def run( out.append( IntraExtraIdxPair(nearbyTable[nearest]["exposure"], row["exposure"]) ) + if self.config.forceUniquePairs: + idx = np.where( + intraTable["exposure"] == nearbyTable[nearest]["exposure"] + )[0] + intraTable.remove_rows(idx) + return out