Home

Awesome

<!-- ! ___ _ ___ ___ ___ ___ ! | \ /_\ | _ \ _ \ __| _ \ ! | |) / _ \| _/ _/ _|| / ! |___/_/ \_\_| |_| |___|_|_\ ! ! --> <img src="https://github.com/nansencenter/DAPPER/raw/master/docs/images/logos/logo_wtxt.png" align="left" width="250"/>

DAPPER is a set of templates for benchmarking the performance of data assimilation (DA) methods. The numerical experiments provide support and guidance for new developments in DA. The typical set-up is a synthetic (twin) experiment, where you specify a dynamic model and an observational model, and use these to generate a synthetic truth (multivariate time series), and then estimate that truth given the models and noisy observations.

<!-- Badges / shields -->

Github CI Coveralls pre-commit PyPI - Version PyPI - Downloads

Getting started

Highlights

DAPPER enables the numerical investigation of DA methods through a variety of typical test cases and statistics. It (a) reproduces numerical benchmarks results reported in the literature, and (b) facilitates comparative studies, thus promoting the (a) reliability and (b) relevance of the results. For example, the figure below is generated by docs/examples/basic_3.py, reproduces figure 5.7 of these lecture notes. DAPPER is (c) open source, written in Python, and (d) focuses on readability; this promotes the (c) reproduction and (d) dissemination of the underlying science, and makes it easy to adapt and extend.

Comparative benchmarks with Lorenz-96 plotted as a function of the ensemble size (N)

DAPPER demonstrates how to parallelise ensemble forecasts (e.g., the QG model), local analyses (e.g., the LETKF), and independent experiments (e.g., docs/examples/basic_3.py). It includes a battery of diagnostics and statistics, which all get averaged over subdomains (e.g., "ocean" and "land") and then in time. Confidence intervals are computed, including correction for auto-correlations, and used for uncertainty quantification, and significant digits printing. Several diagnostics are included in the on-line "liveplotting" illustrated below, which may be paused for further interactive inspection. In summary, DAPPER is well suited for teaching and fundamental DA research. Also see its drawbacks.

EnKF - Lorenz-96

<!-- Non-highlighted features: - Time sequences use via `tools.chronos.Chronology` and `tools.chronos.Ticker`. - Random variables via `tools.randvars.RV`: Gaussian, Student-t, Laplace, Uniform, ..., as well as support for custom sampling functions. - Covariance matrices via `tools.matrices.CovMat`: provides input flexibility/overloading, lazy eval that facilitates the use of non-diagonal covariance matrices (whether sparse or full). - built-in tools for experiment and result management, -->

Installation

Successfully tested on Linux/Mac/Windows.

Prerequisite: Python>=3.9

If you're an expert, setup a python environment however you like. Otherwise: Install Anaconda, then open the Anaconda terminal and run the following commands:

conda create --yes --name dapper-env python=3.12
conda activate dapper-env
python --version

Ensure the printed version is as desired. Keep using the same terminal for the commands below.

Install

Either: Install for development (recommended)

Do you want the DAPPER code available to play around with? Then

Or: Install as library

Do you just want to run a script that requires DAPPER? Then

Finally: Test the installation

You should now be able to do run your script with python path/to/script.py.
For example, if you are in the DAPPER dir,

python docs/examples/basic_1.py

PS: If you closed the terminal (or shut down your computer), you'll first need to run conda activate dapper-env

DA methods

<!-- markdownlint-capture --> <!-- markdownlint-disable line-length -->
MethodLiterature reproduced
EnKF <sup>1</sup>Sakov08, Hoteit15, Grudzien2020
EnKF-NBocquet12, Bocquet15
EnKS, EnRTSRaanes2016
iEnKS / iEnKF / EnRML / ES-MDA <sup>2</sup>Sakov12, Bocquet12, Bocquet14
LETKF, local & serial EAKFBocquet11
Sqrt. model noise methodsRaanes2014
Particle filter (bootstrap) <sup>3</sup>Bocquet10
Optimal/implicit Particle filter <sup>3</sup>Bocquet10
NETFTödter15, Wiljes16
Rank histogram filter (RHF)Anderson10
4D-Var
3D-Var
Extended KF
Optimal interpolation
Climatology
<!-- markdownlint-restore -->

<sup>1</sup>: Stochastic, DEnKF (i.e. half-update), ETKF (i.e. sym. sqrt.). Serial forms are also available.
Tuned with inflation and "random, orthogonal rotations".
<sup>2</sup>: Also supports the bundle version, and "EnKF-N"-type inflation.
<sup>3</sup>: Resampling: multinomial (including systematic/universal and residual).
The particle filter is tuned with "effective-N monitoring", "regularization/jittering" strength, and more.

For a list of ready-made experiments with suitable, tuned settings for a given method (e.g., the iEnKS), use:

grep -r "xp.*iEnKS" dapper/mods

Test cases (models)

Simple models facilitate the reliability, reproducibility, and interpretability of experiment results.

ModelLinTLM**PDE?Phys.dim.State lenLyap≥0Implementer
IdYesYesNoN/A*0Raanes
Linear Advect. (LA)YesYesYes1d1000 *51Evensen/Raanes
DoublePendulumNoYesNo0d42Matplotlib/Raanes
IkedaNoYesNo0d21Raanes
LotkaVolterraNoYesNo0d5 *1Wikipedia/Raanes
Lorenz63NoYes"Yes"0d32Sakov
Lorenz84NoYesNo0d32Raanes
Lorenz96NoYesNo1d40 *13Raanes
Lorenz96sNoYesNo1d10 *4Grudzien
LorenzUVNoYesNo2x 1d256 + 8 *≈60Raanes
LorenzIIINoNoNo1d960 *≈164Raanes
Vissio-Lucarini 20NoYesNo1d36 *10Yumeng
Kuramoto-SivashinskyNoYesYes1d128 *11Kassam/Raanes
Quasi-Geost (QG)NoNoYes2d129²≈17k≈140Sakov

The models are found as subdirectories within dapper/mods. A model should be defined in a file named __init__.py, and illustrated by a file named demo.py. Most other files within a model subdirectory are usually named authorYEAR.py and define a HMM object, which holds the settings of a specific twin experiment, using that model, as detailed in the corresponding author/year's paper. A list of these files can be obtained using

find dapper/mods -iname '[a-z]*[0-9]*.py'

Some files contain settings used by several papers. Moreover, at the bottom of each such file should be (in comments) a list of suitable, tuned settings for various DA methods, along with their expected, average rmse.a score for that experiment. As mentioned above, DAPPER reproduces literature results. You will also find results that were not reproduced by DAPPER.

Similar projects

DAPPER is aimed at research and teaching (see discussion up top). Example of limitations:

The scope of DAPPER is restricted because

framework_to_language

Moreover, even straying beyond basic configurability appears unrewarding when already building on a high-level language such as Python. Indeed, you may freely fork and modify the code of DAPPER, which should be seen as a set of templates, and not a framework.

Also, DAPPER comes with no guarantees/support. Therefore, if you have an operational or real-world application, such as WRF, you should look into one of the alternatives, sorted by approximate project size.

NameDevelopersPurpose (approximately)
DARTNCARGeneral
PDAFAWIGeneral
JEDIJCSDA (NOAA, NASA, ++)General
OpenDATU DelftGeneral
EMPIREReading (Met)General
ERTStatoilHistory matching (Petroleum DA)
PIPTCIPRHistory matching (Petroleum DA)
MIKEDHIOceanographic
OAKLiègeOceanographic
SirocoOMPOceanographic
VerdandiINRIABiophysical DA
PyOSSEEdinburgh, ReadingEarth-observation DA

Below is a list of projects with a purpose more similar to DAPPER's (research in DA, and not so much using DA):

NameDevelopersNotes
DAPPERRaanes, Chen, GrudzienPython
SANGOMAConglomerate*Fortran, Matlab
hIPPYlibVilla, Petra, GhattasPython, adjoint-based PDE methods
FilterPyR. LabbePython. Engineering oriented.
DASoftwareYue Li, StanfordMatlab. Large inverse probs.
PompU of MichiganR
EnKF-MatlabSakovMatlab
EnKF-CSakovC. Light-weight, off-line DA
pydaHickmanPython
PyDAShady-AhmedPython
DasPyXujun HanPython
DataAssim.jlAlexander-BarthJulia
DataAssimilationBenchmarks.jlGrudzienJulia, Python
EnsembleKalmanProcesses.jlClim. Modl. AllianceJulia, EKI (optim)
DatumRaanesMatlab
IEnKS codeBocquetPython

The EnKF-Matlab and IEnKS codes have been inspirational in the development of DAPPER.

*: AWI/Liege/CNRS/NERSC/Reading/Delft

Contributing

Issues and Pull requests

Do not hesitate to open an issue, whether to report a problem or ask a question. It may take some time for us to get back to you, since DAPPER is primarily a volunteer effort. Please start by perusing the documentation and searching the issue tracker for similar items.

Pull requests are very welcome. Examples: adding a new DA method, dynamical models, experimental configuration reproducing literature results, or improving the features and capabilities of DAPPER. Please keep in mind the intentional limitations and read the developers guidelines.

Contributors

Patrick N. Raanes, Yumeng Chen, Colin Grudzien, Maxime Tondeur, Remy Dubois

DAPPER is developed and maintained at NORCE (Norwegian Research Institute) and the Nansen Environmental and Remote Sensing Center (NERSC), in collaboration with the University of Reading, the UK National Centre for Earth Observation (NCEO), and the Center for Western Weather and Water Extremes (CW3E).

<!-- markdownlint-capture --> <!-- markdownlint-disable line-length -->

NORCE NERSC <img src="https://github.com/nansencenter/DAPPER/raw/master/docs/images/logos/UoR-logo.png?raw=true" height="120" /> <img src="https://github.com/nansencenter/DAPPER/raw/master/docs/images/logos/nceologo1000.png?raw=true" height="100"> <img src="https://github.com/nansencenter/DAPPER/raw/master/docs/images/logos/CW3E-Logo-Horizontal-FullColor.png?raw=true" width="400">

<!-- markdownlint-restore -->

Publications

<!-- markdownlint-configure-file { "no-multiple-blanks": false, "first-line-h1": false, "no-inline-html": { "allowed_elements": [ "img", "sup" ] }, "code-block-style": false, "ul-indent": { "indent": 2 } } -->