multilevel⚓︎
Multilevel schemes developed in the 4DSeis project.
The multilevel machinery is ensemble work: it reorganises the state into one
block per fidelity level and configures the simulator to run them. It therefore
lives on :class:MultilevelEnsemble, which the scheme composes, rather than
being inherited by the scheme itself.
That split matters. multilevel previously subclassed the ensemble and
esmda_hybrid inherited from both it and the ES-MDA scheme, relying on C3
linearisation to route super().__init__() into the scheme's constructor.
Once the schemes stopped inheriting the ensemble, the ensemble intercepted that
chain and the scheme's __init__ silently stopped running -- leaving
alpha unset and the analysis step broken. Composition removes the ordering
dependence entirely.
MultilevelEnsemble
⚓︎
Bases: AssimilationEnsemble
Ensemble whose state is partitioned into fidelity levels.
enX is a list of matrices, one per level, rather than a single
(nx, ne) matrix, and the simulator is configured to run each level.
Everything else is the ordinary assimilation ensemble.
Attributes:
| Name | Type | Description |
|---|---|---|
enX |
list of ndarray
|
State ensemble per level; |
tot_level |
int
|
Number of fidelity levels. |
ml_ne |
list of int
|
Ensemble size at each level. |
reorganize_ml_prior(enX)
⚓︎
Reorganize prior ensemble to multilevel structure (list of matrices).
esmda_hybrid
⚓︎
Bases: ESMDA
A multilevel implementation of the ES-MDA algorithm with the hybrid gain.
Composes a :class:MultilevelEnsemble and binds hybrid_update for the
per-level gain, the same way :class:~pipt.update_schemes.esmda.ESMDA
binds approx_update and friends. It is not just ESMDA with an
extra flavour, though: its own COMPATIBLE_ANALYSES offers only
"hybrid", deliberately narrower than ESMDA's -- approx_update
et al. expect a single enX/proj matrix, and this scheme's state is
partitioned into one such matrix per level, which those analyses were
never written to handle.
Notes
Requires a multilevel block in keys_en giving levels,
en_size per level and ml_weights.
calc_analysis()
⚓︎
The ES-MDA analysis over every fidelity level: per-level predictions, redrawn observations, the hybrid update, clipped proposals.
score(pred_data=None)
⚓︎
Data misfit over every fidelity level at once.
pred_data is one frame per level here, so the levels are
concatenated along the ensemble axis and scored as a single ensemble
against the un-inflated perturbations, as
:meth:pipt.update_schemes.esmda.ESMDA.score does for one level.
score_and_commit()
⚓︎
Score the forecast that followed the analysis, then commit the step.
Was the second half of check_convergence. ES-MDA never tested for
convergence there; it recomputed the misfit, logged the iteration and
promoted enX_temp.
Returns:
| Type | Description |
|---|---|
dict
|
The |