Skip to main content

Python package to download open data from KMI

Project description

OpenKMI

Python package to download open data (observations and forecasts) from KMI.

# example to get the windspeed for Stabroek starting from 2021 - present
from openkmi.point_obs import Synop
kmi = Synop()
df = kmi.get_data('6438', start_date='2021-01-01T00:00:00', parameter_list=['wind_speed'])

Description

OpenKMI serves as a simple wrapper around the open data that the Royal Meteorological Institute of Belgium (RMI) offers. At present following data is implemented:

  • Synoptic observations
  • Automatic weather stations (AWS)
  • ALARO forecasts

The package facilitates fetching data from the existing WFS and WMS services to download this data.

This is not an official package from the RMI.

Synoptic observations

The SYNOP data of RMI contain the observations of the synoptic network (22 stations) for the following parameters:

  1. Precipitation: PRECIP_QUANTITY + PRECIP_RANGE
  2. Temperature: TEMP + TEMP_MIN + TEMP_MAX + TEMP_GRASS_MIN
  3. Wind: WIND_SPEED + WIND_SPEED_UNIT + WIND_DIRECTION + WIND_PEAK_SPEED
  4. relative humidity: HUMIDITY_RELATIVE
  5. weather type: current weather
  6. air pressure: PRESSURE of PRESSURE_STATION_LEVEL
  7. sunshine duration: SUN_DURATION_24H
  8. Global radiation: SHORT_WAVE_FROM_SKY_24HOUR
  9. Total cloudiness: CLOUDINESS

We refer to the metadata and documentation of the synoptic measurements for more info.

Automatic weather stations

RMI operates a network of 17 automatic weather stations in Belgium. These weather stations report meteorological parameters such as air pressure, temperature, relative humidity, precipitation (quantity, duration), wind (speed, gust, direction), sunshine duration, shortwave solar radiation and infrared radiation every 10 minutes. Hourly and daily AWS data are computed from the 10-min observations.

At present only the data for station 'Zeebrugge' and 'Humain' from 2017-11-18 onwards are publicly available.

ALARO

The weather model 'Alaro' is a numerical forecast model that simulates the evolution of the atmosphere. The scientists of the RMI attempt constantly to improve these models on the basis of these newest numerical techniques, the parameterisation of physical processes and the use of meteorological observations.

The results of this research are processed in the operational weather model ALARO. It is used by the weather forecasters of the weather office, and for creating products and services for the general public.

All the parameters of the last run of Alaro can be downloaded. This data is generated automatically from ALARO every six hours. They aren't corrected or interpreted by the forecasters of the RMI. A correct interpretation of this data requires some expertise.

We refer to the metadata for more information.

Installation

pip install openkmi

Examples

See the notebooks under examples to get you started.

Quick start:

Point observations

from openkmi.point_obs import Synop
from openkmi.point_obs import AWS

# initialise synoptic data
kmi = Synop()

# initialise AWS data
# default is hourly
kmi_aws_hour = AWS()
# 10-min data:
kmi_aws_10min = AWS(freq='10T')
# Daily data:
kmi_aws_day = AWS(freq='D')

# get the available stations
df_stations = kmi.get_stations()

# get the available parameters
params = kmi.get_parameters()

# example to get the windspeed for a station starting from 2021 - present
df = kmi.get_data('6438', start_date='2021-01-01T00:00:00', parameter_list=['wind_speed'])

# Use more advanced filtering methods
from owslib.fes import PropertyIsEqualTo
custom_filt = PropertyIsEqualTo(propertyname='precip_range', literal='2')
df_r = kmi.get_data('6447', start_date='2020-01-01T00:00:00', end_date='2021-01-01T00:00:00',
                    parameter_list=['precip_quantity', 'precip_range'], custom_filter=custom_filt)

Alaro model forecasts

from openkmi.grid_data import Alaro

# initialise synoptic data
kmi = Alaro()

# get the available layers (parameters)
parameters = kmi.get_parameters()

# get more information on a layer
abstract = kmi.get_parameter_info('2_m_temperature')

# get available forecasting times
idx = kmi.get_times('2_m_temperature')

# get the data for a certain location (coordinates in WGS84)
df = kmi.get_data('2_m_temperature', 4.6824, 52.3617)

# get the data for a certain location (in Lambert72)
df = kmi.get_data('2_m_temperature', 169955, 338336, epsg='31370')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openkmi-0.7.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openkmi-0.7.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file openkmi-0.7.0.tar.gz.

File metadata

  • Download URL: openkmi-0.7.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.0

File hashes

Hashes for openkmi-0.7.0.tar.gz
Algorithm Hash digest
SHA256 e7073446ced3955db9cb14ae14257f08496c5294d9098b35de27b58f62896370
MD5 f273b42b0524871dbf5b7af0b6818c23
BLAKE2b-256 cf8930dff021369055b9094cc2d591e3f44e65909cd47b4873d52c1be84612eb

See more details on using hashes here.

File details

Details for the file openkmi-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: openkmi-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.0

File hashes

Hashes for openkmi-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 028d68d1bffa7f7684f7d1e3c061b7d9cbf89c6aac45fc67a9947e1ecca1e23c
MD5 ba48936532a4da30dcc347c524d030a8
BLAKE2b-256 f6e25e5e9fed6943e9c61cf755024994f384347b2e444262460459f5752b2627

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page