wrf.metadecorators.set_cape_alg_metadata

wrf.metadecorators.set_cape_alg_metadata(is2d, copyarg='pres_hpa')

A decorator that sets the metadata for the wrapped raw CAPE diagnostic function.

Parameters:
  • is2d (bool) – Set to True for the two-dimensional CAPE calculation, False for three-dimensional CAPE.

  • copyarg (str) – The wrapped function argument to use for copying dimension names. Default is ‘pres_hpa’.

Returns:

The wrapped CAPE function output with or without metadata. 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