-
Notifications
You must be signed in to change notification settings - Fork 11
thresholds
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.
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
).
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 (
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
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 several variables: 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)