pyPDAF - A Python interface to Parallel Data Assimilation FrameworkΒΆ

pyPDAF is a Python interface to the Parallel Data Assimilation Framework (PDAF), which is written in Fortran. The latest pyPDAF supports PDAF-V3.1.2.

Data assimilation combines model forecasts with observations to produce an improved estimate of the model state, called an analysis. PDAF provides the assimilation algorithms. pyPDAF provides Python bindings and callback interfaces so that model-specific code, observation handling, and diagnostics can be written in Python.

pyPDAF is designed for workflows where the algorithm is general but the model and observations are application-specific. User-supplied Python functions tell PDAF how to initialise an ensemble, collect a model state, apply an observation operator, provide observation errors, and distribute an analysis back to the model or to files.

pyPDAF can be used in two modes:

  • Online mode: data assimilation is part of the model program. The model advances the ensemble, pyPDAF receives the forecast state in memory, computes the analysis, and returns the updated state to the model. This is usually the most efficient mode.

  • Offline mode: data assimilation is run by a separate program after the model has written forecast or restart files. pyPDAF reads the state from disk, computes the analysis, and writes updated files for the next model run.

Typical applications include:

  • online data assimilation systems with Python models, including machine-learning models;

  • offline data assimilation systems for existing model workflows;

  • rapid testing of data assimilation ideas, observation operators, and diagnostics in Python.

The core PDAF algorithms remain compiled Fortran routines. The main extra cost comes from Python user functions and array conversion between Python and Fortran. For computationally intensive callbacks, tools such as numba can often improve computational efficiency.

New users may want to read the Data assimilation workflow page before the API reference. To start with code, see the Jupyter notebook example for a serial ensemble DA system using a simple wave model.

More structured examples are also available:

Contents: