Return periods¶
glofas_ewds.return_period ¶
Return levels of a river from its own GloFAS history: the 2-, 5-, 20-year flow.
Pure: nothing here does I/O.
The EWDS does not serve GloFAS's flood thresholds, and the 90th percentile of
two years (:func:~glofas_ewds.reference.references) is "an ordinary high
flow", not "a flood that comes once in five years". This module fits a Gumbel
distribution to the annual maxima of a node's reanalysis, by L-moments,
and reads the levels off it.
Two cautions. These are not the official GloFAS thresholds: same family
of method, but your years, your cells, your fit. And a fit needs decades: the
reanalysis starts in 1979, and fewer than min_years complete years give
None.
annual_maxima ¶
annual_maxima(by_day: Mapping[date, float], *, min_days: int = MIN_DAYS_PER_YEAR) -> dict[int, float]
The highest value of each calendar year with at least min_days values.
by_day is one node of :func:~glofas_ewds.glofas.discharge_by_day.
gumbel_fit ¶
gumbel_fit(maxima: ArrayLike) -> tuple[float, float]
Location and scale of a Gumbel, by L-moments (Hosking 1990).
Needs at least two values.
return_level ¶
return_level(location: float, scale: float, years: float) -> float
The flow exceeded on average once every years years.
return_levels ¶
return_levels(maxima: Iterable[float], *, periods: Sequence[float] = RETURN_PERIODS, min_years: int = MIN_YEARS) -> dict[float, float] | None
{period: level} from a node's annual maxima; None below min_years
or when the maxima do not vary (a dry cell).