Skip to content

Commit

Permalink
Remove unneeded call to private scipy function
Browse files Browse the repository at this point in the history
  • Loading branch information
mraspaud committed Nov 5, 2024
1 parent 837b218 commit a0a7f53
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions satpy/readers/sar_c_safe.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,15 +511,14 @@ def intp(grid_x, grid_y, interpolator):

def interpolate_xarray_linear(xpoints, ypoints, values, shape, chunks=CHUNK_SIZE):
"""Interpolate linearly, generating a dask array."""
from scipy.interpolate.interpnd import LinearNDInterpolator, _ndim_coords_from_arrays
from scipy.interpolate.interpnd import LinearNDInterpolator

if isinstance(chunks, (list, tuple)):
vchunks, hchunks = chunks
else:
vchunks, hchunks = chunks, chunks

points = _ndim_coords_from_arrays(np.vstack((np.asarray(ypoints, dtype=np.uint16),
np.asarray(xpoints, dtype=np.uint16))).T)
points = np.vstack((np.asarray(ypoints, dtype=np.uint16),
np.asarray(xpoints, dtype=np.uint16))).T

interpolator = LinearNDInterpolator(points, values)

Expand Down

0 comments on commit a0a7f53

Please sign in to comment.