Skip to content

Commit

Permalink
Merge branch 'master' into visp_wcs
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamJamieson committed Dec 18, 2024
2 parents 21c4f7a + ca12fbc commit f4a36f7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gwcs/wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,11 +551,16 @@ def _call_backward(self, *args, with_bounding_box=True, fill_value=np.nan, **kwa
return result

def outside_footprint(self, world_arrays):
world_eps = 5.0 * np.finfo(np.float32).eps
eps_p = 1.0 + world_eps
eps_m = 1.0 - world_eps

world_arrays = list(world_arrays)

axes_types = set(self.output_frame.axes_type)
axes_phys_types = self.world_axis_physical_types
footprint = self.footprint()

not_numerical = False
if utils.is_high_level(world_arrays[0], low_level_wcs=self):
not_numerical = True
Expand All @@ -579,9 +584,10 @@ def outside_footprint(self, world_arrays):
axis_range[axis_range < d].max(),
axis_range[axis_range > d].min()
]
outside = (coord >= range[0]) & (coord < range[1])
outside = (coord > range[0] * eps_p) & (coord < range[1] * eps_m)
else:
outside = (coord < range[0]) | (coord > range[1])
outside = (coord < range[0] * eps_m) | (coord > range[1] * eps_p)

if np.any(outside):
if np.isscalar(coord):
coord = np.nan
Expand Down

0 comments on commit f4a36f7

Please sign in to comment.