Skip to content

Commit

Permalink
Fix inequality sign and var name in outside bbox test
Browse files Browse the repository at this point in the history
  • Loading branch information
mcara committed Dec 18, 2024
1 parent 333c143 commit 68ebeb4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gwcs/wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 68ebeb4

Please sign in to comment.