Skip to content

ARCO Data Hub (2010 to now)

dpc_radar.arco

The DPC radar archive of the ARCO Data Hub: any frame since 2010, and the last one.

The ARCO Data Hub <https://arcodatahub.com/>_ (Fondazione Bruno Kessler on DPC data, for the IT4LIA AI Factory) keeps the national radar mosaics as Zarr stores that grow every five minutes: the history the DPC API does not give (it keeps about five months) and products it does not publish as open data. :class:ArcoClient reads one frame at a time, as a :class:~dpc_radar.grid.RainGrid:

================ ========================================== ============ name what it is since ================ ========================================== ============ SRI rain intensity, mm/h 2010 SRT1 rain of the last hour, mm July 2018 VMI highest reflectivity in the column, dBZ 2018 CAPPI2-8 reflectivity at 2000 to 8000 m, dBZ 2018 to 2022 VIL liquid water in the column, mm (kg/m²) July 2018 ETM height of the echo top, m July 2018 OPERA VMI of Europe at 2 km, with the DPC's July 2024 ================ ========================================== ============

It is not open like the DPC API: it needs a free account and the subscription to each dataset, and it asks for fair use. The user name and the access key come from ARCODATAHUB_USERNAME and ARCODATAHUB_ACCESS_KEY, or from the arguments. The data are CC BY-SA 4.0: credit «FBK in cooperation with Dipartimento Protezione Civile Nazionale» (and OPERA for OPERA).

It is read here without zarr or xarray: one request for a frame of SRI (a Zarr v2 store, one object per frame), two for the others (Zarr v3, 288 frames in one object: the index at its end, then the bytes of the frame). The codecs come with the extra arco (pip install "dpc-radar[arco]").

What a value means. Three states, as in the rest of the library:

  • a number: measured;
  • NaN: not measured (outside the radars' range, or a frame with a hole), -9999 in the store;
  • no echo: measured, and nothing there (-9998 in the store). It becomes -inf in a reflectivity (0 dBZ is a weak echo, not an absence) and 0 in a height or a quantity of water.

The traps.

  • The time axis is not regular: SRI has a frame every 15 minutes in 2010, every 5 today; SRT1 is hourly until July 2020. Ask :meth:ArcoClient.times which frames exist, never compute them from a step.
  • Before 30 April 2026 (and not in all of 2025) no echo in a reflectivity is written as 0 dBZ, which cannot be told from a weak echo: it stays 0.
  • VIL between August 2019 and October 2025 has no 0.5 bin in some frames: it was merged into 0 when two encodings were made one.
  • SRT1 here is the same frame the DPC API serves as SRT1, pixel by pixel (checked on 30 hours of 2026).
  • OPERA is on another grid (2 km, ETRS89-LAEA) and is reflectivity, not rain: it does not compare with SRI as it is.
  • The frame of a time not yet published, or lost, is None: not an error.

The client keeps the description of a store and its time axis in memory. With cache it also keeps them, and every frame it reads, in a folder: a frame on disk is not asked again.

ArcoDataset dataclass

One store of the hub, and what its frames become.

Store dataclass

What the metadata of a store say: its grid, its layout, its last frame.

frame_key

frame_key(i: int) -> str

The object that holds frame i, under the store.

time_keys

time_keys() -> list[str]

The objects of the time axis, in order.

ArcoClient

The radar stores of the ARCO Data Hub, a frame at a time.

client, send, retries and backoff_s are those of :class:~dpc_radar.client.RadarClient: your own httpx.AsyncClient, or your own HTTP layer, which then does the retrying. The credentials go with every request as HTTP Basic, never in the URL.

aclose async

aclose() -> None

Close the HTTP client if this instance opened it.

store async

store(name: str | ArcoDataset, *, refresh: bool = False) -> Store

The description of a store; read once, and again with refresh.

last async

last(name: str | ArcoDataset) -> datetime

The time of the newest frame of a store, asked again at every call.

times async

times(name: str | ArcoDataset, start: datetime, end: datetime) -> list[datetime]

The times of the frames from start to end, both included.

Only frames already written: nothing after the last one the store knew of when this client read its description (:meth:last reads it again).

frame async

frame(name: str | ArcoDataset, time: datetime) -> RainGrid | None

The frame of time (aware); None if the store has no frame at that time.

frames async

frames(name: str | ArcoDataset, start: datetime, end: datetime, *, limit: int = MAX_FRAMES) -> list[RainGrid]

The frames from start to end, both included, the oldest first.

A frame the store lost is left out. More than limit frames raise before anything is downloaded: the hub asks to be told before a large pull, and a year asked by mistake is 100,000 frames.

dataset

dataset(name: str | ArcoDataset) -> ArcoDataset

The :class:ArcoDataset called name.

parse_store

parse_store(payload: dict[str, Any], name: str | ArcoDataset) -> Store

A :class:Store from the consolidated metadata of a store.

payload is the zarr.json of a Zarr v3 store or the .zmetadata of a v2 one. A layout this module does not read (another codec, frames grouped in another way) raises :class:~dpc_radar.errors.DpcRadarError: better than a frame of noise.

index_range

index_range(store: Store) -> str

The Range of the index at the end of a sharded object.

Sixteen bytes per frame (where it starts, how long it is) and four of checksum.

chunk_range

chunk_range(store: Store, index: bytes, i: int) -> str | None

The Range of frame i inside its object; None if the object does not hold it.

decode_frame

decode_frame(store: Store, raw: bytes) -> np.ndarray

The values of a frame from its compressed bytes: see the module for what they mean.