pyinterp.backends.xarray.DatasetAccessor.interp#
- DatasetAccessor.interp(coords=None, method='bilinear', **coords_kwargs)[source]#
Interpolate the variables of the dataset at new coordinates.
The variables defined on exactly the interpolated dimensions are interpolated as with
DataArrayAccessor.interp(). The variables that depend on none of them are kept as they are. The others, such as the bounds of a longitude axis, are dropped.- Parameters:
coords (Mapping[Hashable, Any] | None) – Mapping from dimension names to the coordinates to interpolate at.
method (InterpolationMethods) – Interpolation method. See
RegularGridInterpolator.__call__()for the supported methods.**coords_kwargs (Any) – The coordinates to interpolate at, for keyword arguments named after a dimension of the dataset, or options of the interpolation method.
- Returns:
A dataset holding the interpolated variables and the variables kept, with the attributes of the dataset.
- Raises:
ValueError – If no variable is defined on exactly the interpolated dimensions.
- Return type:
xr.Dataset