Skip to content

Wind

Derived wind variables computed from the eastward (u) and northward (v) horizontal wind components.


wspd — Wind speed

Returns wind speed (m/s) as √(u² + v²).

Parameter Default Description
uwnd "uwnd" Eastward wind component variable name
vwnd "vwnd" Northward wind component variable name
derived_vars:
  - name: wspd
    func: wspd
    uwnd: u10   # override if your dataset uses a different name
    vwnd: v10

wdir — Wind direction

Returns wind coming-from direction in degrees (meteorological convention: 0° = northerly, 90° = easterly).

Parameter Default Description
uwnd "uwnd" Eastward wind component variable name
vwnd "vwnd" Northward wind component variable name
derived_vars:
  - name: wdir
    func: wdir
    uwnd: u10
    vwnd: v10

API reference

gridstats.derived.wind.wspd(ds: xr.Dataset, *, uwnd: str = 'uwnd', vwnd: str = 'vwnd') -> xr.DataArray

Wind speed from eastward/northward components.

Parameters:

Name Type Description Default
ds Dataset

Input dataset.

required
uwnd str

Name of the eastward wind component variable.

'uwnd'
vwnd str

Name of the northward wind component variable.

'vwnd'

Returns:

Type Description
DataArray

Wind speed DataArray (m/s).

gridstats.derived.wind.wdir(ds: xr.Dataset, *, uwnd: str = 'uwnd', vwnd: str = 'vwnd') -> xr.DataArray

Wind coming-from direction from eastward/northward components.

Parameters:

Name Type Description Default
ds Dataset

Input dataset.

required
uwnd str

Name of the eastward wind component variable.

'uwnd'
vwnd str

Name of the northward wind component variable.

'vwnd'

Returns:

Type Description
DataArray

Wind direction DataArray (degrees, coming-from meteorological convention).