Event reports¶
dpc-radar report writes the report of a day of rain over a box: the
figures as data, a text that only quotes them, and two images.
pip install "dpc-radar[report]"
dpc-radar report --bbox 15.5,37.85,16.2,38.3 --day 2026-10-10 --out melito
# melito/facts.json melito/report.md melito/map.png melito/hourly.png
The frames come from the API (the last five months: 33 requests) or, with
--archive folder, from an archive kept with
dpc_radar.archive. --no-bulletin skips the official alert,
--no-images the images.
One day: Melito di Porto Salvo, 10 October 2026¶
The command above, on an archive kept since September 2026. These are the images it wrote, and part of its text.

The «Merging» (radar corrected with the rain gauges: the sum of 8 CUM3 frames out of 8). The maximum is 206.7 mm, at 15.785° E, 37.925° N. Over the box the mean is 73.9 mm and the median 65.2 mm. Of the box, 3094.8 km² got 20 mm or more, 2434.6 km² got 50 mm or more, 567.6 km² got 100 mm or more, 1.0 km² got 200 mm or more.
The radar alone (no rain gauges: the sum of 24 SRT1 frames out of 24). The maximum is 176.4 mm, at 16.1096° E, 37.9053° N. […]
At 15.785° E, 37.925° N, read as the median of the nine pixels around it: the «Merging» gives 190.8 mm in the day; the radar alone gives 115.1 mm.
Hours Radar rain Ended at Return period 1 21.2 mm 02:00 about 2 years (between 2 and 5) 3 49.8 mm 04:00 about 7 years (between 3 and 15) 6 88.9 mm 06:00 about 31 years (between 10 and 50) 24 114.6 mm 00:00 about 42 years (between 14 and 50) How far to trust the radar there: its reliability is 0.9 on a scale from zero to one, so a radar reading can be taken at face value. The nearest radar is Catania Fontanarossa, 82.4 km away.
The bulletin issued on 9 October 2026 at 16:15 (Italian time) put the wettest place, in the zone «Versante Jonico Meridionale», at level orange for 10 October 2026 (hydrogeological risk: orange; hydraulic: orange; thunderstorms: orange).

The whole of its figures is in facts.json.
Over the whole box the radar alone and the «Merging» agree (the ratio of the
two means is 1.01); at the place where it rained most the radar alone read
115 mm where the «Merging» has 191.
The text cannot invent a number¶
The text is written from a template, with no language model. Before anything
is saved it is read back: every number in it must be one of the figures of
facts.json, to the decimals it is written with ("191.8" matches 191.84,
"190" does not). Product names (CUM3) are not numbers, and dates and times
are matched against the times in the facts.
The same check is there for a text written by someone else, a language model included:
dpc-radar report --bbox … --day … --out melito --text mine.md # saved only if it passes
dpc-radar check melito/report.md melito/facts.json
# numbers that are not in the facts: 250
from dpc_radar.report import check_text
check_text("It rained 250 mm.", report.facts) # ["250"]: the numbers that are not there
A number said of the wrong thing¶
check_text knows that a number exists in the facts, not what it is said
of: "the radar alone read 206.7 mm" passes, because 206.7 is there, as the
maximum of the «Merging». check_claims reads the sentences of the template
and ties each number to its fact: the totals of each product, the wettest
place and its hours, the reliability, the hourly table, the frames. Two
figures swapped between the «Merging» and the radar alone, or one rounded
the wrong way, are refused, by save and by dpc-radar check alike:
from dpc_radar.report import check_claims
check_claims("the «Merging» gives 115.1 mm in the day", report.facts)
# [Misquote(said='the «Merging» gives 115.1 mm in the day', key='peak.merging_mm', fact=190.8)]
dpc-radar check mine.md melito/facts.json
# numbers said of the wrong fact:
# «the «Merging» gives 115.1 mm in the day»: peak.merging_mm is 190.8
What the checks do not do. check_claims reads the template's own
sentences: a model that writes in other words gets check_text only, and a
swap in its sentences passes. Small whole numbers nearly always pass
check_text (the facts hold a 2, a 3 and a 10 somewhere), and neither reads
words ("twice as much", "a record"). A text from a model still needs a
reader. How often a model quotes the facts faithfully is measured in
benchmarks/faithful.py:
on its hand-written answers with known faults, check_text lets through 8
of 17 wrong numbers, all of them swapped. Claude Opus 5.5, asked the same
five questions, quoted 111 numbers and got 110 right; the one left is a 95th
percentile read as "the wettest 5 %".
check_text reads numbers as a model writes them: "3,510" is one number,
and "99.99th" is 99.99 (dpc_radar.report.numbers).
What is in the facts¶
event: the day (a UTC day), the box, the times.frames: for the radar alone and the «Merging», the frames expected, used, missing and rejected, and how many pixel readings were masked. With a frame missing or rejected the total is marked notcomplete, and the text says "at least".radar,merging: over the box, the maximum and its place, mean, median, 95th percentile, km² over 20, 50, 100 and 200 mm.hourly: the radar alone for each hour: maximum, mean, km² at 10 mm or more.peak: the wettest place (the maximum of the «Merging», or of the radar when there is none), read as the median of 3×3 pixels: both totals, the radar rain of each hour, the wettest 1, 3, 6 and 24 hours and their return period, the reliability of the radar there.bulletins: the level the official bulletin gave to that place for that day, from the bulletin of the day and of the day before.
Each SRT1 frame is checked against the hour before it, and each CUM3
against the radar of its three hours (a rain gauge gone wrong), with
quality. The two totals are on two grids, each over the
rectangle of its own pixels that holds the box, so their areas differ a
little.
What is not there. The report is one UTC day: a storm across midnight is two reports. There are no rain gauges of their own (the DPC does not publish them), no rivers, no damage. The return periods are in radar millimetres, from eight years. And it is a reading of radar data: the official account of an event is that of the Civil Protection.
dpc_radar.report ¶
The report of a day of rain over a box: facts first, then a text that only quotes them.
dpc-radar report --bbox W,S,E,N --day YYYY-MM-DD --out folder writes four
files: facts.json (every figure, with the frames it came from),
report.md (the text), map.png (the radar alone next to the «Merging»)
and hourly.png (the rain at the wettest place, hour by hour). From Python::
from dpc_radar.archive import MergingArchive
from dpc_radar.report import build
report = build(MergingArchive(folder).read, (15.5, 37.8, 16.2, 38.3), date(2026, 10, 10))
report.facts["peak"] # where, how much, how rare
report.save(Path("melito"))
What is in the facts. The day is a UTC day. The radar alone is the sum of
its 24 hourly SRT1 frames, each checked against the hour before it
(:meth:dpc_radar.RainGrid.quality); the «Merging» is the sum of the eight
CUM3 frames of the day, each checked against the radar of its three hours
(a gauge gone wrong). A frame that is missing or rejected is listed, and the
total is then "at least". At the wettest place (the maximum of the «Merging»,
or of the radar when there is none): both totals, the wettest 1, 3, 6 and 24
hours of radar rain and how rare they are there (:func:dpc_radar.rarity),
how far the radar can be trusted (:func:dpc_radar.reliability), and the
level the official bulletin gave to that place for that day.
The text never holds a number that is not in the facts. It is written from
a template, with no language model, and before anything is saved
:func:check_text reads it back: every number in it must be one of the
figures of facts.json, to the decimals it is written with. The same check
is there for a text written by someone else, a model included
(report.save(folder, text=...), or dpc-radar check report.md
facts.json): a text with a number of its own is refused. That check knows
that a number exists, not what it is said of; :func:check_claims reads the
sentences of the template and ties each number to its fact, so two figures
swapped between the «Merging» and the radar alone are refused too. A sentence
in other words gets only the first check.
The frames come from a local archive (:class:dpc_radar.archive.MergingArchive)
or, for the last five months, from the API (:func:download). The images need
matplotlib: pip install "dpc-radar[report]".
Report
dataclass
¶
The facts of a day of rain, and the two totals they were read from.
radar and merging are the rain of the day over the box, each on
its own grid (None when no frame of it could be used).
save ¶
save(folder: Path, *, text: str | None = None, images: bool = True) -> list[Path]
Write facts.json, report.md and the two images; the paths written.
text replaces the text of the template: it goes through
:func:check_text and :func:check_claims, and a number that is not
in the facts, or that is said of a fact that holds another, is a
:class:DpcRadarError with nothing written.
Misquote
dataclass
¶
A number said of a fact that holds another one.
said is the piece of the text, key the fact it speaks of (a path
into facts.json: peak.merging_mm, hourly[03:00].max_mm), and
fact what the facts hold there (None when nothing).
hours_of ¶
hours_of(day: date) -> list[datetime]
The 24 hours that end inside a UTC day: 01:00, 02:00 … 00:00 of the next.
check_text ¶
check_text(text: str, facts: dict[str, Any]) -> list[str]
The numbers of text that are not in facts, as written (empty: all found).
A number of the text is found when a figure of the facts, rounded to the
decimals the text uses, is that number: 192 and 191.8 both match
191.84, 190 does not. Times and dates count by their parts (03:00
on 10 October 2026 matches 2026-10-10T03:00Z). Digits inside a
word (CUM3) are not numbers.
numbers ¶
numbers(text: str) -> list[str]
The numbers of a text, as written and in order.
3,510 is one number (a comma between groups of three digits is a
thousands separator), 99.99th is 99.99, 03:00 is two numbers, and
digits inside a word (CUM3) are not a number.
check_claims ¶
check_claims(text: str, facts: dict[str, Any]) -> list[Misquote]
The numbers of text said of the wrong fact (empty: none found).
:func:check_text asks whether a number is in the facts; this asks
whether it is the number of what the sentence says. It reads the
sentences of the template (:meth:Report.text): the totals of each
product, the wettest place, its hours, the reliability, the hourly table,
the frames. "The «Merging» gives 95.2 mm" where the facts give 95.2 mm to
the radar alone is a misquote, and so is a figure rounded the wrong way
("118.1" for 118.04). A sentence written in other words is not read: a
model that rephrases goes through :func:check_text only.
build ¶
build(read: Read, bbox: BBox, day: date, *, bulletins: Iterable[Bulletin] = ()) -> Report
The report of the rain of day (UTC) over bbox, from the frames read gives.
bulletins: the criticality bulletins to look the wettest place up in
(:func:bulletins_for); those that do not cover the day are left out.
download
async
¶
download(radar: Source, day: date) -> Read
The frames of a day from the API, as a read for :func:build.
33 requests: the 25 hourly SRT1 frames (the hour before the day
included) and the eight CUM3. A frame the DPC no longer keeps (older
than about five months) is simply not there.
bulletins_for
async
¶
bulletins_for(day: date, **http: Any) -> list[Bulletin]
The bulletins that speak of day: the last one of the day before, and of the day.
http: client or send, as in :func:dpc_radar.bulletins.fetch.