EDR-isobaric is an API for isobaric data (temperature and wind in isobaric layers). The API is based on OGC Environmental Data Retrieval (EDR). Data source is GRIB files from https://api.met.no/weatherapi/isobaricgrib/1.0/documentation.
The resulting API is for people who need vertical environmental data for a single location.
The code is written as an example aimed at API developers at Met.no.
Resulting data can be pasted into covjson playground for visualizing:
The area covered by the source:
- larsfp at met.no
Feature complete.
Choose one of the following:
docker pull ghcr.io/metno/edrisobaric:main
docker run -it --rm --publish 5000:5000 ghcr.io/metno/edrisobaric:main --bind_host 0.0.0.0
This method might need you to install libeccodes-dev
from your package manager. Clone repo and run:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python3 app/app.py
A test instance is available at https://edrisobaric.k8s.met.no/.
A grib data file will be downloaded on demand if none is supplied.
Staring the app will give these URLs:
- Landig page: http://127.0.0.1:5000/
- Openapi spec: http://127.0.0.1:5000/api
- SwaggerUI: http://127.0.0.1:5000/docs
- Redoc: http://127.0.0.1:5000/redoc
Example position lookup:
Arguments supported:
usage: app.py [-h] [--time TIME] [--file FILE] [--base_url BASE_URL] [--bind_host BIND_HOST] [--api_url API_URL] [--data_path DATA_PATH]
options:
-h, --help show this help message and exit
--time TIME Timestamp to fetch data for. Must be in format 2024-01-24T18:00:00Z, where time matches an available production. See
<https://api.met.no/weatherapi/isobaricgrib/1.0/available.json?type=grib2> for available files. They are produced every 3rd hour.
Example: --datetime="2024-01-24T18:00:00Z"
--file FILE Local grib file to read data from. Default will fetch file from API.
--base_url BASE_URL Base URL for API, with a trailing slash. Default is http://localhost:5000/
--bind_host BIND_HOST
Which host to bind to. Default is 127.0.0.1. Use 0.0.0.0 when running in container.
--api_url API_URL URL to download grib file from. Default is <https://api.met.no/weatherapi/isobaricgrib/1.0/grib2?area=southern_norway>.
--data_path DATA_PATH
Where to store data files. Default is ./data
This is only ment for learning. Use as noted in Testing it out.
- Based on Pydantic EDR- and covjson-libraries by KNMI
- This app will not download new data unless restarted.
- Sample output
This project is heavily tested to serve as an example for API developers and of sedr.
- This API is tested on commit to internal gitlab
- This API is tested on commit to public github
- To run tests manually, activate your venv, install requirements.txt and requirements-dev.txt, then run
tox --parallel
. Multiple tests available, seetox -a
.
- https://opendata.fmi.fi/edr/
- https://labs.metoffice.gov.uk/edr/
- https://developer.dataplatform.knmi.nl/edr-api
- https://swim.iblsoft.com/data/icon-de/edr/collections/isobaric/
- Icon from freepik.com
- https://covjson.org/
- https://fastapi.tiangolo.com/tutorial/bigger-applications/
- Issues
- This document is based on the Met-norway-readme-template.
- Gitlab-ci is based on team-punkt gitlab-ci