wrf.metadecorators.set_wind_metadata

wrf.metadecorators.set_wind_metadata(copy_varname, name, description, wind_ncvar=False, two_d=False, wspd_wdir=False)

A decorator that sets the metadata for a wrapped wind function’s output.

This is a special metadata decorator for working with wind functions, which include wind extraction routines, uvmet routines, and wind speed / wind direction routines.

If the wrapped function’s meta argument is False, then this decorator returns the wrapped function output without applying the metadata.

Parameters:
  • copy_varname (str, optional) – The NetCDF variable name to copy. Default is None.
  • name (str) – The name to use for the xarray.DataArray.name attribute.
  • description (str) – The description to use for the ‘description’ key in the xarray.DataArray.attrs attribute.
  • wind_ncvar (bool, optional) – Set to True when the wrapped function is simply extracting a wind variable (U, V, W) from the NetCDF file. Set to False for other types of wind algorithms (uvmet, wspd_wdir, etc). Default is False.
  • two_d (bool, optional) – Set to True if the wind field is two-dimensional. Set to False for a three-dimensional wind field. Default is False.
  • wspd_wdir (bool) – Set to True if the wrapped function is a wind speed / wind direction algorithm. Otherwise, set to False. Default is False.
Returns:

The wrapped wind 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