MEDUSA

About MEDUSA

AI digital twins for every water-level gauge, and the whole network checked every hour.

How a gauge is checked

Every gauge has its own AI digital twins. Each twin rebuilds the gauge's water level from other gauges: the ones that tell most about it, near or far. Every hour MEDUSA fetches the newest readings, runs every twin and holds the gauge's own reading up against its twins. The lowest and highest twin span the twins' range. Each gauge has its own tolerance, set by how closely its twins follow it, and a usual spread: how far its readings normally stray from the twins in recent weeks.

Each twin waits for the gauges it reads. Some gauges publish only once a day, so a gauge's newest verdict can be hours old; each page shows its age. The last 50 hours are checked again every hour, so late readings are taken in as they arrive.

A flag shows exactly where to look. A sensor fault or drift moves one gauge away from its twins. Rain, a dam release, ice or a regulated lake can move many gauges at once. Each gauge's page shows the verdicts of its input gauges side by side, so a local fault stands out from a shared event.

Open data

Everything the pages show is open, per country, at data.hydromedusa.fi/<country>/ (Norway: data.hydromedusa.fi/no/, an index of every file). Times are UTC, levels in cm. Files are rewritten every hour; 13 weeks are kept.

AddressWhat it holds
status.jsonthe newest hourly run: hour, result, stations, time taken
latest.jsonthe newest verdict of every gauge, with its time, reading and the twins' median
meta.jsonevery gauge: name, river, position, tolerance, its twins and the gauges they read
summary.jsonthe last 7 days: gauges flagged per hour, and per gauge
sim/<week>.parquetper gauge and 15-minute step: reading, twins' median and range, usual spread, verdict
obs/<week>.parquetthe readings as fetched from the provider
api/station/<id>?days=7one gauge's series as JSON (up to 91 days)

Verdict codes: 0 not simulated1 no reading 2 fine3 slight 4 strong

The fields

FieldMeaning
t / timethe 15-minute step; in the station API milliseconds since 1970 (UTC), in the files a UTC time
observedthe gauge's reading, cm
median / ensemble_medianthe middle of the twins, cm
band_lo, band_hi (lo, hi in latest.json)the twins' range: the lowest and highest twin, cm
qr_lo, qr_hithe gauge's usual spread: how far its readings normally stray from its twins, low and high edge, cm
statethe verdict code (below)
tolerance_cm (meta.json)the gauge's tolerance, cm, set by how closely its twins follow it

Each gauge's page also offers the period it shows as a CSV with plain column names (measured_cm, range_low_cm, spread_5_cm, verdict, …): "CSV of this period" at the bottom of the page.

From a script

Any HTTP client works: no key, no sign-up. The files change once an hour; to follow them, ask for status.json and send its ETag back as If-None-Match (or its Last-Modified as If-Modified-Since): a file that has not changed answers 304 with no body.

Every field of every file, for scripts: schema.json.

import io, requests, pandas as pd

base = "https://data.hydromedusa.fi/no"
s = requests.Session(); s.headers["User-Agent"] = "my-gauge-check/1.0"

latest = s.get(f"{base}/latest.json").json()            # the newest verdict of every gauge
t_end = pd.Timestamp(s.get(f"{base}/status.json").json()["t_end"])
week = pd.read_parquet(io.BytesIO(s.get(f"{base}/sim/{t_end:%G-W%V}.parquet").content))
one = s.get(f"{base}/api/station/109.21.0", params={"days": 7}).json()
curl -s https://data.hydromedusa.fi/no/latest.json