xoa.regrid.regrid1d¶
-
xoa.regrid.regrid1d(da, coord, method=None, dim=None, coord_in_name=None, conserv=False, extrap=0, bias=0.0, tension=0.0)[source]¶ Regrid along a single dimension
The input and output coordinates may vary along other dimensions, which useful for instance for vertical interpolation in coastal ocean models. Since it uses func:xarray.apply_ufunc, it support dask features. The core computation is performed by the numba-accelerated routines of
xoa.interp.- Parameters
da (xarray.DataArray) – Array to interpolate
coord (xarray.DataArray) – Output coordinate
method (str, int) – Regridding method as one of the following:
1|"linear"|"interp",0|"nearest",2|"cubic",3|"hermit"|"hermitian",-1|"cellave",-2|"cellerr"dim (str, tuple(str), None) – Dimension on which to operate. If a string, it is expected to be the same dimension for both input and output coordinates. Else, provide a two-element tuple:
(dim_in, dim_out). It is inferred by default from output coordinate et input data array.coord_in_name (str, None) – Name of the input coordinate array, which must be known of
da. It is inferred from the input dara array and dimension name by default.conserv (bool) – Use conservative regridding when using
cellavemethod.extrap (str, int) – Extrapolation mode as one of the following:
0|"no"|"none",1|"above",-1|"below",2|"both"|"all"|"yes"
- Returns
xarray.DataArray – Regridded array with
coordas new coordinate array.
See also
xoa.interp.nearest1d,xoa.interp.linear2d,xoa.interp.cubic2d,xoa.interp.hermit1d,xoa.interp.cellave1d