xrspatial.interpolate.kriging#
- xrspatial.interpolate.kriging(x, y=None, z=None, template=None, variogram_model='spherical', nlags=15, return_variance=False, name='kriging', *, column=None)[source]#
Ordinary Kriging interpolation.
- Parameters:
x (array-like) – Coordinates and values of scattered input points. Alternatively, pass a GeoDataFrame of Point geometries as the first argument and leave y/z unset; template and column must then be keywords.
y (array-like) – Coordinates and values of scattered input points. Alternatively, pass a GeoDataFrame of Point geometries as the first argument and leave y/z unset; template and column must then be keywords.
z (array-like) – Coordinates and values of scattered input points. Alternatively, pass a GeoDataFrame of Point geometries as the first argument and leave y/z unset; template and column must then be keywords.
template (xr.DataArray) – 2-D DataArray whose grid defines the output raster.
variogram_model (str, default 'spherical') – Variogram model:
'spherical','exponential', or'gaussian'.nlags (int, default 15) – Number of lag bins for the experimental variogram.
return_variance (bool, default False) – If True, return
(prediction, variance)tuple.name (str, default 'kriging') – Name of the output DataArray.
column (str, optional) – When the first argument is a GeoDataFrame, the column whose values are interpolated. Defaults to the first numeric column.
- Returns:
Prediction raster, or
(prediction, variance)if return_variance is True.- Return type:
xr.DataArray or tuple of xr.DataArray
- Raises:
MemoryError – If the worst-case allocation (variogram pair arrays, kriging matrix, or prediction matrix) would exceed 80% of available memory.