get_destag_wspd_wdir(wrfin, timeidx=0, method='cat', squeeze=True, cache=None, meta=True, _key=None, units='m s-1')¶
Return the wind speed and wind direction for the wind in the projected coordinate space.
The wind speed and direction from this function will be relative to the grid. This function should not be used to compare with observations, instead use
wrf.uvmet10_wspd_wdir()to get the earth relative wind speed and direction.
The leftmost dimension of the returned array represents two different quantities:
- return_val[0,…] will contain WSPD
- return_val[1,…] will contain WDIR
This function extracts the necessary variables from the NetCDF file object in order to perform the calculation.
- wrfin (
Nio.NioFile, or an iterable) – WRF-ARW NetCDF data as a
Nio.NioFileor an iterable sequence of the aforementioned types.
- timeidx (
wrf.ALL_TIMES, optional) – The desired time index. This value can be a positive integer, negative integer, or
wrf.ALL_TIMES(an alias for None) to return all times in the file or sequence. The default is 0.
- method (
str, optional) – The aggregation method to use for sequences. Must be either ‘cat’ or ‘join’. ‘cat’ combines the data along the Time dimension. ‘join’ creates a new dimension for the file index. The default is ‘cat’.
- squeeze (
bool, optional) – Set to False to prevent dimensions with a size of 1 from being automatically removed from the shape of the output. Default is True.
- cache (
dict, optional) – A dictionary of (varname, ndarray) that can be used to supply pre-extracted NetCDF variables to the computational routines. It is primarily used for internal purposes, but can also be used to improve performance by eliminating the need to repeatedly extract the same variables used in multiple diagnostics calculations, particularly when using large sequences of files. Default is None.
- meta (
bool, optional) – Set to False to disable metadata and return
xarray.DataArray. Default is True.
- _key (
int, optional) – A caching key. This is used for internal purposes only. Default is None.
- units (
str) – The desired units. Refer to the
getvar()product table for a list of available units for ‘wspd_wdir’. Default is ‘m s-1’.
The wind speed and wind direction for the wind in projected space, whose leftmost dimensions is 2 (0=WSPD, 1=WDIR). If xarray is enabled and the meta parameter is True, then the result will be a
xarray.DataArrayobject. Otherwise, the result will be a
numpy.ndarrayobject with no metadata.