wrf.destagger

wrf.destagger(var, stagger_dim, meta=False)

Return the variable on the unstaggered grid.

This function destaggers the variable by taking the average of the values located on either side of the grid box.

Parameters:
  • var (xarray.DataArray or numpy.ndarray) – A variable on a staggered grid.

  • stagger_dim (int) – The dimension index to destagger. Negative values can be used to choose dimensions referenced from the right hand side (-1 is the rightmost dimension).

  • meta (bool, optional) – Set to False to disable metadata and return numpy.ndarray instead of xarray.DataArray. Default is False.

Returns:

The destaggered variable. If xarray is enabled and the meta parameter is True, then the result will be a xarray.DataArray object. Otherwise, the result will be a numpy.ndarray object with no metadata.

Return type:

xarray.DataArray or numpy.ndarray