mesmer.calibrate_mesmer.train_lt

mesmer.calibrate_mesmer.train_lt(preds, targs, esm, cfg, save_params=True)

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

Parameters
  • preds (dict) – nested dictionary of predictors with keys

    • [pred][scen] (1d/ 2d arrays (time)/(run, time) of predictor for specific scenario)

  • targs (dict) – nested dictionary of targets with keys

    • [targ][scen] (3d array (run, time, gp) of target for specific scenario)

  • esm (str) – associated Earth System Model (e.g., “CanESM2” or “CanESM5”)

  • cfg (module) – config file containing metadata

  • save_params (bool, optional) – determines if parameters are saved or not, default = True

Returns

  • params_lt (dict) – dictionary with the trained local trend parameters

    • [“targs”] (emulated variables, str)

    • [“esm”] (Earth System Model, str)

    • [“method”] (applied method, str)

    • [“method_each_gp_sep”] (states if method is applied to each grid point separately, bool)

    • [“preds”] (predictors, list of strs)

    • [“scenarios”] (emission scenarios used for training, list of strs)

    • [xx] additional params depend on method employed

    • [“full_model_contains_lv”] (whether the full model contains part of the local variability module, bool)

  • params_lv (dict, optional) – dictionary of local variability paramters which are derived together with the local trend parameters

    • [“targs”] (emulated variables, str)

    • [“esm”] (Earth System Model, str)

    • [“method”] (applied method, str)

    • [“preds”] (predictors, list of strs)

    • [“scenarios”] (emission scenarios used for training, list of strs)

    • [“part_model_in_lt”] (states if part of the model is saved in params_lt, bool)

    • [“method_lt_each_gp_sep”] (states if local trends method is applied to each grid point separately, bool)

Notes

  • Assumptions:
    • all targets use same approach and same predictors

    • each predictor and each target has the same scenarios as keys

    • all available scenarios are used for training

    • in predictor list: local trend predictors belong before local variability predictors (if there are any)

    • identified parameters are valid for all training scenarios

    • if historical data is used for training, it has its own scenario

    • either each scenario is given the same weight or each time step

  • TODO:
    • find better way to deal with the assumption that local trend predictors belong before local variability predictors (e.g., add check on whether this assumption is fulfilled or rewrite code such that no longer necessary)