bolster.data_sources.metoffice
UK Met Office Weather Data and Map Images Integration.
Data Source: The UK Met Office provides weather data and map images through their DataHub API at https://data.hub.api.metoffice.gov.uk/. This module accesses weather forecast data including precipitation, temperature, pressure, and land cover information. The API provides high-resolution weather map images suitable for visualization and analysis applications.
Update Frequency: Weather forecast data is updated multiple times daily, typically every 3-6 hours depending on the forecast model. Map images are generated continuously as new forecast data becomes available. Historical data snapshots are preserved for analysis and comparison purposes.
Example
Generate weather images and access forecast data (requires Met Office DataHub API key):
>>> import os
>>> os.environ['MET_OFFICE_API_KEY'] = 'your-api-key'
>>> os.environ['MAP_IMAGES_ORDER_NAME'] = 'your-order-name'
>>> from bolster.data_sources import metoffice
>>> callable(metoffice.get_uk_precipitation)
True
This module provides utilities for fetching weather data from the Met Office API, processing forecast information, and generating visualization-ready weather map images.
See the Met Office DataHub documentation for API details: https://datahub.metoffice.gov.uk/docs/f/category/map-images/type/map-images/api-documentation
Attributes
Functions
|
Get the latest status for a Met Office data order. |
|
Get metadata for a specific file in a Met Office order. |
|
Download and cache a file from a Met Office order. |
|
Filter order files to find UK precipitation radar data. |
|
Create image borders from Met Office geographic data. |
|
Create weather isolines from Met Office data. |
|
Process precipitation radar data into visualization image. |
|
Generate composite weather visualization from Met Office data. |
|
Get the latest UK precipitation forecast from the Met Office API and generate an image suitable for epaper display. |
Module Contents
- bolster.data_sources.metoffice.BASE_URL = 'https://data.hub.api.metoffice.gov.uk/map-images/1.0.0'[source]
- bolster.data_sources.metoffice.get_order_latest(order_name)[source]
Get the latest status for a Met Office data order.
- bolster.data_sources.metoffice.get_file_meta(order_name, file_id)[source]
Get metadata for a specific file in a Met Office order.
- bolster.data_sources.metoffice.get_file(order_name, file_id)[source]
Download and cache a file from a Met Office order.
- bolster.data_sources.metoffice.filter_relevant_files(order_status)[source]
Filter order files to find UK precipitation radar data.
- bolster.data_sources.metoffice.make_borders(data)[source]
Create image borders from Met Office geographic data.
- bolster.data_sources.metoffice.make_isolines(data)[source]
Create weather isolines from Met Office data.
- bolster.data_sources.metoffice.make_precipitation(data)[source]
Process precipitation radar data into visualization image.