roms_tools.ROMSOutput.regrid

roms_tools.ROMSOutput.regrid#

ROMSOutput.regrid(var_names: Sequence[str] | None = None, horizontal_resolution: float | None = None, depth_levels: DataArray | ndarray | Sequence[float] | None = None) Dataset#

Regrid the dataset both horizontally and vertically.

This method selects the specified variables, interpolates them onto a lat-lon-depth grid, and rotates velocity components to east/north directions when required.

Parameters:
  • var_names (sequence of str, optional) – Variables to regrid. If None, all variables in the dataset are used.

  • horizontal_resolution (float, optional) – Target horizontal resolution in degrees. If None, the nominal horizontal resolution is inferred from the grid.

  • depth_levels (xarray.DataArray, numpy.ndarray, sequence, optional) – Target depth levels. If None, depth levels are determined dynamically.

Returns:

xr.Dataset – The regridded dataset.