This page provides an auto-generated summary of climpred’s API.
For more details and examples, refer to the relevant chapters in the main part of the documentation.
High-Level Classes
A primary feature of climpred
is our prediction ensemble objects,
HindcastEnsemble
and
PerfectModelEnsemble
. Users can append their initialized
ensemble to these classes, as well as an arbitrary number of verification products (assimilations,
reconstructions, observations), control runs, and uninitialized ensembles.
HindcastEnsemble
A HindcastEnsemble
is a prediction ensemble that is initialized off of some form of
observations (an assimilation, renanalysis, etc.). Thus, it is anticipated that forecasts are
verified against observation-like products. Read more about the terminology
here.
HindcastEnsemble (xobj) |
An object for climate prediction ensembles initialized by a data-like product. |
Add and Retrieve Datasets
Analysis Functions
HindcastEnsemble.verify ([name, reference, …]) |
Verifies the initialized ensemble against observations/verification data. |
HindcastEnsemble.compute_persistence |
|
HindcastEnsemble.compute_uninitialized |
|
Pre-Processing
HindcastEnsemble.smooth ([smooth_kws]) |
Smooth all entries of PredictionEnsemble in the same manner to be able to still calculate prediction skill afterwards. |
PerfectModelEnsemble
A PerfectModelEnsemble
is a prediction ensemble that is initialized off of a control simulation
for a number of randomly chosen initialization dates. Thus, forecasts cannot be verified against
real-world observations. Instead, they are compared to one another and to the
original control run. Read more about the terminology here.
Add and Retrieve Datasets
Direct Function Calls
A user can directly call functions in climpred
. This requires entering more arguments, e.g.
the initialized ensemble
Dataset
/xarray.core.dataarray.DataArray
directly as
well as a verification product. Our object
HindcastEnsemble
and
PerfectModelEnsemble
wrap most of these functions, making the
analysis process much simpler. Once we have wrapped all of the functions in their entirety, we will
likely depricate the ability to call them directly.
Bootstrap
bootstrap_compute (hind, verif[, hist, …]) |
Bootstrap compute with replacement. |
bootstrap_hindcast (hind, hist, verif[, …]) |
Bootstrap compute with replacement. Wrapper of |
bootstrap_perfect_model (init_pm, control[, …]) |
Bootstrap compute with replacement. Wrapper of |
bootstrap_uninit_pm_ensemble_from_control_cftime (…) |
Create a pseudo-ensemble from control run. |
bootstrap_uninitialized_ensemble (hind, hist) |
Resample uninitialized hindcast from historical members. |
dpp_threshold (control[, sig, iterations, dim]) |
Calc DPP significance levels from re-sampled dataset. |
varweighted_mean_period_threshold (control[, …]) |
Calc the variance-weighted mean period significance levels from re-sampled dataset. |
Prediction
compute_hindcast (hind, verif[, metric, …]) |
Verify hindcast predictions against verification data. |
compute_perfect_model (init_pm, control[, …]) |
Compute a predictability skill score for a perfect-model framework simulation dataset. |
Reference
compute_persistence (hind, verif[, metric, …]) |
Computes the skill of a persistence forecast from a simulation. |
compute_uninitialized (hind, uninit, verif[, …]) |
Verify an uninitialized ensemble against verification data. |
Metrics
Metric (name, function, positive, …[, …]) |
Master class for all metrics. |
_get_norm_factor (comparison) |
Get normalization factor for normalizing distance metrics. |
Comparisons
Comparison (name, function, hindcast, …[, …]) |
Master class for all comparisons. |
Statistics
autocorr (ds[, lag, dim, return_p]) |
Calculate the lagged correlation of time series. |
corr (x, y[, dim, lag, return_p]) |
Computes the Pearson product-moment coefficient of linear correlation. |
decorrelation_time (da[, r, dim]) |
Calculate the decorrelaton time of a time series. |
dpp (ds[, dim, m, chunk]) |
Calculates the Diagnostic Potential Predictability (dpp) |
rm_poly (ds, order[, dim]) |
Returns xarray object with nth-order fit removed. |
rm_trend (da[, dim]) |
Remove linear trend from time series. |
varweighted_mean_period (da[, dim]) |
Calculate the variance weighted mean period of time series based on xrft.power_spectrum. |
Tutorial
load_dataset ([name, cache, cache_dir, …]) |
Load example data or a mask from an online repository. |
Preprocessing
load_hindcast ([inits, members, preprocess, …]) |
Load multi-member, multi-initialization hindcast experiment into one xr.Dataset compatible with climpred. |
rename_to_climpred_dims (xro) |
Rename existing dimension in xr.object xro to CLIMPRED_ENSEMBLE_DIMS from existing dimension names. |
rename_SLM_to_climpred_dims (xro) |
Rename ensemble dimensions common to SubX or CESM output: |
get_path ([dir_base_experiment, member, …]) |
Get the path of a file for MPI-ESM standard output file names and directory. |