Legacy API reference#

This page provides an auto-generated summary of mesmers’ API.

Train mesmer#

train_gt(data, targ, esm, time, cfg[, ...])

Derive global trend (emissions + volcanoes) parameters from specified ensemble type with specified method.

train_gv(gv, targ, esm, cfg[, save_params])

Derive global variability parameters for a specified method.

train_lt(preds, targs, esm, cfg[, save_params])

Derive local trends (i.e., forced response) parameters for given ESM for given set of targets and predictors.

train_lv(preds, targs, esm, cfg[, ...])

Derive local variability (i.e., natural variabiliy) parameters.

Create emulations#

gather_gt_data(params_gt, preds_gt, cfg[, ...])

Create global trend (emissions + volcanoes) emulations for specified ensemble type and method.

create_emus_gv(params_gv, preds_gv, cfg[, ...])

Create global variablity emulations for specified method.

create_emus_lt(params_lt, preds_lt, cfg[, ...])

Create local trends (i.e., forced response) emulations for given parameter set and predictors.

create_emus_lv(params_lv, preds_lv, cfg[, ...])

Create local variablity emulations.

create_emus_g(emus_gt, emus_gv, params_gt, ...)

Merge global trend and global variability emulations of the same scenarios.

create_emus_l(emus_lt, emus_lv, params_lt, ...)

Merge local trends and local variability temperature emulations of the same scenarios and targets.

make_realisations(preds_lt, params_lt, ...)

Make climate realisations based on pre-calculated MESMER parameters

create_seed_dict(esms, scenarios[, ...])

define seeds for drawing emulations

Individual methods and utils#

Train mesmer#

train_gv_AR(params_gv, gv, max_lag, sel_crit)

Derive AR parameters of global variability under the assumption that gv does not depend on the scenario.


Derive smooth global trend of variable from single ESM ic ensemble with LOWESS smoother.

train_gt_ic_OLSVOLC(var, gt_lowess, time[, cfg])

Derive global trend (emissions + volcanoes) parameters from single ESM ic ensemble by adding volcanic spikes to LOWESS trend.

train_lv_AR1_sci(params_lv, targs, y, ...)

Derive parameters for AR(1) process with spatially-correlated innovations.

train_lv_find_localized_ecov(y, wgt_scen_eq, ...)

Find suitable localization radius for empirical covariance matrix and derive localized empirical cov matrix.


derive scenario weights such that each has equal weight, i.e., 1 / number of samples (= nr_runs * nr_ts)

stack_predictors_and_targets(preds, targs)

Create single array of predictors, and single array of targets

Create emulations#

create_emus_gv_AR(params_gv, nr_emus_v, ...)

Draw global variablity emulations from an AR process.

create_emus_OLS_each_gp_sep(params_lt, ...)

Create local trends with OLS with grid-point-specific predictors

create_emus_lv_AR1_sci(emus_lv, params_lv, ...)

Create local variablity emulations with AR(1) process with spatially-correlated innovations.

create_emus_lv_OLS(params_lv, preds_lv)

Create local variablity emulations with OLS.


Load cmip data#

load_cmip_data_all_esms(esms, scenarios, ...)

Load tas and (potentially) hfds for several ESMs from cmip-ng archive at ETHZ

load_cmipng(targ, esm, scen, cfg)

Load ESM runs from cmip-ng archive at ETHZ.

load_cmipng_hfds(esm, scen, cfg)

Load ESM hfds runs from cmip-ng archive at ETHZ.

load_cmipng_tas(esm, scen, cfg)

Load ESM tas runs from cmip-ng archive at ETHZ.

Load constant files#

load_phi_gc(lon, lat, ls, cfg[, L_start, ...])

Loads or creates (if not available yet) distance matrix and Gaspari-Cohn correlation matrix.

load_regs_ls_wgt_lon_lat([reg_type, lon, lat])

Load constant files.

Load output#

load_mesmer_output(name, cfg[, method_str, ...])

Load saved MESMER output (parameters or emulations).

Load observations#

load_obs(targ, prod, lon, lat, cfg[, ...])

Load observations which you previously downloaded.

load_obs_tblend(prod, lon, lat, cfg, sel_ref)

Load spatially infilled tblend observations.

load_strat_aod(time[, dir_obs])

Load observed global stratospheric aerosol optical depth time series.

Save mesmer bundle#

save_mesmer_bundle(bundle_file, params_lt, ...)

Save all the information required to draw MESMER emulations to disk



Convert dictionary to array.

separate_hist_future(var_c, time_c, cfg)

Separate historical and future time periods into separate keys in dictionary.

extract_land(var[, reg_dict, wgt, ls, ...])

Extract all land grid points and area weights in regions and in land-sea mask for given threshold.

extract_time_period(data, time, start, end)

Extract selected time period.