Skip to content

Commit

Permalink
Merge pull request #2968 from mraspaud/fix-sar-scipy
Browse files Browse the repository at this point in the history
Remove unneeded call to private scipy function in SAR reader
  • Loading branch information
mraspaud authored Nov 5, 2024
2 parents 837b218 + a0a7f53 commit afb1cc5
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 afb1cc5

Please sign in to comment.