From f09cd779ef4592e30ca11573c216ab0327aa1666 Mon Sep 17 00:00:00 2001 From: John Franklin Crenshaw Date: Mon, 28 Oct 2024 19:37:01 -0700 Subject: [PATCH 1/3] Enable CutOutDonutsScienceSensorTask to operate for a pair with same-sign focusZ. --- doc/versionHistory.rst | 8 ++++++++ .../ts/wep/task/cutOutDonutsScienceSensorTask.py | 12 +----------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/doc/versionHistory.rst b/doc/versionHistory.rst index 836a17ca..6c284dbb 100644 --- a/doc/versionHistory.rst +++ b/doc/versionHistory.rst @@ -6,6 +6,14 @@ Version History ################## +.. _lsst.ts.wep-12.5.0: + +------------- +12.5.0 +------------- + +* Enable CutOutDonutsScienceSensorTask to operate for a pair with same-sign focusZ. + .. _lsst.ts.wep-12.4.2: ------------- diff --git a/python/lsst/ts/wep/task/cutOutDonutsScienceSensorTask.py b/python/lsst/ts/wep/task/cutOutDonutsScienceSensorTask.py index b7d9fbc0..437b4ae5 100644 --- a/python/lsst/ts/wep/task/cutOutDonutsScienceSensorTask.py +++ b/python/lsst/ts/wep/task/cutOutDonutsScienceSensorTask.py @@ -183,22 +183,12 @@ def assignExtraIntraIdx(self, focusZVal0, focusZVal1, cameraName): """ if cameraName in ["LSSTCam", "LSSTComCam", "LSSTComCamSim"]: - errorStr = "Must have one extra-focal and one intra-focal image." if focusZVal0 < 0: - # Check that other image does not have same defocal direction - if focusZVal1 <= 0: - raise ValueError(errorStr) extraExpIdx = 1 intraExpIdx = 0 - elif focusZVal0 > 0: - # Check that other image does not have same defocal direction - if focusZVal1 >= 0: - raise ValueError(errorStr) + else: extraExpIdx = 0 intraExpIdx = 1 - else: - # Need to be defocal images ('FOCUSZ != 0') - raise ValueError(errorStr) elif cameraName == "LATISS": errorStr = "Must have two images with different FOCUSZ parameter." if focusZVal0 != focusZVal1: From ed076e50cfd003ff061afad94f825d241b8dcece Mon Sep 17 00:00:00 2001 From: John Franklin Crenshaw Date: Mon, 28 Oct 2024 19:49:43 -0700 Subject: [PATCH 2/3] Removed associated test. --- .../test_cutOutDonutsScienceSensorTask.py | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/tests/task/test_cutOutDonutsScienceSensorTask.py b/tests/task/test_cutOutDonutsScienceSensorTask.py index b5ffa5eb..f80e278b 100644 --- a/tests/task/test_cutOutDonutsScienceSensorTask.py +++ b/tests/task/test_cutOutDonutsScienceSensorTask.py @@ -193,26 +193,6 @@ def testAssignExtraIntraIdxLsstComCamSim(self): self.assertEqual(extraIdx, 0) self.assertEqual(intraIdx, 1) - def testAssignExtraIntraIdxFocusZValueError(self): - focusZNegative = -1 - focusZPositive = 1 - focusZ0 = 0 - - with self.assertRaises(ValueError): - self.task.assignExtraIntraIdx(focusZPositive, focusZPositive, "LSSTCam") - with self.assertRaises(ValueError): - self.task.assignExtraIntraIdx(focusZPositive, focusZ0, "LSSTCam") - with self.assertRaises(ValueError): - self.task.assignExtraIntraIdx(focusZNegative, focusZNegative, "LSSTCam") - with self.assertRaises(ValueError): - self.task.assignExtraIntraIdx(focusZNegative, focusZ0, "LSSTCam") - with self.assertRaises(ValueError) as context: - self.task.assignExtraIntraIdx(focusZ0, focusZPositive, "LSSTCam") - self.assertEqual( - "Must have one extra-focal and one intra-focal image.", - str(context.exception), - ) - def testAssignExtraIntraIdxInvalidCamera(self): cameraName = "WrongCam" with self.assertRaises(ValueError) as context: From dab8d80f6f2528f254cf3c2225f02fed9b792c0b Mon Sep 17 00:00:00 2001 From: John Franklin Crenshaw <41785729+jfcrenshaw@users.noreply.github.com> Date: Mon, 28 Oct 2024 20:03:18 -0700 Subject: [PATCH 3/3] Fix typo --- python/lsst/ts/wep/task/cutOutDonutsScienceSensorTask.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/lsst/ts/wep/task/cutOutDonutsScienceSensorTask.py b/python/lsst/ts/wep/task/cutOutDonutsScienceSensorTask.py index 437b4ae5..d14cd140 100644 --- a/python/lsst/ts/wep/task/cutOutDonutsScienceSensorTask.py +++ b/python/lsst/ts/wep/task/cutOutDonutsScienceSensorTask.py @@ -183,7 +183,7 @@ def assignExtraIntraIdx(self, focusZVal0, focusZVal1, cameraName): """ if cameraName in ["LSSTCam", "LSSTComCam", "LSSTComCamSim"]: - if focusZVal0 < 0: + if focusZVal0 < focusZVal1: extraExpIdx = 1 intraExpIdx = 0 else: