Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable CutOutDonutsScienceSensorTask to operate for a pair with same-sign focusZ. #281

Merged
merged 3 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions doc/versionHistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

-------------
Expand Down
14 changes: 2 additions & 12 deletions python/lsst/ts/wep/task/cutOutDonutsScienceSensorTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
if focusZVal0 < focusZVal1:
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:
Expand Down
20 changes: 0 additions & 20 deletions tests/task/test_cutOutDonutsScienceSensorTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading