Trust¶
glofas_ewds.trust ¶
How far the discharge of a node can be trusted, before you look at it.
Pure: nothing here does I/O.
GloFAS is a model of the rivers of the world on 0.05° cells (about 5 km), fed with rain on a much coarser grid, and what it gives is the mean of a day. Two things follow, and neither raises an error:
- A cell is not a river. The river of a place is in one of the cells around it, and a small stream is in none: the model has no channel there.
- A day is not a flood. A flood that rises and falls in six hours on a basin of a few hundred km² is a small bump in a daily mean, when the rain that caused it is in the model at all.
:func:trust turns what is known about a node (its river cell, from
:func:~glofas_ewds.rivers.nearest_river) into a level and its reasons. The
levels are by the size of the river: the official 2-year flow of its cell.
:data:KNOWN_FLOODS is the record behind them: 41 Italian floods since 1997,
and whether GloFAS reached its own 2-year level on the days of the flood
(benchmarks/floods.py, checked in CI; the benchmark fails if these numbers
and its results differ). It is a record of the reanalysis: what the model
holds of each flood once the weather is known, not what was forecast before.
What this cannot see: dams and diversions (the Tiber and the Adige are held back upstream, and the model's thresholds are not), and a levee that breaks. A level is about the model, not about the danger.
Trust
dataclass
¶
How far to trust the discharge of a node.
size_class ¶
size_class(size: float | None) -> str
large, medium, small or none for a 2-year flow in m³/s.
trust ¶
trust(river: River | None) -> Trust
The trust of a node whose river is river (None: no river found).
The level is the size of the river; a river cell more than
:data:FAR_KM from the place is never better than fair.