Skip to content

Commit

Permalink
Add forceUniquePairs config
Browse files Browse the repository at this point in the history
  • Loading branch information
jmeyers314 committed Apr 15, 2024
1 parent 159ba1b commit 41fe47d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions python/lsst/ts/wep/task/pairTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 41fe47d

Please sign in to comment.