From 7e890ef04d6fc62804b64290d6fb33528161d931 Mon Sep 17 00:00:00 2001 From: John Franklin Crenshaw Date: Fri, 19 Apr 2024 14:27:12 -0700 Subject: [PATCH] Bounds on Instrument.calcEffDefocalOffset() to avoid bugs. --- python/lsst/ts/wep/instrument.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/lsst/ts/wep/instrument.py b/python/lsst/ts/wep/instrument.py index 55f20f2fb..67de3b4eb 100644 --- a/python/lsst/ts/wep/instrument.py +++ b/python/lsst/ts/wep/instrument.py @@ -670,7 +670,10 @@ def dZ4det(offset): )[4] # Calculate the equivalent detector offset - result = minimize_scalar(lambda offset: np.abs(dZ4det(offset) - dZ4optic)) + result = minimize_scalar( + lambda offset: np.abs(dZ4det(offset) - dZ4optic), + bounds=[-0.1, 0.1], + ) return np.abs(result.x)