pcmdi_metrics.effective_resolution.compute_ke_spectra
- pcmdi_metrics.effective_resolution.compute_ke_spectra(ds, uvar='ua', vvar='va', ntrunc=None, gridtype='auto', rsphere=6371000.0)[source]
Rotational and divergent KE spectra for a single 2-D wind field.
Pure computation: no file I/O, no plotting.
- Parameters:
ds (
xarray.Dataset) – Dataset holdinguvarandvvaras 2-D fields on a global latitude-longitude grid. Any time or vertical dimension must already be selected out; see compute_ke_spectra_timeseries for the wrapper that loops over time. Latitude and longitude are found from the dataset’s own axis metadata, so non-standard coordinate names work.uvar, vvar (
str, optional) – Names of the zonal and meridional wind variables. Defaults"ua"and"va"(CMIP conventions).ntrunc (
intorNone, optional) – Triangular truncation wavenumber. Default (None) isnlat - 1. Pass a smaller value to reproduce analyses that deliberately truncate below the grid-implied limit.gridtype (
{"auto", "regular", "gaussian"}, optional) – Latitude grid type. Default"auto".rsphere (
float, optional) – Sphere radius in metres. Default is EARTH_RADIUS.
- Returns:
xarray.Dataset– Dataset on awavenumberdimension with data variableske_rot,ke_divandke_totalin m2 s-2, and aneddy_scalecoordinate in km.l = 0is dropped, Equation (1) being singular there.
Notes
The spectrum is global, deliberately: the latitudinal dependence of grid spacing differs between models, so a limited-area spectrum would not be comparable across an ensemble. Klaver et al. also caution that a globally integrated quantity may obscure a phenomenon-dependent effective resolution, e.g. midlatitude storms versus equatorial updraughts.
Examples
>>> spec = compute_ke_spectra(ds.isel(time=0))