Skip to content

Commit a003a40

Browse files
committed
Add SYKE hydrology publisher
1 parent 2b8b9ae commit a003a40

10 files changed

Lines changed: 903 additions & 0 deletions

docs/research/finland-publisher-expansion/Finland_Oracle_Service_Deployment_2026-05-31.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ All services use the host-local environment file:
3232
| `digitraffic-weathercam-publisher.service` | `python3 -u -m publishers.digitraffic_weathercam.digitraffic_weathercam_publisher --interval 300` | 5 min |
3333
| `fmi-weather-publisher.service` | `python3 -u -m publishers.fmi_weather.fmi_weather_publisher --interval 600` | 10 min |
3434
| `fmi-air-quality-publisher.service` | `python3 -u -m publishers.fmi_air_quality.fmi_air_quality_publisher --interval 3600` | 1 h |
35+
| `syke-hydrology-publisher.service` | `python3 -u -m publishers.syke_hydrology.syke_hydrology_publisher --interval 900` | 15 min |
3536

3637
Each service is enabled and active under systemd.
3738

@@ -47,6 +48,7 @@ Observed first service-managed cycles in `journalctl`:
4748
| Digitraffic Weathercam | 6 cameras connected and published, 0 visible errors |
4849
| FMI Weather | 6 stations connected and published, 0 visible errors |
4950
| FMI Air Quality | 6 stations connected and published, 0 visible errors |
51+
| SYKE Hydrology | 4 stations connected, 7 readings published, 0 errors |
5052

5153
## Public Verification
5254

@@ -60,3 +62,4 @@ Verified through `https://ogc-csapi-explorer.pages.dev/api/osh` that fresh obser
6062
| Digitraffic Weathercam | `078g2` | `2026-05-31T05:15:49Z` |
6163
| FMI Weather | `07bg2` | `2026-05-31T05:20:00Z` |
6264
| FMI Air Quality | `07eg2` | `2026-05-31T05:00:00Z` |
65+
| SYKE Hydrology | `07ig2` | `2026-05-31T00:00:00Z` |
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# Finland SYKE Hydrology Live Smoke 2026-05-31
2+
3+
## Scope
4+
5+
Implemented and deployed the Phase 6 SYKE / vesi.fi hydrology publisher for Finland.
6+
7+
Source endpoints:
8+
9+
```text
10+
https://rajapinnat.ymparisto.fi/api/Hydrologiarajapinta/1.0/odata/Paikka
11+
https://rajapinnat.ymparisto.fi/api/Hydrologiarajapinta/1.0/odata/Vedenkorkeus
12+
https://rajapinnat.ymparisto.fi/api/Hydrologiarajapinta/1.0/odata/Virtaama
13+
```
14+
15+
No API key is required.
16+
17+
## Curated Stations
18+
19+
| Station | Name | Measures |
20+
| --- | --- | --- |
21+
| `0400520` | Jongunjoki, Viitakoski | water level, discharge |
22+
| `0406010` | Sonkajärvi | water level, discharge |
23+
| `0407410` | Keyritty | water level, discharge |
24+
| `1403900` | Konnevesi - luusua | discharge |
25+
26+
SYKE uses measure-specific `Paikka_Id` values. The publisher groups those readings into station systems by shared physical station notation.
27+
28+
## Local Verification
29+
30+
Command:
31+
32+
```text
33+
py -3 -m publishers.syke_hydrology.syke_hydrology_publisher --dry-run --once
34+
```
35+
36+
Result:
37+
38+
```text
39+
0400520/sykeWaterLevel: water_level_cm=195.0 cm
40+
0400520/sykeDischarge: discharge_m3s=23.0 m3/s
41+
0406010/sykeWaterLevel: water_level_cm=244.0 cm
42+
0406010/sykeDischarge: discharge_m3s=28.0 m3/s
43+
0407410/sykeWaterLevel: water_level_cm=61.0 cm
44+
0407410/sykeDischarge: discharge_m3s=7.73 m3/s
45+
1403900/sykeDischarge: discharge_m3s=37.5 m3/s
46+
Seen: 7
47+
Errors: 0
48+
```
49+
50+
## Live Bootstrap
51+
52+
Bootstrap command on Oracle host:
53+
54+
```text
55+
python3 -m publishers.syke_hydrology.bootstrap_syke_hydrology --force-sml
56+
```
57+
58+
Created resources:
59+
60+
| Resource | ID |
61+
| --- | --- |
62+
| Procedure `urn:os4csapi:procedure:syke-hydrology:v1` | `04jg` |
63+
| System `urn:os4csapi:system:syke-hydrology:0400520:v1` | `06802` |
64+
| System `urn:os4csapi:system:syke-hydrology:0406010:v1` | `068g2` |
65+
| System `urn:os4csapi:system:syke-hydrology:0407410:v1` | `06902` |
66+
| System `urn:os4csapi:system:syke-hydrology:1403900:v1` | `069g2` |
67+
| Datastream `0400520/sykeWaterLevel` | `07ig2` |
68+
| Datastream `0400520/sykeDischarge` | `07j02` |
69+
| Datastream `0406010/sykeWaterLevel` | `07jg2` |
70+
| Datastream `0406010/sykeDischarge` | `07k02` |
71+
| Datastream `0407410/sykeWaterLevel` | `07kg2` |
72+
| Datastream `0407410/sykeDischarge` | `07l02` |
73+
| Datastream `1403900/sykeDischarge` | `07lg2` |
74+
| Root deployment `urn:os4csapi:deployment:syke-hydrology-demo:v1` | `06k02` |
75+
| Group deployment `urn:os4csapi:deployment:syke-hydrology-stations:v1` | `06kg2` |
76+
77+
SensorHub returned HTTP 500 during system create / SensorML PUT for each station, matching the known SensorHub persistence quirk. The bootstrap recovered the persisted system IDs and datastreams were created successfully.
78+
79+
## Live Publish
80+
81+
One manual publish cycle on the Oracle host succeeded:
82+
83+
```text
84+
Ready: 4/4 stations connected
85+
0400520/sykeWaterLevel: OK water_level_cm=195.0 cm
86+
0400520/sykeDischarge: OK discharge_m3s=23.0 m3/s
87+
0406010/sykeWaterLevel: OK water_level_cm=244.0 cm
88+
0406010/sykeDischarge: OK discharge_m3s=28.0 m3/s
89+
0407410/sykeWaterLevel: OK water_level_cm=61.0 cm
90+
0407410/sykeDischarge: OK discharge_m3s=7.73 m3/s
91+
1403900/sykeDischarge: OK discharge_m3s=37.5 m3/s
92+
Published: 7
93+
Errors: 0
94+
```
95+
96+
Persistent service installed and started:
97+
98+
```text
99+
syke-hydrology-publisher.service
100+
```
101+
102+
Service log verification:
103+
104+
```text
105+
Active: active (running)
106+
Ready: 4/4 stations connected
107+
Cycle #1 published all 7 readings with 0 errors
108+
```
109+
110+
## Public Proxy Verification
111+
112+
Verified through:
113+
114+
```text
115+
https://ogc-csapi-explorer.pages.dev/api/osh
116+
```
117+
118+
Representative observation:
119+
120+
| Field | Value |
121+
| --- | --- |
122+
| System ID | `06802` |
123+
| System name | `SYKE Hydrology Jongunjoki, Viitakoski` |
124+
| Datastream ID | `07ig2` |
125+
| Datastream output | `sykeWaterLevel` |
126+
| Station | `0400520` |
127+
| Phenomenon time | `2026-05-31T00:00:00Z` |
128+
| Result time | `2026-05-31T08:39:07Z` |
129+
| Water level | `195 cm` |
130+
| SYKE flag | `108` |
131+
132+
## Notes
133+
134+
The publisher uses current same-day Finnish hydrology readings and a 15-minute cadence. Station SensorML includes a real representative water-level gauge photograph plus source links to SYKE / vesi.fi and each exact OData latest-reading query.

publishers/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ server (e.g. [OpenSensorHub](https://opensensorhub.org/)).
2929
| **Digitraffic Weathercam** | Finnish Fintraffic/Digitraffic road-camera image references | 5 min |
3030
| **FMI Weather** | Finnish Meteorological Institute weather observations | 10 min |
3131
| **FMI Air Quality** | Finnish Meteorological Institute air-quality observations | 1 h |
32+
| **SYKE Hydrology** | Finnish Environment Institute water level and discharge readings | 15 min |
3233

3334
## Quick Start
3435

@@ -77,6 +78,7 @@ python -m publishers.digitraffic_road_weather.bootstrap_digitraffic_road_weather
7778
python -m publishers.digitraffic_weathercam.bootstrap_digitraffic_weathercam
7879
python -m publishers.fmi_weather.bootstrap_fmi_weather
7980
python -m publishers.fmi_air_quality.bootstrap_fmi_air_quality
81+
python -m publishers.syke_hydrology.bootstrap_syke_hydrology
8082
python -m publishers.iss.bootstrap_iss
8183
```
8284

@@ -172,4 +174,6 @@ python -m publishers.nws.nws_publisher --interval 3600
172174
thumbnail URLs for road camera presets.
173175
- **Digitraffic Rail Trains** publishes live Finnish train positions from the
174176
public Digitraffic Rail latest-location JSON endpoint.
177+
- **SYKE Hydrology** publishes curated Finnish water level and discharge readings
178+
from the public SYKE Hydrologiarajapinta OData API.
175179
- All publishers use `--interval <seconds>` and `--dry-run` CLI flags.

publishers/docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,17 @@ services:
170170
<<: *osh-env
171171
command: ["--interval", "300"]
172172

173+
# ── SYKE Hydrology (15min cadence) ──
174+
syke-hydrology:
175+
build:
176+
context: ..
177+
dockerfile: publishers/syke_hydrology/Dockerfile
178+
restart: always
179+
environment:
180+
<<: *osh-env
181+
SYKE_HYDROLOGY_REQUEST_DELAY: ${SYKE_HYDROLOGY_REQUEST_DELAY:-0.5}
182+
command: ["--interval", "900"]
183+
173184
# ── USGS Earthquake Feed (60s cadence) ──
174185
usgs-eq:
175186
build:
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM python:3.12-slim
2+
3+
WORKDIR /app
4+
5+
COPY publishers/ /app/publishers/
6+
7+
ENV OSH_ADDRESS=
8+
ENV OSH_PORT=443
9+
ENV OSH_USER=
10+
ENV OSH_PASS=
11+
12+
ENTRYPOINT ["python", "-m", "publishers.syke_hydrology.syke_hydrology_publisher"]
13+
CMD ["--interval", "900"]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SYKE Hydrology Publisher
2+
3+
Publishes curated Finnish hydrology observations from the public SYKE Hydrologiarajapinta OData API.
4+
5+
## Source Endpoints
6+
7+
- OData base: `https://rajapinnat.ymparisto.fi/api/Hydrologiarajapinta/1.0/odata`
8+
- Stations: `Paikka`
9+
- Water level: `Vedenkorkeus`
10+
- Discharge: `Virtaama`
11+
12+
No API key is required.
13+
14+
## Commands
15+
16+
```bash
17+
python -m publishers.syke_hydrology.bootstrap_syke_hydrology --dry-run --force-sml
18+
python -m publishers.syke_hydrology.syke_hydrology_publisher --dry-run --once
19+
python -m publishers.syke_hydrology.syke_hydrology_publisher --interval 900
20+
```
21+
22+
The station set in `stations.json` intentionally stays small and Finnish-focused: selected stations have same-day readings and clean coordinates.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""SYKE / vesi.fi hydrology publisher package."""

0 commit comments

Comments
 (0)