pyinterp.trivariate

Contents

pyinterp.trivariate#

pyinterp.trivariate(grid: GridHolder, x: NDArray1DNumeric, y: NDArray1DNumeric, z: NDArray1DNumericWithTime, method: Trivariate | Trivariate) NDArray1DFloat32 | NDArray1DFloat64[source]#
pyinterp.trivariate(grid: GridHolder, x: NDArray1DNumeric, y: NDArray1DNumeric, z: NDArray1DNumericWithTime, method: Literal['bilinear', 'idw', 'nearest'] = 'bilinear', *, bounds_error: bool = False, num_threads: int = 0) NDArray1DFloat32 | NDArray1DFloat64
pyinterp.trivariate(grid: GridHolder, x: NDArray1DNumeric, y: NDArray1DNumeric, z: NDArray1DNumericWithTime, 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) NDArray1DFloat32 | NDArray1DFloat64

Trivariate interpolation.

Parameters:
  • grid (GridHolder) – The 3D 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

  • method (geometric.Trivariate | windowed.Trivariate | 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)

Returns:

Interpolated values

Raises:

TypeError – If windowed options are provided with geometric methods

Return type:

NDArray1DFloat32 | NDArray1DFloat64

Examples

>>> result = trivariate(grid, x, y, z, "bilinear")
>>> result = trivariate(grid, x, y, z, "bicubic", third_axis="linear")