Skip to content

tglauch/pyVPRM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

594 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DOI PyPI version License Downloads GitHub stars Python Version

pyVRPM is a data-driven model to estimate the carbon flux between the atmosphere and the terrestrial biosphere using multi-spectral satellite observations. A description of the model is published in Geoscientific Model Development (GMD) https://gmd.copernicus.org/articles/18/4713/2025/. If you use this package for you scientific work please cite as follows

Glauch, T., Marshall, J., Gerbig, C., Botía, S., Gałkowski, M., Vardag, S. N., & Butz, A. (2025). pyVPRM: A next-generation vegetation photosynthesis and respiration model for the post-MODIS era. Geoscientific Model Development, 18(14), 4713–4742. https://doi.org/10.5194/gmd-18-4713-2025

or using BibTeX:

@Article{gmd-18-4713-2025,
AUTHOR = {Glauch, T. and Marshall, J. and Gerbig, C. and Bot\'{\i}a, S. and Ga{\l}kowski, M. and Vardag, S. N. and Butz, A.},
TITLE = {\textit{pyVPRM}: a next-generation vegetation photosynthesis and respiration model for the post-MODIS era},
JOURNAL = {Geoscientific Model Development},
VOLUME = {18},
YEAR = {2025},
NUMBER = {14},
PAGES = {4713--4742},
URL = {https://gmd.copernicus.org/articles/18/4713/2025/},
DOI = {10.5194/gmd-18-4713-2025}
}

In case of any questions please write an E-Mail to theo.glauch@dlr.de. If you enjoy the model leave a ⭐.

To get startet with pyVPRM check out the example repository: https://github.com/tglauch/pyVPRM_examples.git

Latest Update | 26-01-2026

With the new version - pyVPRM 5.3 - it is possible to replace the lowess filtering with a more stable Kalman filter. An example of the difference for EVI is shown below for the cropland site DE-RuS using Sentinel-2 data for 2022. The new function can be used by calling vprm_inst.kalman(...) instead of vprm_inst.lowess(...) for instances of the VPRM preprocessor class.

About

pyVPRM is a Python package for estimating the exchange of CO₂ between the atmosphere and the terrestrial biosphere using the Vegetation Photosynthesis and Respiration Model (VPRM).

The model represents both:

  • Gross Primary Productivity (GPP)
  • Ecosystem respiration (Reco)

The balance between these two components yields the Net Ecosystem Exchange (NEE).

pyVPRM provides a flexible and modular implementation of VPRM, allowing users to combine different data sources for vegetation, land cover, and meteorological forcing.

  • Supports multiple satellite products (e.g. Sentinel-2, MODIS, VIIRS)
  • Compatible with various land-cover datasets (e.g. Copernicus Land Cover Service, ESA WorldCover 10 m, MapBiomas)
  • Uses standard meteorological reanalyses, such as ECMWF ERA5
  • Modular design that facilitates extension and customization

pyVPRM can be used for, among others:

  1. Parameter optimization of VPRM against eddy-covariance flux tower observations (e.g. FLUXNET, ICOS)
  2. Regional CO₂ flux estimation and prediction for user-defined domains
  3. Generation of VPRM input fields for coupled atmospheric models such as the Weather Research and Forecasting (WRF) model

Examples of pyVPRM Net Ecosystem Exchange

How to use

Installation

We generally recommend setting up a dedicated virtual environment for using pyVPRM and installing all required dependencies there.

If you are using conda, you may want to follow best practices for mixing conda and pip. The following blog post provides a good overview:
https://www.anaconda.com/blog/using-pip-in-a-conda-environment

Prerequisites

pyVPRM requires the Earth System Modeling Framework (ESMF) and its Python interface ESMFpy for all functionalities that involve regridding.

On many HPC systems specialized for Earth system modeling and climate research, ESMF is already pre-installed. If this is the case, make sure that both esmf and esmpy are available in your environment.

If you need to install ESMF yourself, you can find installation instructions here:

To ensure full ESMF functionality, it is also recommended to install netCDF4.

Example conda setup

conda create -n pyvprm python=3.14
conda activate pyvprm

conda config --add channels conda-forge
conda config --set channel_priority strict

conda install dask netCDF4 esmf esmpy

Then install pyVPRM via pip

pip install pyVPRM

Start your Project

To start your own pyVPRM project, you typically need to follow these steps:

  1. Obtain the required satellite data for your region of interest
  2. Obtain the corresponding land-cover maps for your region of interest
  3. Create a project configuration file
  4. Generate project-specific scripts using the functionality provided by the VPRM class in VPRM.py
  5. Run the calculations

Remarks

Examples

To help you get started with pyVPRM, we provide a companion repository containing example scripts, each with their own README files and in-line comments:

https://github.com/tglauch/pyVPRM_examples.git

The repository includes examples for:

  • Generating WRF input files: ./wrf_preprocessor
  • Generating VPRM fluxes (GPP / NEE): ./vprm_predictions
  • Fitting VPRM parameters: ./fit_vprm_parameters
  • Downloading MODIS/VIIRS data using pyVPRM: ./sat_data_download

Clone the full example repository with:

git clone https://github.com/tglauch/pyVPRM_examples.git

The repository comes with pre-prepared input data, so you can run the examples immediately without downloading or preprocessing any datasets.

Package Structure

The pyVPRM implementation follows a modular design that allows easy replacement and extension of
satellite imagery, land cover maps, meteorological data, flux tower datasets, and VPRM model implementations.

The directory structure is outlined below.


pyVPRM/sat_managers

This directory contains the core classes for handling satellite imagery and land cover maps.

The satellite_data_manager class provides the base data structure for all satellite- and land-cover-related calculations in pyVPRM. It implements common functionality such as:

  • reprojection
  • transformation
  • merging
  • cropping

All satellite- or land-cover-specific classes (including their respective data loading routines) inherit from this base class and are implemented as separate class files within this directory.


pyVPRM/meteorologies

This directory contains classes that provide the meteorological interface for the model.

Meteorological data handling typically depends on the data availability on the user’s system.
A generic and widely applicable option is the Destination Earth platform
(https://platform.destine.eu/).

All meteorology classes inherit from the base class defined in met_base_class.py.
An example implementation for adding a new meteorology source is provided in era5_class_draft.py.


pyVPRM/vprm_models

This directory contains the different implementations of the VPRM model.

Each model requires:

  • an instance of the VPRM preprocessor class, and
  • a corresponding meteorology object

as input.


pyVPRM/flux_tower_libs

This directory provides interfaces to different flux tower datasets (e.g. FLUXNET, ICOS, etc.).

It also includes functionality to compute tower footprints from eddy covariance measurements.

About

pyVPRM is a python implementation for data-driven biosphere models like the Vegetation Photosynthesis and Respriation Model (VPRM)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages