From 27c659f2784f41de7bd0a863e040b5575d8894cb Mon Sep 17 00:00:00 2001 From: Gabriel Emery Date: Fri, 18 Oct 2024 11:38:16 +0200 Subject: [PATCH] Improve handling of null FoV rotation speed. Signed-off-by: Gabriel Emery --- gammapy/makers/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gammapy/makers/utils.py b/gammapy/makers/utils.py index 5f499e9799..3126ba9c22 100644 --- a/gammapy/makers/utils.py +++ b/gammapy/makers/utils.py @@ -126,7 +126,12 @@ def compute_rotation_time_step(rotation, pointing_altaz): * np.abs(np.cos(pointing_altaz.az.rad)) ) if denom.value == 0: - return 3600 * u.s + if np.cos(pointing_altaz.location.lat.rad) == 0: + # Assuming that the observatory location is fixed during one observation, the time step can be infinite + return np.inf * u.s + if np.cos(pointing_altaz.az.rad) == 0: + # For fixed RaDec pointing, this is temporary. A short interval is thus provided + return 60 * u.s return rotation * np.cos(pointing_altaz.alt.rad) / denom