ensemble_base⚓︎
Ensemble container for ensemble-based data assimilation.
The PIPT counterpart to :mod:popt.ensembles.ensemble_base: holds the state
realisations, observed data, localization and forward simulator for an
assimilation run.
Previously pipt.loop.ensemble.Ensemble; that module has been removed.
AssimilationEnsemble
⚓︎
Bases: ForecastMixin, OutlierMixin, LocalAnalysisMixin, BaseEnsemble
Class for organizing/initializing misc. variables and simulator for an ensemble-based inversion run. Inherits the PET ensemble structure
RESTART_ATTRIBUTES = ('enX', 'prior_enX', 'pred_data', 'member_outputs', 'member_adjoints', 'adjoints', 'scale_data', 'Am', 'proj', 'iteration', 'sparse_data', 'scale_val')
⚓︎
What a resume must restore on the ensemble: what iterations change (the state, its forecast), and what construction drew or derived from a draw (the prior, the observation scaling, the scaled prior's SVD), so a resumed run continues the interrupted one whatever the random state was when the resuming process built its ensemble.
__init__(keys_da, keys_en, sim)
⚓︎
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
keys_da
|
dict
|
Options for the data assimilation class
|
required |
keys_en
|
dict
|
Options for the ensemble class
NB: If keys_en is empty dict, it is assumed that the prior info is contained in keys_da. The merged dict keys_da|keys_en is what is sent to the parent class. |
required |
sim
|
callable
|
The forward simulator (e.g. flow) |
required |
check_assimindex_simultaneous()
⚓︎
Check if assim. indices is given as a 1D list as is needed in simultaneous updating. If not, make it a 2D list with one row.
perturb_observations(vecObs)
⚓︎
Generate the perturbed observed data ensemble
restart_state()
⚓︎
What a checkpoint carries for this ensemble: RESTART_ATTRIBUTES plus the random stream's state.
restore_restart_state(state)
⚓︎
Overlay a checkpoint's ensemble state and mark the ensemble as resumed.
NoLocalization
⚓︎
Stands in for a localization when the config asks for none.
Analyses branch on localization.name; None means no localization.
A module-level class rather than an anonymous one so the ensemble that
holds it can be pickled -- emergency_dump and the restart file both
pickle the ensemble, and an anonymous class made that fail exactly when
a run had crashed.