pyinterp.backends.xarray.RegularGridInterpolator#
- class pyinterp.backends.xarray.RegularGridInterpolator(array: xr.DataArray, increasing_axes: bool = True, geodetic: bool = True)[source]#
Bases:
objectInterpolate on a regular grid in arbitrary dimensions.
Perform interpolation on a regular grid with uneven spacing support. Supports linear, nearest neighbors, inverse distance weighting, and bicubic interpolation methods.
The data must be defined on a regular grid; the grid spacing however may be uneven. Linear, nearest neighbors, inverse distance weighting and bicubic interpolation are supported.
- Parameters:
array – The array defining the regular grid in
ndimensions.increasing_axes – If this is true, check that the grid axes are increasing: the decreasing axes and the supplied grid will be flipped. Default to
False.geodetic –
True, if the axes of the grid represent longitudes and latitudes. In this case, the constructor will try to determine the axes of longitudes and latitudes according to the value of the attribute
unitsusing the following algorithm:if the axis unit is one of the values of the set
degrees_east,degree_east,degree_E,degrees_E,degreeEordegreesEthe axis represents a longitude,if the axis unit is one of the values of the set
degrees_north,degree_north,degree_N,degrees_NordegreesNthe axis represents a latitude.
If this option is false, the axes will be considered Cartesian. Default to
True.
- Raises:
ValueError – if the provided data array doesn’t define a longitude/latitude axis if
geodeticis True.NotImplementedError – if the number of dimensions in the array is less than 2 or more than 4.
Attributes
Get the instance handling the regular grid for interpolations.
Get the number of array dimensions.
Special Methods
__call__(coords[, method, bounds_error, ...])Interpolate at coordinates.
Get the state for pickling.
__setstate__(state)Set the state for unpickling.