Transformed Eulerian Mean diagnostics (pyzome.tem)

Functions for computing Transformed Eulerian Mean (TEM) diagnostics.

Functions

pyzome.tem.resid_vel(v: DataArray, w: DataArray, T: DataArray, vT: DataArray, p0: float = 100000.0, Rs: float = 287.058, Cp: float = 1004.64, a: float = 6371230.0) tuple[DataArray, DataArray]

Calculate the residual mean velocity components using zonal mean fields.

Parameters:
  • v (xarray.DataArray) – data containing the zonal mean of the meridional wind

  • w (xarray.DataArray) – data containing the zonal mean of the vertical pressure velocity

  • T (xarray.DataArray) – data containing the zonal mean of the air temperature

  • vT (xarray.DataArray) – data containing the zonal mean meridional eddy heat flux, nominally defined as zonal_mean((v - zonal_mean(v))*(T - zonal_mean(T)))

  • lat_coord (str, optional) – The coordinate name of the latitude dimension. If given an empty string (the default), the function tries to infer which coordinate corresponds to the latitude

  • lev_coord (str, optional) – The coordinate of the pressure-level dimension. If given an empty string (the default), the function tries to infer which coordinate corresponds to the pressure-levels

  • p0 (float, optional) – Reference pressure for computation of potential temperature. Defaults to 100000 Pa for Earth.

  • Rs (float, optional) – Specific gas constant for computation of potential temperature. Defaults to 287.058 J/kg/K for dry air of the Earth.

  • Cp (float, optional) – Specific heat capacity at constant pressure for computation of potential temperature. Defaults to 1004.64 J/kg/K for dry air of the Earth.

  • a (float, optional) – Planetary radius. Defaults to 6.37123e6 m for the Earth.

Returns:

residual velocities – The meridional and vertical residual velocity components.

Return type:

tuple of two xarray.DataArray

Notes

v, w, T, and vT should generally have the same dimensions. However, as a consequence of the way xarray performs broadcasting of arrays, this function will still work as long as all the arrays have at least latitude and level dimensions. This has an added benefit that if you desire to compute the contribution of different zonal wavenumbers to the residual circulation, then you can provide the zonal covariances (vT) with an added dimension such as “lon_wavenum” (as is returned by the zonal_wave_covariance function) to get the correct result.

pyzome.tem.epflux_vector(u: DataArray, T: DataArray, uv: DataArray, vT: DataArray, uw: DataArray, p0: float = 100000.0, Rs: float = 287.058, Cp: float = 1004.64, a: float = 6371230.0, Omega: float = 7.29211e-05) tuple[DataArray, DataArray]

Calculate the Eliassen-Palm Flux Vector components using zonal mean fields.

Parameters:
  • u (xarray.DataArray) – data containing the zonal mean of the zonal wind

  • T (xarray.DataArray) – data containing the zonal mean of the air temperature

  • uv (xarray.DataArray) – data containing the zonal mean meridional momentum flux

  • vT (xarray.DataArray) – data containing the zonal mean meridional heat flux

  • uw (xarray.DataArray) – data containing the zonal mean vertical momentum flux (consistent with w, the vertical pressure velocity field)

  • p0 (float, optional) – Reference pressure for computation of potential temperature. Defaults to 100000 Pa for Earth.

  • Rs (float, optional) – Specific gas constant for computation of potential temperature. Defaults to 287.058 J/kg/K for dry air of the Earth.

  • Cp (float, optional) – Specific heat capacity at constant pressure for computation of potential temperature. Defaults to 1004.64 J/kg/K for dry air of the Earth.

  • a (float, optional) – Planetary radius. Defaults to 6.37123e6 m for the Earth.

  • Omega (float, optional) – Planetary rotation rate. Defaults to 7.29211e-5 s-1 for the Earth.

Returns:

ep_flux – The meridional and vertical components of the EP-Flux (F_lat, F_prs)

Return type:

tuple of two xarray.DataArray

Notes

u, T, uv, vT, and uw should generally have the same dimensions. However, as a consequence of the way xarray performs broadcasting of arrays, this function will still work as long as all the arrays have at least latitude and level dimensions. This has an added benefit that if you desire to compute EP Fluxes partitioned into contributions from different zonal wavenumbers, then you can provide the zonal covariances (uv, vT, and uw) with an added dimension such as “zonal_wavenum” (as is returned by the zonal_wave_covariance function) to get the correct result.

pyzome.tem.qg_epflux_vector(T: DataArray, uv: DataArray, vT: DataArray, p0: float = 100000.0, Rs: float = 287.058, Cp: float = 1004.64, a: float = 6371230.0, Omega: float = 7.29211e-05) tuple[DataArray, DataArray]

Calculate the quasi-geostrophic Eliassen-Palm Flux Vector components using zonal mean fields.

Parameters:
  • T (xarray.DataArray) – data containing the full field air temperature

  • uv (xarray.DataArray) – data containing the zonal mean meridional momentum flux

  • vT (xarray.DataArray) – data containing the zonal mean meridional heat flux

  • p0 (float, optional) – Reference pressure for computation of potential temperature. Defaults to 100000 Pa for Earth.

  • Rs (float, optional) – Specific gas constant for computation of potential temperature. Defaults to 287.058 J/kg/K for dry air of the Earth.

  • Cp (float, optional) – Specific heat capacity at constant pressure for computation of potential temperature. Defaults to 1004.64 J/kg/K for dry air of the Earth.

  • a (float, optional) – Planetary radius. Defaults to 6.37123e6 m for the Earth.

  • Omega (float, optional) – Planetary rotation rate. Defaults to 7.29211e-5 s-1 for the Earth.

Returns:

qg_ep_flux – The meridional and vertical components of the quasi-geostrophic EP-Flux (F_lat, F_prs).

Return type:

tuple of two xarray.DataArray

Notes

T, uv, and vT should generally have the same dimensions. However, as a consequence of the way xarray performs broadcasting of arrays, this function will still work as long as all the arrays have at least latitude and level dimensions. This has an added benefit that if you desire to compute QG-EP Fluxes partitioned into contributions from different zonal wavenumbers, then you can provide the zonal covariances (uv and vT) with an added dimension such as “zonal_wavenum” (as is returned by the zonal_wave_covariance function) to get the correct result.

pyzome.tem.epflux_div(F_lat: DataArray, F_prs: DataArray, accel: bool = False, terms: bool = False, a: float = 6371230.0) DataArray | tuple[DataArray, DataArray]

Calculate the Eliassen-Palm Flux divergence assuming spherical coordinates.

Parameters:
  • F_lat (xarray.DataArray) – data containing the meridional EP-Flux component

  • F_prs (xarray.DataArray) – data containing the vertical EP-Flux component

  • accel (bool, optional) – If True, will scale the output by 1 / (a*cos(lat)) so that the divergence is in units of m s-2

  • terms (bool, optional) – If True, the function returns the individual contributions to the divergence from the meridional and vertical components of the EP-Flux. Defaults to False - the function returns the sum of these terms.

  • a (float, optional) – Planetary radius. Defaults to 6.37123e6 m for the Earth.

Returns:

epflux_divergence – The total EP-Flux divergence or a tuple containing the the individual terms from the meridional and vertical divergence (if terms=True)

Return type:

xarray.DataArray or tuple of two xr.DataArray