pyinterp.core.RTree3DFloat64.kriging#
- RTree3DFloat64.kriging(self: pyinterp.core.RTree3DFloat64, coordinates: typing.Annotated[numpy.typing.ArrayLike, numpy.float64], radius: typing.SupportsFloat | None = None, k: typing.SupportsInt = 9, covariance: pyinterp.core.CovarianceFunction = <CovarianceFunction.Matern_32: 1>, drift_function: pyinterp.core.DriftFunction | None = None, sigma: typing.SupportsFloat = 1, alpha: typing.SupportsFloat = 1000000, nugget: typing.SupportsFloat = 0, within: bool = True, num_threads: typing.SupportsInt = 0) tuple#
Interpolate values using kriging.
Performs kriging interpolation at the requested positions using the K nearest neighbors found within the specified search radius. Supports both simple kriging (with zero mean) and universal kriging (with a drift function).
- Parameters:
coordinates – Array of shape
(n, 3)or(n, 2)containing observation coordinates. Herenis the number of observations and each row represents a coordinate in the order x, y, and optionally z. If the matrix shape is(n, 2), the z-coordinate is assumed to be zero. The coordinate system depends on the instance configuration: Ifecef=True, coordinates are in the Cartesian coordinate system (ECEF). Otherwise, coordinates are in the geodetic system (longitude, latitude, altitude) in degrees, degrees, and meters, respectively.radius – Maximum search radius in meters. Defaults to the largest representable value.
k – Number of nearest neighbors to use for interpolation. Defaults to 9.
covariance – Covariance function to use (e.g., Matern, Gaussian). Defaults to Matern_32.
drift_function – Drift function for universal kriging. If not provided, simple kriging is used. Defaults to None.
sigma – Magnitude parameter determining the overall scale of the covariance function. Defaults to 1.
alpha – Decay rate parameter controlling the rate at which covariance decreases. Defaults to 1,000,000.
nugget – Nugget effect term for numerical stability. Defaults to 0.
within – If True, ensures neighbors are located around the point of interest (no extrapolation). Defaults to True.
num_threads – Number of threads to use for computation. If 0, all CPUs are used. If 1, no parallel computing is used (useful for debugging). Defaults to 0.
- Returns:
Tuple containing the interpolated value and the number of neighbors used for the calculation.
Note
Universal kriging is used if a drift function is provided. Otherwise, simple kriging with a known (zero) mean is used.