Skip to content

Reference and ratio

glofas_ewds.reference

A node's ordinary high flow, and how far a forecast is above it.

Pure: nothing here does I/O.

A forecast of 300 m³/s means nothing on its own: it is a flood on a torrent and a dry summer on the Po. Dividing by the node's own reference, a high percentile of its multi-year series, makes rivers comparable. Dividing by a regional figure does not: 10 % of the Po is 186 m³/s, more than most rivers ever carry.

percentile

percentile(values: Sequence[float], p: float) -> float | None

The p quantile (0-1) by linear interpolation; None for no values.

references

references(series: Mapping[K, Sequence[float]], *, p: float = 0.9, min_days: int = MIN_REFERENCE_DAYS) -> dict[K, float | None]

The p quantile of each series; None below min_days values.

discharge_ratio

discharge_ratio(peak: float | None, reference: float | None) -> float | None

peak / reference; None when either is unknown or the reference is 0.

None means "I don't know how big this river is", never "the river is low".