NEDAS.assim_tools.inflation.RTPP module
- class NEDAS.assim_tools.inflation.RTPP.RTPPInflation(coef: float = 1.0, adaptive: bool = False, prior: bool = False, post: bool = False, timing: Literal['per_iteration', 'once_after_outer_loop'] = 'per_iteration')[source]
Bases:
Inflation- adaptive_post_inflation(c: Context)[source]
Adaptive covariance relaxation coefficient (Ying and Zhang 2015, QJRMS) – see Inflation.relaxation_adaptive_coef()’s own docstring for the corrected formula (2026-07-28) and why the previous vara-denominator version here was numerically fragile.
- apply_inflation(c: Context, flag: str)[source]
Per-iteration application, on that iteration’s own (possibly scale-filtered) c.state.fields_{prior,post}. Called by __call__(), i.e. only when self.timing == ‘per_iteration’.
- apply_inflation_once(c: Context, flag: str)[source]
Once-outside-the-outer-loop application (see Inflation.apply_inflation_once’s own docstring). flag=’prior’ is unsupported here for the same reason as adaptive_prior_inflation – RTPP’s relaxation is inherently a posterior-vs-prior blend, there’s no equivalent “relax to X” operation for a lone prior field. flag=’post’ implements the real RTPP blend on the true full-resolution state: reads the true prior via restart files (_read_prior_field(), tag=’prior’ – correct even at the very first cycle, see io_backends/offline.py’s own ens_init_dir handling there) and the fully recombined posterior via ‘current’ (_read_current_field()), blends, writes back to ‘current’. Fixes a 2026-07-28 bug where this timing previously ran through the base class’s old final_post_inflation(), which applied a hardcoded MULTIPLICATIVE formula (mean + coef*(fld-mean)) regardless of which Inflation subclass was active – for RTPP, whose coef is always in [0,1] (a relaxation weight, not a multiplicative factor), that formula actively DEFLATED the ensemble instead of relaxing it toward the prior.