pyTENAX

Temperature-dependent extreme precipitation modeling in Python

View on GitHub   Documentation



About

pyTENAX is a Python implementation of the TENAX model — a non-stationary, non-asymptotic statistical framework for estimating extreme sub-hourly precipitation return levels using temperature as a covariate, grounded in Clausius–Clapeyron physics.

I am the main maintainer of this repository. Beyond the core implementation, I built the full ReadTheDocs documentation including background theory, API reference, and Jupyter notebook tutorials. The package also includes a SMEV (Simplified Metastatistical Extreme Value) class and a Weibull tail hypothesis test.

Note: The TENAX methodology was developed and published by Marra et al. (2024). A MATLAB reference implementation is available on Zenodo (DOI: 10.5281/zenodo.8332232). This Python package is a collaborative project — full details in the documentation.

How It Works

The model integrates three components to estimate return levels:

1. Magnitude Model W(x; T)

A left-censored Weibull distribution characterizes precipitation event intensities at temperature T. The scale parameter follows exponential Clausius–Clapeyron dependence: λ(T) = λ₀·eaT. The shape parameter κ(T) = κ₀ + bT captures how scaling varies across quantiles.

Magnitude model
Fitted Weibull quantiles (85th–99.9th percentile) against observed 10-minute precipitation as a function of temperature. Dashed line: left-censoring threshold.

2. Temperature Model g(T)

A generalized Gaussian distribution (β=4) fitted to temperatures preceding peak intensities, estimated via maximum likelihood.

Temperature model
Fitted generalized Gaussian (blue) against observed event temperature distribution (red dashed). μ = 9.82°C, σ = 12.36.

3. Return Level Estimation

The marginal distribution F(x) = ∫W(x; T)·g(T)dT is computed by Monte Carlo integration, producing return level curves with bootstrap uncertainty.

Return level curve
TENAX return level curve with bootstrap uncertainty envelope against observed annual maxima for 10-minute precipitation (station Aadorf).

For the full API reference and step-by-step tutorials, see the documentation.


Methodology Citation

Marra, F., Koukoula, M., Canale, A., and Peleg, N. (2024).
Predicting extreme sub-hourly precipitation intensification based on temperature shifts.
Hydrology and Earth System Sciences, 28, 375–389.
https://doi.org/10.5194/hess-28-375-2024