Recipes (pyzome.recipes)
Functions that combine pyzome operations and diagnostics to perform more complex tasks or analyses.
Functions
- pyzome.recipes.create_zonal_mean_dataset(ds: Dataset, include_waves: bool = False, waves: Sequence[int] | None = None, fftpkg: str = 'scipy', lon_coord: str = '')
Compiles a “zonal mean dataset”.
Given an xarray dataset containing full fields of basic state variables such as velocity components and temperatures, this function will compute as many zonal mean diagnostics as possible.
- Parameters:
ds (
xarray.Dataset) –Dataset containing full fields (i.e., containing latitude & longitude dimensions) of basic state variables. This function currently assumes specific names and units:
’u’ = zonal wind component in m/s
’v’ = meridional wind component in m/s
’w’ = vertical pressure velocity in Pa/s
’T’ = temperature in K
’Z’ = geopotential height in m
If your data names, dimensions, and/or units do not conform to these restrictions, please change beforehand. Dimensions and names can easily be changed with the rename method of xarray Datasets/DataArrays.
Note that ds need not contain all of these variables, and this function will still provide as many diagnostics as possible.
include_waves (bool, optional) – Whether to include diagnostics as a function of zonal wavenumber such as eddy covariances and fourier coefficients. Defaults to False.
waves (array-like, optional) – The specific zonal wavenumbers to maintain in the output. This kwarg is only considered if include_waves is True.
fftpkg (string, optional) – String that specifies how to perform the FFT on the data. Options are ‘scipy’ or ‘xrft’. Defaults to scipy. This kwarg is only considered if include_waves is True.
- Returns:
An xarray Dataset containing the possible zonal mean diagnostics.
- Return type:
xarray.Dataset
Notes
This function writes progress messages to a module level logger
Please see https://essd.copernicus.org/articles/10/1925/2018/ for a description of a different zonal mean dataset compiled for the SPARC Reanalysis Intercomparison Project. This function does not provide all the same diagnostics as listed in that publication. However, if this function is provided with all of u, v, w, and T, it will return all the terms necessary to compute further diagnostics for, e.g., zonal Eulerian and Transformed Eulerian Mean momentum budgets.