pyinterp.quadrivariate

Contents

pyinterp.quadrivariate#

pyinterp.quadrivariate(grid: GridHolder, x: NDArray1DNumeric, y: NDArray1DNumeric, z: NDArray1DNumericWithTime, u: NDArray1DNumeric, method: Quadrivariate | Quadrivariate) NDArray1DFloat32 | NDArray1DFloat64[source]#
pyinterp.quadrivariate(grid: GridHolder, x: NDArray1DNumeric, y: NDArray1DNumeric, z: NDArray1DNumericWithTime, u: NDArray1DNumeric, method: Literal['bilinear', 'idw', 'nearest'] = 'bilinear', *, bounds_error: bool = False, num_threads: int = 0) NDArray1DFloat32 | NDArray1DFloat64
pyinterp.quadrivariate(grid: GridHolder, x: NDArray1DNumeric, y: NDArray1DNumeric, z: NDArray1DNumericWithTime, u: NDArray1DNumeric, method: Literal['akima', 'akima_periodic', 'bicubic', 'bilinear', 'c_spline', 'c_spline_not_a_knot', 'c_spline_periodic', 'linear', 'polynomial', 'steffen'], *, bounds_error: bool = False, num_threads: int = 0, half_window_size_x: int | None = None, half_window_size_y: int | None = None, boundary_mode: Literal['shrink', 'undef'] | None = None, third_axis: Literal['linear', 'nearest'] | None = None, fourth_axis: Literal['linear', 'nearest'] | None = None) NDArray1DFloat32 | NDArray1DFloat64

Quadrivariate interpolation.

Parameters:
  • grid (GridHolder) – The 4D grid to interpolate from

  • x (NDArray1DNumeric) – X coordinates at which to interpolate

  • y (NDArray1DNumeric) – Y coordinates at which to interpolate

  • z (NDArray1DNumericWithTime) – Z coordinates at which to interpolate

  • u (NDArray1DNumeric) – U coordinates at which to interpolate

  • method (geometric.Quadrivariate | windowed.Quadrivariate | InterpolationMethods) – Interpolation method (config object or string)

  • bounds_error (bool) – If True, raise error for out-of-bounds coordinates

  • num_threads (int) – Number of threads to use (0 = auto)

  • half_window_size_x (int | None) – Half window size for X axis (windowed methods only)

  • half_window_size_y (int | None) – Half window size for Y axis (windowed methods only)

  • boundary_mode (BoundaryMode | None) – Boundary handling mode (windowed methods only)

  • third_axis (AxisConfigStr | None) – Interpolation method for Z axis (windowed methods only)

  • fourth_axis (AxisConfigStr | None) – Interpolation method for U axis (windowed methods only)

Returns:

Interpolated values

Raises:

TypeError – If windowed options are provided with geometric methods

Return type:

NDArray1DFloat32 | NDArray1DFloat64

Examples

>>> result = quadrivariate(grid, x, y, z, u, "bilinear")
>>> result = quadrivariate(
...     grid,
...     x,
...     y,
...     z,
...     u,
...     "bicubic",
...     third_axis="linear",
...     fourth_axis="linear",
... )