Skip to main content

romda — real-time reduced-order modelling and bias-aware data assimilation

romda is an open-source Python package for real-time data assimilation with reduced-order models: ensemble Kalman filters (including the regularized bias-aware EnKF), physical and data-driven forecast models (ESN, POD-ESN), bias estimators, and POD/SPOD decompositions — with applications to thermoacoustics and fluid flows.

📖 Documentation: https://andreanovoa.github.io/real-time-bias-aware-DA/

This repository was formerly the real-time-DA package. The code used in the papers listed below is preserved at the release tags v1.0, v1.1 and v2.1.


🚀 Getting started

  1. Install from PyPI
pip install romda

or, to work on the source, clone and install in editable mode:

git clone https://github.com/andreanovoa/real-time-bias-aware-DA
cd real-time-bias-aware-DA
conda create -n romda python=3.12 && conda activate romda
pip install -e ".[dev,notebooks]" --use-pep517   # dev = pytest, notebooks = jupyter
  1. (Optional) Run the test suite
python -m pytest tests/                 # unit and integration tests
python -m pytest scripts/tutorials/test_tutorials.py    # execute the tutorial notebooks

Quick example — bias-aware state and parameter estimation on a Van der Pol twin experiment:

import numpy as np
from romda.bias_estimators import ConstantBias
from romda.estimators import rBA_EnKF
from romda.models.physical import VdP
from romda.observations import Observations

truth = Observations(model=VdP, t_start=0.6, t_stop=0.8, Nt_obs=30,
                     add_noise=True, manual_bias='linear')
Cdd = np.diag((0.05 * np.max(abs(truth.y_obs), axis=0)) ** 2)

ensemble = rBA_EnKF(parent_model=VdP(dt=truth.dt), parent_bias=ConstantBias,
                    m=10, std_phi=0.1, std_alpha=dict(zeta=(40., 60.)))

for d, t_d in zip(truth.y_obs, truth.t_obs):
    ensemble.forecast_step(t_end=t_d)     # advance model (and bias) to the observation time
    ensemble.analysis_step(d=d, Cdd=Cdd)  # Bayesian update

(The ensemble forecast runs in a multiprocessing pool, so in a script keep this under if __name__ == "__main__":.)

Check out the Tutorials folder, which includes several jupyter notebooks aiming to ease the understanding of the repository.


🌟 What is available?

Data assimilation methods romda.estimators

  • EnKF — ensemble Kalman filter
  • EnSRKF — ensemble square-root Kalman filter
  • rBA-EnKF — regularized bias-aware EnKF
  • KalmanFilter — the classical (linear) Kalman filter

Physical models romda.models.physical (from the dynamodels package)

  • Rijke tube model (dimensional with Galerkin projection)
  • Van der Pol oscillator
  • Lorenz 63
  • Lorenz 96
  • Azimuthal thermoacoustics model
  • Kuramoto-Sivashinsky equation

Data-driven models romda.models.data_driven

  • ESN_model — Echo State Network as a forecasting model
  • POD_ESN — POD dimensionality reduction + ESN forecaster
  • LinearModel — linear map with process noise (Kalman-filter tutorials)
  • Projectors (autoencoders/): POD, SPOD — (Spectral) Proper Orthogonal Decomposition (Sieber 2016, Towne 2018)

Reservoir core: EchoStateNetwork — from the external echostatenetwork package, re-exported by romda.models.data_driven; pod_utils (in autoencoders/) — standalone POD/SPOD algorithms

Bias estimators romda.bias_estimators

  • Echo State Network
  • Constant bias
  • No bias (unbiased limit)

📂 Structure

.
├── data/                        # Dataset files
├── docs/                        # Documentation site sources + media used in the notebooks
├── results/                     # Generated results
├── scripts/
│   └── tutorials/               # Teaching notebooks + notebook execution tests
├── src/                         # Source code (the romda package: `from romda... import ...`)
│   ├── observations.py          # Truth / observation generation
│   ├── data_assimilation.py     # run_da_loop: the shared sequential DA driver
│   ├── utils.py
│   ├── estimators/              # Estimator hierarchy (the DA layer)
│   │   ├── base.py              # Estimator base class (forecast_step, bias wiring)
│   │   ├── ensembles.py         # EnsembleEstimator: EnKF, EnSRKF, rBA_EnKF
│   │   ├── deterministic.py     # DeterministicEstimator: KalmanFilter
│   │   └── inflation.py         # Covariance inflation
│   ├── bias_estimators/         # Bias model classes
│   │   ├── bias.py              # Bias base class
│   │   ├── esn.py               # ESN_bias
│   │   └── constantbias.py      # ConstantBias, NoBias
│   ├── models/                  # Model layer
│   │   ├── __init__.py          # re-exports the dynamodels package (Model base,
│   │   │                        #   integrators, physical models) + pickle aliases
│   │   └── data_driven/         # ESN_model, POD_ESN, LinearModel, esn_config
│   │       └── autoencoders/    # Projector hierarchy: POD, SPOD (+ pod_utils)
│   └── plotting/                # Visualization helpers
├── tests/                       # Unit and integration test suite
├── mkdocs.yml                   # Documentation site configuration
├── pyproject.toml               # Package setup
└── README.md                    # This file

📚 Main publications from this repository

Journal papers
  • Nóvoa, Noiray, Dawson & Magri (2024). A real-time digital twin of azimuthal thermoacoustic instabilities. Journal of Fluid Mechanics. Published paper | 🏷️ v1.0.
  • Nóvoa, Racca & Magri (2023). Inferring unknown unknowns. Computer Methods in Applied Mechanics and Engineering. Published paper | Legacy repository.
  • Nóvoa & Magri (2022). Real-time thermoacoustic data assimilation. Journal of Fluid Mechanics. Published paper | Legacy repository.
Conference papers and proceedings
  • Nóvoa & Magri (2025). Online model learning with data-assimilated reservoir computers. Preprint | 🏷️ v1.1.
  • Nóvoa & Magri (2024). Real-time digital twins of multiphysics and turbulent flows. Paper.
  • Nóvoa & Magri (2022). Bias-aware thermoacoustic data assimilation. In_ 51st International Congress and Exposition on Noise Control Engineering. Paper. | Legacy repository.
PhD thesis
  • Nóvoa (2024). Real-time data assimilation in nonlinear dynamcal systems. University of Cambridge. Thesis.

🤝 Contributing

Contributions, bug reports, and feature requests are welcome! Please open an issue or submit a pull request. For questions or collaborations, please reach out to A. Nóvoa.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

romda-3.0.0.tar.gz (133.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

romda-3.0.0-py3-none-any.whl (138.6 kB view details)

Uploaded Python 3

File details

Details for the file romda-3.0.0.tar.gz.

File metadata

  • Download URL: romda-3.0.0.tar.gz
  • Upload date:
  • Size: 133.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for romda-3.0.0.tar.gz
Algorithm Hash digest
SHA256 a952067e4fc3751b3e081c7be7897a1b2492da4c04fba72b5addfc63dd983a7a
MD5 c18c169c288b8b372ead7d9fb3707479
BLAKE2b-256 95e23ffc4cb87881ca82a388bdc4c16b7688130d687af12ffb205655e5714a9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for romda-3.0.0.tar.gz:

Publisher: release.yml on andreanovoa/real-time-bias-aware-DA

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file romda-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: romda-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 138.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for romda-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef3a546997d39fc03ddcc5d9399ceacda9abec930e200c1c557df2a8168456be
MD5 d9d315ec4b71683cd6fd14777e5564cc
BLAKE2b-256 f9990f5a2a49a50af6b5f0fad43edc88a5c08873f17a5f885a9888e2b801c05e

See more details on using hashes here.

Provenance

The following attestation bundles were made for romda-3.0.0-py3-none-any.whl:

Publisher: release.yml on andreanovoa/real-time-bias-aware-DA

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page