MAI - Collection of weather data

Defined in Task

Task 5.1: Plant Digital Twins with ML/AI

Short description

The MET API Interface (MAI for short) is a user interface to FROST, the API developed by the Norwegian Meteorological Institute (MET) which enables public access to weather data. MAI is a software bundle written in Python and is intended to be used as a standard Python module.

The purpose of MAI is to simplify data retrieval from FROST by providing a streamlined user interface. A user can select a location, a time interval, and a series of measurements, and MAI takes care of contacting the correct access point in FROST, submitting a properly composed request, and receiving and handling the response. MAI allows querying FROST for three main purposes: 1) Retrieve all available weather-stations names in a given area (at municipality level); 2) retrieve a list of all available measurements at a selected location or municipality; 3) retrieve all data available for the selected measurements at a chosen location and time interval. The weather data is collected in a properly formatted Pandas DataFrame for ease of use.

The modularity of MAI allows for flexible development and extension of its features.

Example of usage

To allow MAI to access FROST, a user must first register and receive its client ID. This is done visiting and registering with an email address. MET's API terms of use as well the privacy statement hold in this steps.

After registration, weather data can be retrieved by a user in one simple call to MAI. The figure below illustrates a minimal usage example.

Figure: Minimal usage example for retrieving weather data using MAI.


The software is intended to be run as a standard Python module, imported in a script and run either in terminal or in a notebook. Most functions contained in MAI accept as input location names, list of measurements, and time intervals (or a combination of those). The returned output can be either messages on the screen containing the requested information, or a Pandas DataFrame containing the weather data, formatted with timestamps in rows and the different measurements in columns. Errors are handled through descriptive explanations and suggestions to the user.

Subordinates and platform dependencies

MAI is available on any platform that can run Python 3.x.







To be considered in particular for the following COGNITWIN pilots