Skip to content

Official thresholds

glofas_ewds.thresholds

The official GloFAS v4 flood thresholds: the 2-, 5- and 20-year flow of a cell.

:func:threshold_url and :func:threshold_file_name are pure; the readers need the netcdf extra. No network: download the files with your own client.

The EWDS does not serve the thresholds. ECMWF publishes them as "GloFAS auxiliary data": three global NetCDF files at 0.05° (about 165 MB each), public and without credentials, one per return period. For each node the readers take the cell the node already reads for the forecast and the reference, the one :func:~glofas_ewds.cells.open_meteo_cell chooses: a wrong cell on a river is a factor of ten.

Compare with :func:~glofas_ewds.return_period.return_levels, which fits your own levels from a node's reanalysis: these are the official ones.

threshold_file_name

threshold_file_name(years: int) -> str

The name ECMWF gives the file of the years-year flood.

threshold_url

threshold_url(years: int) -> str

The public URL of the file of the years-year flood.

read_threshold

read_threshold(path: Path, nodes: Sequence[Node]) -> list[float | None]

The threshold (m³/s) of one file in each node's cell, in the order of nodes.

None for a node outside the file or on a cell that is masked or not positive (sea, no river network). Only the rectangle that contains the nodes is read: the file is the world.

threshold_window

threshold_window(path: Path, longitude: float, latitude: float, *, radius_km: float = 15.0) -> dict[Node, float]

The cells with a threshold around a point, {cell centre: m³/s}.

Every cell of the file whose centre is within radius_km and holds a positive value. What :func:~glofas_ewds.rivers.nearest_river looks for a river in: along a channel the 2-year flow is one or two orders of magnitude above the cells beside it.

flood_thresholds

flood_thresholds(files: Mapping[int, Path], nodes: Sequence[Node]) -> dict[Node, dict[int, float | None]]

{node: {years: m³/s}} from {years: file}.

Each node's value is what :func:~glofas_ewds.return_period.flood_label takes as thresholds.