Stationary Wavenumber

Compute the barotropic stationary wavenumber from the zonal wind component.

Example

>>> import xarray as xr
>>> from rwguide.xarray import wavenumber

Loading input data (zonal wind component on pressure levels):

>>> uvt = xr.open_dataset("data/ERA5/ERA5-2018-tuv-1.5.nc", chunks={ "time": 20 })
>>> uvt
<xarray.Dataset>
Dimensions:    (longitude: 240, latitude: 121, level: 18, time: 1460)
Coordinates:
  * longitude  (longitude) float32 -180.0 -178.5 -177.0 ... 175.5 177.0 178.5
  * latitude   (latitude) float32 90.0 88.5 87.0 85.5 ... -87.0 -88.5 -90.0
  * level      (level) int32 50 70 100 150 200 250 ... 600 650 700 750 800 850
  * time       (time) datetime64[ns] 2018-01-01 ... 2018-12-31T18:00:00
Data variables:
    u          (time, level, latitude, longitude) float32 dask.array<...>
    v          (time, level, latitude, longitude) float32 dask.array<...>
    t          (time, level, latitude, longitude) float32 dask.array<...>

Computing stationary wavenumber fields:

>>> wavenumber.stationary_wavenumber(uvt["u"])
<xarray.DataArray 'ks' (time: 1460, level: 18, latitude: 121, longitude: 240)>
dask.array<...>
Coordinates:
  * latitude   (latitude) float32 90.0 88.5 87.0 85.5 ... -87.0 -88.5 -90.0
  * longitude  (longitude) float32 -180.0 -178.5 -177.0 ... 175.5 177.0 178.5
  * level      (level) int32 50 70 100 150 200 250 ... 600 650 700 750 800 850
  * time       (time) datetime64[ns] 2018-01-01 ... 2018-12-31T18:00:00

Xarray Interface

rwguide.xarray.wavenumber.stationary_wavenumber(da_u, *, vectorize=True, names=None)

Barotropic stationary wavenumber.

Computed as Kₛ = Re(sqrt(Kₛ²)) - Im(sqrt(Kₛ²)), i.e. positive values of Kₛ² remain positive after taking the square root and negative values remain negative.

See also: stationary_wavenumber_squared().

Parameters:
  • da_u (xarray.DataArray) – Zonal wind component. Core dimensions: latitude, longitude.

  • vectorize (bool, optional) – Use vectorization of xarray.apply_ufunc().

  • names (dict, optional) – Variable name override.

Returns:

Stationary wavenumber.

Return type:

xarray.DataArray

rwguide.xarray.wavenumber.stationary_wavenumber_squared(da_u, *, vectorize=True, names=None)

Square of the barotropic stationary wavenumber.

Kₛ² = a cos(ϕ)² u⁻¹ ∂ζₐ/∂ϕ, where a = 6371.2 km is the radius of Earth, ϕ is latitude, u is zonal wind and ζₐ is absolute vorticity (computed from the zonal wind only). The implementation is based on a three-point finite difference stencil. Kₛ² is set to 0 at the northern and southern boundaries of the domain.

See, e.g.: Karoly (1983), Hoskins and Ambrizzi (1993).

Parameters:
  • da_u (xarray.DataArray) – Zonal wind component in m/s. Core dimensions: latitude, longitude.

  • vectorize (bool, optional) – Use vectorization of xarray.apply_ufunc().

  • names (dict, optional) – Variable name override.

Returns:

Stationary wavenumber squared.

Return type:

xarray.DataArray

Numpy Interface

rwguide.wavenumber.stationary_wavenumber(lat, u)
rwguide.wavenumber.stationary_wavenumber_squared(lat, u)