API Reference¶
Xarray accessor¶
A pair of xarray accessors for working with pint units and CF variables, calculating transformed and derived quantities, and reducing dimensions in myrid ways.
|
Accessor with properties and methods shared by |
|
Accessor for |
|
Accessor for |
|
Register a function that derives one variable from one or more others, for use with |
|
Register a function that transforms one variable to another, for use with |
Unit registry¶
A pint
unit registry for climate scientists and tools for parsing and
formatting CF-compliant unit strings.
The default |
|
Alias for the default |
|
|
Translate unit string into |
|
Convert |
|
Fussily the format unit string or |
Variable registry¶
Tools for managing CF-style variable metadata. Includes a class for holding variable metadata and grouping variables into related hierarchies, and a registry for storing variables.
The default |
|
Alias for the default |
|
|
Lightweight CF-style representation of physical variables. |
Container of |
Finite differences¶
Various finite difference schemes.
|
Return the integral approximation along an arbitrary axis. |
|
Return an estimate of the first, second, or third order derivative along an arbitrary axis using centered finite differencing. |
|
Return an arbitrary order finite difference approximation by taking successive half-level differences. |
|
Return an arbitrary order centered finite difference approximation for arbitrarily spaced coordinates using the [For88] method. |
Variability analysis¶
Analyses of variance and trends. Many of these are adapted from examples and course notes provided by Professors Elizabeth Barnes and Dennis Hartmann.
|
Return the autocorrelation spectrum at a single lag or successive lags. |
|
Return the autocovariance spectrum at a single lag or successive lags. |
|
Return the correlation spectrum at a single lag or successive lags. |
|
Return the covariance spectrum at a single lag or successive lags. |
|
Calculate the first |
|
EOTs, whatever they are. |
|
Rotated EOFs, e.g. |
|
Returns sample points on Gaussian curve. |
|
Get the histogram along axis |
|
Get linear regression along axis, ignoring NaNs. |
|
Return one or more artificial red noise time series with prescribed mean and standard deviation. |
|
Return the \(e\)-folding autocorrelation timescale for the input autocorrelation spectra along an arbitrary axis. |
|
Return the precentile threshold from an array of percentiles that satisfies the given false discovery rate. |
Spectral analysis¶
Spectral analysis tools. Many of these are adapted from examples and course notes provided by Professors Elizabeth Barnes and Dennis Hartmann.
Note
The convention for this package is to use linear wave properties, i.e. the wavelength in <units> per \(2\pi\) radians, and wavenumber \(2\pi\) radians per <units>.
|
Applies Butterworth filter to data. |
|
Return the co-spectral decomposition and related quantities for two real-valued arrays along an arbitrary axis. |
|
Return the 2D spectral decomposition of two real-valued arrays with along an arbitrary time dimension and cyclic dimension. |
|
Apply scipy.signal.lfilter to data. |
|
Select the first Fourier harmonics of the time series. |
|
Select only the highest power frequencies. |
|
Returns coefficients for Lanczos high-pass filter with desired wavelength specified. |
|
Return the spectral decomposition of a real-valued array along an arbitrary axis. |
|
Return the spectral decomposition of a real-valued array along an arbitrary axis. |
|
Calculate the response function given the a and b coefficients for some analog filter. |
|
Apply running average to array. |
|
Compose array of sine waves. |
|
Retrieve the |
Wave diagnostics¶
Various diagnostics for quantifying wave activity, tracking wave packets, and detecting blocking patterns. Incorporates code developed by Clare Huang.
Warning
This submodule out of date and poorly tested. It will eventually be cleaned up. In the meantime, feel free to copy and modify it.
|
Get equivalent latitudes corresponding to PV levels evenly sampled from the distribution of sorted PVs. |
|
Return the finite-amplitude wave activity. |
|
Return the local finite-amplitude wave activity. |
Spherical coordinates¶
Mathematical operations on the surface of the sphere.
Warning
This submodule out of date and poorly tested. It will eventually be cleaned up. In the meantime, feel free to copy and modify it.
|
Return array padded circularly along longitude and over the poles for finite difference methods. |
|
Take area mean of data time series. |
|
Calculate gradient in spherical coordinates. |
|
Calculate Laplacian in spherical coordinates. |
|
Calculate the great circle distance between two points on Earth, specified in degrees. |
Dataset downloads¶
Convenient wrappers for python APIs used to download climatological datasets.
Warning
This submodule out of date and poorly tested. It will eventually be cleaned up. In the meantime, feel free to copy and modify it.
|
Download CMIP5 model data. |
|
Retrieves ERA reanalysis data using the provided API. |
|
Download MERRA data. |
|
Download NCAR CFSL data. |
Download satellite data. |
Miscellaneous utilities¶
Includes miscellaneous mathematical functions.
|
Convert an array of datetime64 values to a calendar array of years, months, days, hours, minutes, and seconds. |
|
Find the location of zero values or extrema for a given data array. |
|
Find the (first) intersection point for two line segments. |
|
Track individual “lines” across lists of coordinates. |
|
Return the overlapping segment from a series of vectors with common coordinate spacings but different start or end points. |
Physical constants¶
A variety of physical constants.
Earth mean radius |
|
Speed of light in a vacuum |
|
Specific heat capacity at constant pressure for dry air at \(0^{\circ}\mathrm{C}\) |
|
Specific heat capacity at constant volume for dry air at \(0^{\circ}\mathrm{C}\) |
|
Rule-of-thumb 7km atmospheric scale height |
|
Poisson constant for dry air. |
|
Latent heat of fusion at \(0^{\circ}\mathrm{C}\) |
|
Latent heat of sublimation at \(0^{\circ}\mathrm{C}\) |
|
Latent heat of vaporization at \(0^{\circ}\mathrm{C}\) |
|
Dry air molar mass |
|
Water vapor molar mass |
|
Earth rotation rate |
|
Standard reference pressure |
|
\(\pi\) (3.14159…) |
|
Earth mean sea-level pressure |
|
Dry air gas constant |
|
Water vapor gas constant |
|
\(\tau\) (6.28318…) |