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 holding uvar and vvar as 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 (int or None, optional) – Triangular truncation wavenumber. Default (None) is nlat - 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 a wavenumber dimension with data variables ke_rot, ke_div and ke_total in m2 s-2, and an eddy_scale coordinate in km. l = 0 is 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))