xarray.Dataset.regridder.vertical#
- Dataset.regridder.vertical(data_var, output_grid, tool='xgcm', **options)#
Apply vertical regridding to
data_var
of the currentxr.Dataset
tooutput_grid
.Supported tools:
- xgcm (https://xgcm.readthedocs.io/en/latest/index.html)
Methods:
Linear
Conservative
Log
Find options at
xcdat.regridder.xgcm.XGCMRegridder()
- Parameters
data_var (
str
) – Name of the variable in thexr.Dataset
to regrid.output_grid (
xr.Dataset
) – Dataset containing output grid.tool (
str
) – Name of the regridding tool.**options (
Dict[str
,Any]
) – These options are passed to the tool being used for regridding. See specific regridder documentation for available options.
- Returns
xr.Dataset
– With thedata_var
variable on the grid defined inoutput_grid
.- Raises
ValueError – If tool is not supported.
Examples
Create destination grid:
>>> output_grid = xcdat.create_grid(lev=np.linspace(1000, 1, 20))
Regrid variable using “xgcm”:
>>> ds.regridder.vertical("so", output_grid, method="linear")