Skip to content

Commit 8a0b604

Browse files
committed
Expose Met Office publisher refresh intervals
1 parent f43d1c7 commit 8a0b604

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

publishers/met_office_datahub/bootstrap_met_office_datahub.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
LAND_OBS_PRICING = "https://datahub.metoffice.gov.uk/pricing/observations"
3434
LAND_OBS_API_CONTEXT = "/observation-land/1"
3535
LAND_OBS_BASE_URL = "https://data.hub.api.metoffice.gov.uk/observation-land/1"
36+
PUBLISH_INTERVAL_SECONDS = 3600
3637

3738

3839
def _load_config() -> dict:
@@ -208,6 +209,27 @@ def _system_sml(station: dict) -> dict:
208209
{"type": "Text", "name": "selection_reason", "label": "Selection Reason", "value": station.get("selectionReason", "Curated demo location")},
209210
{"type": "Text", "name": "free_plan_limit", "label": "Free Plan Limit", "value": "360 calls per day"},
210211
]}],
212+
"capabilities": [{
213+
"definition": "http://www.w3.org/ns/ssn/systems/SystemCapability",
214+
"label": "Publisher Capabilities",
215+
"capabilities": [
216+
{
217+
"type": "Quantity",
218+
"name": "publish_interval",
219+
"definition": "http://qudt.org/vocab/quantitykind/Period",
220+
"label": "Publish Interval",
221+
"uom": {"code": "s"},
222+
"value": PUBLISH_INTERVAL_SECONDS,
223+
},
224+
{
225+
"type": "Text",
226+
"name": "source_reporting_cadence",
227+
"definition": "http://sensorml.com/ont/swe/property/ReportingFrequency",
228+
"label": "Source Reporting Cadence",
229+
"value": "Hourly land observations from Met Office Weather DataHub",
230+
},
231+
],
232+
}],
211233
"position": {
212234
"type": "Point",
213235
"coordinates": [station["lon"], station["lat"]],

publishers/met_office_global_spot/bootstrap_met_office_global_spot.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
GLOBAL_SPOT_API_CONTEXT = "/sitespecific/v0"
3434
GLOBAL_SPOT_BASE_URL = "https://data.hub.api.metoffice.gov.uk/sitespecific/v0"
3535
GLOBAL_SPOT_DEFAULT_HOURLY_PATH = "/point/hourly"
36+
PUBLISH_INTERVAL_SECONDS = 3600
3637
GLOBAL_SPOT_THUMBNAIL_DATA_URI = (
3738
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 200'%3E"
3839
"%3Crect width='320' height='200' fill='%23082f49'/%3E"
@@ -205,6 +206,27 @@ def _system_sml(location: dict) -> dict:
205206
{"type": "Text", "name": "selection_reason", "label": "Selection Reason", "value": location.get("selectionReason", "Curated demo forecast point")},
206207
{"type": "Text", "name": "free_plan_limit", "label": "Free Plan Limit", "value": "360 calls per day"},
207208
]}],
209+
"capabilities": [{
210+
"definition": "http://www.w3.org/ns/ssn/systems/SystemCapability",
211+
"label": "Publisher Capabilities",
212+
"capabilities": [
213+
{
214+
"type": "Quantity",
215+
"name": "publish_interval",
216+
"definition": "http://qudt.org/vocab/quantitykind/Period",
217+
"label": "Publish Interval",
218+
"uom": {"code": "s"},
219+
"value": PUBLISH_INTERVAL_SECONDS,
220+
},
221+
{
222+
"type": "Text",
223+
"name": "source_forecast_cadence",
224+
"definition": "http://sensorml.com/ont/swe/property/ReportingFrequency",
225+
"label": "Source Forecast Cadence",
226+
"value": "Hourly deterministic forecasts from Met Office Global Spot",
227+
},
228+
],
229+
}],
208230
"position": {
209231
"type": "Point",
210232
"coordinates": [location["lon"], location["lat"]],

0 commit comments

Comments
 (0)