Skip to content

Radar status

Which radars the DPC viewer shows as on, at a time. Use it to explain why a place has no data; do not use it to say that the data are good.

from dpc_radar import RadarClient

async with RadarClient() as radar:
    status = await radar.radar_status()  # the newest, or radar_status(time)
    if status:  # ABSENT: not known
        print(status.time, [r.code for r in status.off])
        print(status.of("Monte Lauro"))  # True, False, or None: not in the file
dpc-radar sites                          # a table, now
dpc-radar sites --time 2026-11-17T12:00  # at a time (UTC), for about two weeks back
dpc-radar sites --out sites.geojson      # as GeoJSON

Read this before you rely on it.

  • The file is the one the DPC radar viewer reads. It is public, but it is not documented, it has no licence, and its address may change without notice. When it is not there, the answer is ABSENT: not known.
  • It is a hint. On 17 November 2026 the two radars reported off in the south (Monte Lauro, Monte Pettinascura) were indeed missing from the mosaic. But Milano Linate was reported off for two weeks while the mosaic had data over its whole circle, and Catania was reported on while its circle had none.
  • It names three radars that are not in SITES (Reggio Calabria, Desio, Flero): nothing in the mosaic shows that they feed it. They are listed with site empty. Salento is in SITES and not in the file.
  • Its positions are rounded and some altitudes differ from those of SITES, which are kept: RadarStatus.site links the two through RadarSite.code.
  • Files are kept for about two weeks, one every five minutes.

dpc_radar.status

Which radars are on: the status file behind the DPC's own viewer.

The mosaic is made of some two dozen radars, and at any hour a few are off. Where the only radar that covers a place is off, the mosaic has no data there while it may be raining. The viewer of the DPC (radar.protezionecivile.gov.it) draws the radars as green and red dots; it reads them from a small GeoJSON file, one every five minutes, kept for about two weeks. This module reads the same file::

async with RadarClient() as radar:
    status = await radar.radar_status()
    [r.code for r in status.off]

Pure: nothing here does I/O. :meth:dpc_radar.RadarClient.radar_status sends the request built by :func:status_url and hands the answer to :func:parse_status.

What to know before trusting it:

  • The file is not part of the documented open data. It has no licence and no promise: its address or its shape can change without notice. When it cannot be read the client answers :data:dpc_radar.ABSENT, and nothing else in the library depends on it.
  • The time is the one asked for. The time inside the file is stale (in November 2026 it still said November 2025) and is ignored.
  • "On" is what the DPC reports, not what the mosaic holds. On 17 November 2026 Linate was reported off for two weeks while its whole circle had data, and Catania was reported on while its circle had none. Monte Lauro and Monte Pettinascura, reported off, were indeed missing. Read on as a hint to why a place has no data, never as proof that it has.
  • The file lists three radars that are not in :data:dpc_radar.SITES (Reggio Calabria, Desio and Flero): no trace of them was found in the mosaic. Their site is None. Salento is in SITES and not in the file.

RadarStatus dataclass

One radar as the status file has it.

NetworkStatus dataclass

The radars of the network at a time, on and off.

off property

off: tuple[RadarStatus, ...]

The radars reported off.

of

of(site: RadarSite | str) -> bool | None

Is a radar on? By its site, its name in SITES or its DPC code.

None if the file does not list it: not known, which is not "off".

geojson

geojson() -> dict[str, Any]

The status as a GeoJSON FeatureCollection of points (WGS84).

status_time

status_time(time: datetime) -> datetime

The time of the file that covers time (aware): the five minutes it falls in.

status_url

status_url(time: datetime, *, base: str = STATUS_BASE) -> str

The address of the status file of time (aware).

parse_status

parse_status(payload: dict[str, Any], time: datetime) -> NetworkStatus

The status in a file; :class:DpcRadarError if it is not the file we know.

The file is the head of a table and repeats the radars: the first row of each is kept (the repeated rows were never seen to disagree).