From 851151c0703b5164c3d3765c14c3ca7145a9d159 Mon Sep 17 00:00:00 2001 From: Gabriel Emery Date: Mon, 7 Oct 2024 10:44:20 +0200 Subject: [PATCH] Move in-function definition of the Earth rotation velocity to a constant and rename it. Signed-off-by: Gabriel Emery --- gammapy/makers/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gammapy/makers/utils.py b/gammapy/makers/utils.py index b9241aee9c..8279d3273e 100644 --- a/gammapy/makers/utils.py +++ b/gammapy/makers/utils.py @@ -29,6 +29,7 @@ log = logging.getLogger(__name__) MINIMUM_TIME_STEP = 1 * u.s # Minimum time step used to handle FoV rotations +EARTH_ANGULAR_VELOCITY = 360 * u.deg / u.day def _get_fov_coords(pointing, irf, geom, use_region_center=True, obstime=None): @@ -119,9 +120,8 @@ def compute_rotation_time_step(rotation, pointing_altaz): duration : `~astropy.units.Quantity` Time associated with the requested rotation. """ - earth_rotation = 360 * u.deg / u.day denom = ( - earth_rotation + EARTH_ANGULAR_VELOCITY * np.cos(pointing_altaz.location.lat.rad) * np.abs(np.cos(pointing_altaz.az.rad)) )