API reference#
This page provides an auto-generated summary of mesmers’ API.
Statistical functions#
Linear regression#
Ordinary least squares Linear Regression for xr.DataArray objects. |
|
|
Fit a linear model |
|
Predict using the linear model. |
|
Calculate the residuals of the fitted linear model |
|
save params to a netCDF file |
|
read params from a netCDF file |
Auto regression#
|
Select the order of an autoregressive process and potentially calculate the median over ensemble members and scenarios |
|
fit an auto regression and potentially calculate the mean over ensemble members and scenarios |
|
Select the order of an autoregressive process |
|
fit an auto regression |
|
fit a cyclo-stationary auto-regressive process of lag one (AR(1)) on monthly data. |
|
draw time series of an auto regression process |
|
draw time series of an auto regression process with spatially-correlated innovations |
|
draw time series of a cyclo-stationary auto-regressive process of lag one (AR(1)) using individual parameters for each month including spatially-correlated innovations. |
Harmonic Model#
|
construct a Fourier Series from yearly predictors with fitted coeffs. |
|
fit harmonic model i.e. a Fourier Series to every gridcell using BIC score to select the order and least squares to fit the coefficients for each order. |
Power Transformer#
|
Use logistic function to calculate lambda depending on the local yearly values. |
|
function that relates fitted coefficients and the yearly predictor to the lambdas. |
|
estimate the optimal coefficients for the parameters \(\lambda\) for each gridcell, to normalize monthly residuals conditional on yearly predictor. |
|
transform monthly_residuals following Yeo-Johnson transformer with parameters \(\lambda\), fit with |
|
apply the inverse power transformation using the fitted lambdas. |
Localized covariance#
|
adjust localized empirical covariance matrix for autoregressive process of order one |
|
determine localized empirical covariance by cross validation |
determine localized empirical covariance by cross validation for each month. |
Smoothing#
|
LOWESS (Locally Weighted Scatterplot Smoothing) for xarray objects |
Gaspari-Cohn correlation matrix#
|
Gaspari-Cohn correlation matrices for a range of localisation radii |
|
smooth, exponentially decaying Gaspari-Cohn correlation function |
Data handling#
Grid manipulation#
|
wrap array with longitude to [-180..180) |
|
wrap array with longitude to [0..360) |
|
Stack a regular lat-lon grid to a 1D (unstructured) grid |
|
unstack an 1D grid to a regular lat-lon grid and align with original coords |
|
unstack an 1D grid to a regular lat-lon grid but do not align |
|
align an unstacked lat-lon grid with its original coords |
Masking regions#
|
mask out ocean using fractional overlap |
|
mask out ocean |
|
mask out ocean |
|
3D mask of the fractional overlap of a set of regions for the given lat/ lon grid |
Weighted operations: calculate global mean#
|
calculate global weighted mean |
|
area weights based on the cosine of the latitude |
|
weighted mean - convenience function which ignores data_vars missing dims |
|
Create a DataTree isomorphic to |
Geospatial#
|
exact great circle distance based on WSG 84 |
Emulator functions#
Volcanic influence#
|
estimate volcanic influence on temperature residuals using aerosol optical depth observations as proxy |
|
superimpose volcanic influence on smooth temperature anomalies using aerosol optical depth observations as proxy |