![](https://private-user-images.githubusercontent.com/29706254/297057532-ba2565e6-1434-4a95-8086-936462f8d05d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUxOTc1MDUsIm5iZiI6MTcyNTE5NzIwNSwicGF0aCI6Ii8yOTcwNjI1NC8yOTcwNTc1MzItYmEyNTY1ZTYtMTQzNC00YTk1LTgwODYtOTM2NDYyZjhkMDVkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTAxVDEzMjY0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE5NDI5MGYyNWVjODBlNWQ0MzQ4OTlhNWI5MDkxNDZlMzkwOTFjOThhMjdiYjc2MGRkNjE0ZmQwNzBhNjU3MTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.mBYrQfgiU1knukvrg6NO5hsqp06B5oZWcuditGHzOUI)
pyVPRM
is a software package to calculate the CO2 exchange flux between atmosphere and terrestrial biosphere using the Vegetation Photosynthesis and Respriation Model (VPRM). It takes into account both, the primary productivity (GPP) as well as the respiration. The net flux between both of them is the net ecosystem exchange (NEE). The implementation is flexible and can be run with different satellite products (Sentinel-2, MODIS, VIIRS,...), land cover products (Copernicus Land Cover Service, ESA 10-m World Cover Map, MapBiomas) and climate models like the ECMWFS ERA5 Reanalysis. Through its modular structure it is also easily extendable.
Among others it can be used for
- Fitting the parameters of a VPRM model against Eddy-Covariance Fluxtower measurements (e.g. FLUXNET or ICOS)
- Making CO2 flux predictions for a given region of interest
- Generating input files to run VPRM in the Weather Research and Forecasting Model (WRF)
In case of any questions please write an E-Mail to [email protected].
![](https://private-user-images.githubusercontent.com/29706254/348186783-def61395-f90e-421b-9264-f0608161bd7a.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUxOTc1MDUsIm5iZiI6MTcyNTE5NzIwNSwicGF0aCI6Ii8yOTcwNjI1NC8zNDgxODY3ODMtZGVmNjEzOTUtZjkwZS00MjFiLTkyNjQtZjA2MDgxNjFiZDdhLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTAxVDEzMjY0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ1ODFmMTBkZWU0MmRiYzAyMTFiMTQ4ODY4ZTE0MTU5MDliODkzZWY3ZGI5MGRkZmViZGFjMjg0MTc4YmJlNjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.hm4-lhJSVlxsD7z_6NT5z4q4-tMPyxRh1SXKL5WtYoo)
![](https://private-user-images.githubusercontent.com/29706254/354276845-48c412b2-cf5f-4573-9db8-e60909893218.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUxOTc1MDUsIm5iZiI6MTcyNTE5NzIwNSwicGF0aCI6Ii8yOTcwNjI1NC8zNTQyNzY4NDUtNDhjNDEyYjItY2Y1Zi00NTczLTlkYjgtZTYwOTA5ODkzMjE4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTAxVDEzMjY0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMyMGJjMzU2NmM2NWE0NThkMzk5N2MzZGFjZGYxN2E1NTZhYmE1NGEwZWM0ODgxYjUyYjM3ZGNjOTQ5MDg0NzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.x87J4h1rPTaMFgBcwLU8dfzgF23Q3OiCrTpEyTd7HMg)
In general we recommmend to set up a new virtual environment for the use of pyVPRM
, where you install all the required software. You might also want to consider the best practice about the use of conda and pip here (https://www.anaconda.com/blog/using-pip-in-a-conda-environment).
Prerequisites: pyVPRM
requires an installation of the Earth System Modelling Framework (ESMF) and its python interface - ESMFpy - to use all functionalities that include regridding. On many HPCs specialized for Earth System Modelling and Climate Research ESMF is pre-installed. If you need to install it yourself you find instructions on the ESMF Github here: https://github.com/esmf-org. Installation through conda is possible as explained here here https://github.com/conda-forge/esmf-feedstock. It is recommendend to also install NETCDF4 to use all the functionalities of ESMF.
conda config --add channels conda-forge
conda config --set channel_priority strict
conda install -c conda-forge dask netCDF4
conda install esmf
conda install esmpy
Afterwards install pyVPRM
using pip via
pip install git+https://github.com/tglauch/pyVPRM.git
In order to start your own project you need to at least follow theses steps:
- Get the necessary satellite data for your region of interest
- Get the land cover maps for your region of interest
- Create a config file for your project
- Generate your project scripts based on the functions of the vprm class in
VPRM.py
- Run the calculations
Remarks:
- If there is not yet an interface for your satellite data or land cover map, implement a new subclass in
pyVPRM/sat_managers/
- For new land cover maps you need to additionaly provide a mapping of the land cover classes to the VPRM classes in a config file which is stored in
pyVPRM/vprm_configs
- Open access to land cover maps: Copernicus: https://lcviewer.vito.be/2019 | ESA World Cover: https://viewer.esa-worldcover.org
- Open access to satellite data: MODIS,VIIRS: https://e4ftl01.cr.usgs.gov | Sentinel-2: https://scihub.copernicus.eu/
In order to get started with pyVPRM
there are a number of example scripts with corresponding README
and comments available in the github respository: https://github.com/tglauch/pyVPRM_examples.git. It contains example scripts for:
- Generating WRF inputs under
./wrf_preprocessor
- Generating VPRM fluxes (GPP / NEE):
./vprm_predictions
- Fitting VPRM parameters:
./fit_vprm_parameters
- Downloading MODIS/VIIRS data using
pyVPRM
:./sat_data_download
To download the entire example repository run
git clone https://github.com/tglauch/pyVPRM_examples.git
The repositorty comes with pre-prepared input data, so you do not need to care about getting the data first. Check it out!
The pyVPRM implementation has a modular structure to allow for an easy replacement of satellite images and land cover maps, as well as the meteorologies. The file structure is as follows
pyVPRM/sat_managers
The satellite_data_manager
class in this library is the basic data structure for all satellite image and land cover maps calcuations in pyVPRM. It provides function to reproject, transform, merge and crop satellite images. All other classes for specific satellite images or land cover maps, with the respective loading routines, are derived from this base class and implemented in the respective class files in the folder.
pyVPRM/meteorologies
The classes in this folder provide the interface for the satellite data. This will usually strongly depend on the data availability. You'll likely need to make modifications here or implement your own class. All meteorology classes are derived from the base class in met_base_class.py
. An example to implement a new meteorology class can be found in era5_class_draft.py
.