From 68ebeb4bcca0f946df25a44fb3f823d228043e65 Mon Sep 17 00:00:00 2001 From: Mihai Cara Date: Wed, 18 Dec 2024 18:56:38 -0500 Subject: [PATCH] Fix inequality sign and var name in outside bbox test --- gwcs/wcs.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gwcs/wcs.py b/gwcs/wcs.py index e0cbf191..4c652c97 100644 --- a/gwcs/wcs.py +++ b/gwcs/wcs.py @@ -508,19 +508,19 @@ def outside_footprint(self, world_arrays): axis_range = footprint[:, idim] else: axis_range = footprint - range = [axis_range.min(), axis_range.max()] + minmax_range = [axis_range.min(), axis_range.max()] if (axtyp == 'SPATIAL' and str(phys).endswith((".ra", ".lon")) - and range[1] - range[0] > 180): + and minmax_range[1] - minmax_range[0] > 180): # most likely this coordinate is wrapped at 360 - d = np.mean(range) - range = [ + d = np.mean(minmax_range) + minmax_range = [ axis_range[axis_range < d].max(), axis_range[axis_range > d].min() ] - outside = (coord >= range[0]) & (coord < range[1]) + outside = (coord > minmax_range[0]) & (coord < minmax_range[1]) else: - outside = (coord < range[0]) | (coord > range[1]) + outside = (coord < minmax_range[0]) | (coord > minmax_range[1]) if np.any(outside): if np.isscalar(coord): coord = np.nan