Facts¶
rainfall_thresholds.facts ¶
The same answers as data: what a tool, a report or a model can quote.
Every function returns a plain dict (JSON-ready) with the numbers, their
units in the key names (_mm, _mm_h, _h, _decades), where the
threshold comes from, and the rule that goes with every answer:
A threshold exceeded is not an alert.
A language model may word these facts; it never computes them. The numbers
come from here, and :func:rainfall_thresholds.check.check_text checks a text
against them.
resolve ¶
resolve(region: str) -> str
"italy", a macroregion, or an Italian region name -> the key of ITALICA_T5.
threshold_facts ¶
threshold_facts(region: str, duration_h: float) -> dict[str, Any]
The rain the Italian T5 threshold asks for over duration_h hours.
assess_facts ¶
assess_facts(series: Iterable[tuple[datetime, float | None]], region: str, *, source: str | None = None, no_rain_break_hours: int = 6, min_event_mm: float = 2.0) -> dict[str, Any]
The rainfall events of an hourly series, and where the strongest stands.
None in the series is an hour not measured. source says where the
rain comes from; the thresholds are fitted on rain gauges, so rain from a
radar or a model is flagged.
fit_facts ¶
fit_facts(events: Iterable[tuple[float, float]], *, percentile: float = 5.0) -> dict[str, Any]
A threshold fitted on (duration_h, total_mm) of landslide-triggering rain.