xarray.Dataset.bounds.get_bounds

xarray.Dataset.bounds.get_bounds#

Dataset.bounds.get_bounds(axis, var_key=None)#

Gets coordinate bounds.

Parameters:
  • axis (CFAxisKey) – The CF axis key (“X”, “Y”, “T”, “Z”).

  • var_key (Optional[str]) – The key of the coordinate or data variable to get axis bounds for. This parameter is useful if you only want the single bounds DataArray related to the axis on the variable (e.g., “tas” has a “lat” dimension and you want “lat_bnds”).

Returns:

Union[xr.Dataset, xr.DataArray] – A Dataset of N bounds variables, or a single bounds variable DataArray.

Raises:
  • ValueError – If an incorrect axis argument is passed.

  • KeyError: – If bounds were not found for the specific axis.