Vonk (2025) SPEI: A Python package for calculating and visualizing drought indices
Identification
- Journal: The Journal of Open Source Software
- Year: 2025
- Date: 2025-07-29
- Authors: Martin A. Vonk
- DOI: 10.21105/joss.08454
Research Groups
- Department of Water Management, Faculty of Civil Engineering and Geosciences, Delft University of Technology, The Netherlands
- Artesia B.V., The Netherlands
Short Summary
The paper introduces SPEI, a Python package designed to streamline the calculation and visualization of various meteorological, hydrological, and agricultural drought indices from time series data.
Objective
- To provide a flexible, open-source software tool for computing and visualizing standardized and non-standardized drought indices by leveraging the Python scientific ecosystem (Pandas, SciPy, and Matplotlib).
Study Configuration
- Spatial Scale: Not applicable (Software package; example data provided for the Netherlands).
- Temporal Scale: Not applicable (Software package; supports time series typically $\ge 30$ years with aggregation scales of 1, 3, 6, 12, 24, or 48 months).
Methodology and Data
- Models used:
- Standardized indices: Standardized Precipitation Index (SPI), Standardized Precipitation Evapotranspiration Index (SPEI), Standardized Groundwater Index (SGI), Standardized Streamflow Index (SSFI/SSI), and Standardized Soil Moisture Index (SSMI).
- Non-standardized indices: Rainfall Anomaly Index (RAI), Modified RAI (mRAI), Climdex indices, and KNMI precipitation deficit.
- Computational tools: Pandas (time series handling), SciPy (probability distribution fitting and Z-score conversion), and Matplotlib (visualization).
- Data sources: Example implementation uses daily precipitation and potential evaporation data from the Royal Netherlands Meteorological Institute (KNMI).
Main Results
- Developed a package that automates the process of fitting continuous probability distributions (e.g., Gamma for SPI, Fisk for SPEI) to time series and converting them into Z-scores.
- Implemented visualization tools, including multi-scalar heatmaps to identify the persistence and build-up of multi-year droughts and threshold-based drought identification (fixed and variable).
- Enabled the use of over 200 univariate continuous distributions available via SciPy for flexible index calculation.
Contributions
- Offers a unified and flexible Python-based framework that reduces the complexity of calculating multiple drought indices.
- Integrates advanced distribution fitting and time-series aggregation (handling varying month lengths) into a single accessible tool for the scientific community.
Funding
- Not specified in the provided text.
Citation
@article{Vonk2025SPEI,
author = {Vonk, Martin A.},
title = {SPEI: A Python package for calculating and visualizing drought indices},
journal = {The Journal of Open Source Software},
year = {2025},
doi = {10.21105/joss.08454},
url = {https://doi.org/10.21105/joss.08454}
}
Original Source: https://doi.org/10.21105/joss.08454