DEPRECATED: moved to flexprep
Project description
preFLEXPART
⚠️ Moved to flexprep
This project has been renamed to flexprep.
- Install:
pip install flexprep - Imports changed:
preflexpart→flexprep
This preflexpart package is kept only as a transition release.
WARNING:
This project is in BETA and under active development. Interfaces and functionality are subject to change.
preFLEXPART is a Python toolkit to retrieve and preprocess ECMWF IFS fields for the Lagrangian particle dispersion model FLEXPART.
It uses ECMWF’s earthkit-data library to load meteorological GRIB data into familiar xarray/numpy arrays for computation, preserves GRIB metadata, and can write the results back to GRIB2.
Compatibility
Target model: FLEXPART V10
Install the latest release from PyPI
# pip
pip install preflexpart
# or poetry
poetry add preflexpart
At a glance
-
Retrieve IFS forecasts
-
Preprocess for FLEXPART V10
- De-accumulates precipitation, radiation, and fluxes
- Converts
etadot→omega(Pa s⁻¹)
-
Write GRIB2
- Preserves/overrides GRIB metadata as needed
- Ensures all fields are written as GRIB2
Documentation
See the docs/ folder for detailed information:
Changelog
See CHANGELOG.md for version history.
Running Tests
To run the full test suite:
git clone https://gitlab.phaidra.org/flexpart/preflexpart.git
cd preflexpart
poetry install --with dev
poetry run pytest
Feedback
Found a bug or have feedback? Please open an issue.
Roadmap / TODO
- Publish a hosted documentation site (e.g., Read the Docs or GitHub Pages)
- Add Copernicus Data Store (CDS) as a data source
- Find suitable package name (flexprep?)
Testing the preFLEXPART Package
This guide explains how to test the preFLEXPART pipeline using example scripts included in the repository. Each example demonstrates a full workflow: loading, preprocessing, and writing FLEXPART-ready GRIB2 files.
1️. Install the package
Option A — From PyPI
pip install preflexpart==0.1.3-rc4
2️. Get the example scripts
Clone the repository to access the example workflows.
git clone https://gitlab.phaidra.org/flexpart/preflexpart.git
cd preflexpart
3. Run an example pipeline
Each example runs the preFLEXPART pipeline end-to-end.
| Data source | Command | Notes |
|---|---|---|
| 🧪 Bundled test data | python examples/run_pipeline_local.py tests/data/test_sources_raw_ifs.tar.gz |
Works offline using a small bundled dataset |
| 💾 Local GRIB files | python examples/run_pipeline_local.py /path/to/grib_dir |
Use your own GRIB directory |
| ☁️ ECMWF MARS archive | python examples/run_pipeline_mars.py --date 2025-09-29 --time 12 --step "1/to/2/by/1" --max-level 137 |
Requires ECMWF MARS credentials (.ecmwfapirc) |
3️. Check the outputs
After running a pipeline, the processed GRIB2 files are written to ./out_grib2/.
Each file corresponds to one forecast step (e.g. dispf2025072912).
Found a bug or have feedback? Please open an issue or contact nina.burgdorfer@meteoswiss.ch
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file preflexpart-0.1.3.tar.gz.
File metadata
- Download URL: preflexpart-0.1.3.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.11.9 Linux/5.14.21-150500.55.97_13.0.78-cray_shasta_c
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8140d3df7528818e13e84f2893fdb75974b9c7da0de5e3671dc77d8f18f38b28
|
|
| MD5 |
fa47ae33617a679b7f547fd1e092071f
|
|
| BLAKE2b-256 |
a1d37b55e797e4256404ff528a5e29626aedaa4382d3c3d21c8aa6bd41bb8e43
|
File details
Details for the file preflexpart-0.1.3-py3-none-any.whl.
File metadata
- Download URL: preflexpart-0.1.3-py3-none-any.whl
- Upload date:
- Size: 21.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.11.9 Linux/5.14.21-150500.55.97_13.0.78-cray_shasta_c
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b76750d6ecfd903fe9fcbb15b3e27cb284702a6830598b73943c75898c2c9689
|
|
| MD5 |
35de777d75afdac66619ef6bf0458092
|
|
| BLAKE2b-256 |
80581002cbd3a6c30156359f8ffa2b4b89df588c30c1a9d91d088df6d541d116
|