Skip to content

thresholds

Jesús Casado Rodríguez edited this page Oct 7, 2024 · 5 revisions

The thresholds tool computes the return periods of discharge return period using the method of L-moments. The input is meant to be the discharge from the LISFLOOD long-term run. The resulting thresholds can be used in a flood forecasting system to define the flood warning levels.

Input

The tool takes as input a NetCDF file containing the annual maxima of the discharge signal. LISFLOOD computes time series of discharge values (average value over the selected computational time step). The users are therefore required to compute the annual maxima. As an example, this step can be achieved by using CDO (cdo yearmax).

Output

The output NetCDF file contains the thresholds for the 1.5, 2, 5, 10, 20, 100, 200 and 500 years return periods, together with the Gumbel parameters ($\sigma$ and $\mu$).

Usage

In the command prompt

usage: thresholds [-h] [-d DISCHARGE] [-o OUTPUT]

Utility to compute the discharge return period thresholds using the method of L-moments.
Thresholds computed: [1.5, 2, 5, 10, 20, 50, 100, 200, 500]

options:
  -h, --help            show this help message and exit
  -d DISCHARGE, --discharge DISCHARGE
                        Input discharge files (annual maxima)
  -o OUTPUT, --output OUTPUT
                        Output thresholds file

In a Python script

The function can be imported in a Python script. It takes as inputs a xarray.DataArray with the annual maxima, and a numpy.ndarray with the return periods to be computed. The result is an xarray.Dataset with variables with the two Gumbel parameters and the values associated to the input return periods.

import xarray as xr
from lisfloodutilities.thresholds import compute_thresholds_gumbel

# load timeseries
# dis: xarray.Dataset

# compute annual maxima
dis_max = dis.groupby('time.year').max(dim='time').rename({'year': 'time'})

# calculate return periods
return_periods = np.array([5, 20, 100])
thresholds = compute_thresholds_gumbel(dis_max, return_periods)
Clone this wiki locally