Home

Awesome

Build Status

MELODIST - An open-source MEteoroLOgical observation time series DISaggregation Tool

Welcome to MELODIST - MEteoroLOgical observation time series DISaggregation Tool

MELODIST is an open-source toolbox written in Python for disaggregating daily meteorological time series to hourly time steps. It is licensed under GPLv3 (see license file). The software framework consists of disaggregation functions for each variable including temperature, humidity, precipitation, shortwave radiation, and wind speed. These functions can simply be called from a station object, which includes all relevant information about site characteristics. The data management of time series is handled using data frame objects as defined in the pandas package. In this way, input and output data can be easily prepared and processed. For instance, the pandas package is data i/o capable and includes functions to plot time series using the matplotlib library.

An example file is provided along the package itself as a Jupyter notebook. This example demonstrates the usage of MELODIST for all variables. First, a station object is created providing some basic details on the site’s characteristics (e.g., latitude and longitude are relevant for radiation disaggregation). Once the station object is defined and filled with data, each disaggregation step is done through calling the designated function specified for each variable. Each of these functions requires a method argument and if needed additional parameters to work properly. Some of these methods (see below) require additional statistical evaluations of hourly time series prior to the disaggregation procedure. This information is stored in a station statistics object that is associated to the station object (see example file for further details).

Station object

In the framework of MELODIST a station object includes all relevant information including metadata and time series. A station is generated using the constructor method:

s = melodist.Station(lon=longitude, lat=latitude, timezone=timezone)

Data is simply added by assignment (e.g., the data frame data_obs_daily):

s.data_daily = data_obs_daily

A station statistics object can be generated in a similar manner. As station statistics are derived through analysing hourly observations for calibration, a reference to the data frame including hourly observations is given:

s.statistics = melodist.StationStatistics(data_obs_hourly)

Statistics can be derived for each variable by calling the respective function of the statistics object s.statistics: calc_wind_stats(), calc_humidity_stats(), calc_temperature_stats(), calc_precipitation_stats(), and calc_radiation_stats.

Naming convention for dataframe columns

MELODIST expects exact naming conventions for the time series provided in pandas dataframes. Please find the specification of column names below:

For daily data, additional columns need to be specified (if applicable):

Please note that the dataframe's index must contain datetime values.

Disaggregation methods

The Station class provides functions to perform the disaggregation procedures for each variable: disaggregate_temperature(), disaggregate_humidity(), disaggregate_wind(), disaggregate_radiation(), and disaggregate_precipitation(). Moreover, an interpolation approach is also available using the interpolate() function.

Hint: It is worth noting that each of the implemented disaggregation methods is directly accessible, e.g., melodist.precipitation.disagg_prec(). In this case all relevant parameters (e.g., those derived through calibrations) need to be provided in the function call. This method-specific call of functions is not necessary if a station and the corresponding station statistics object is defined. Thus, it is recommended to define objects and to perform the disaggregation procedures using the object’s methods. Also, the names and signatures of these functions are likely subject to changes in future versions of MELODIST.

Please find below a list of available disaggregation methods for each variable which can be specified in the respective disaggregation methods of a Station object:

Temperature

Humidity

Wind speed

Radiation

Precipitation

Utilities

Among other features the melodist.util module includes some functions that might be useful for data analyses:

Data input/output

MELODIST includes a feature to read and save parameter settings for all disaggregation methods in order to transfer settings or to continue work at a later time. This feature is based on the JSON format which provides a flexible and easily readable ASCII file format for different applications.

To save MELODIST parameters included in station statistics object you can simply call the to_json(filename) method of this object. At any time it is possible to recall this settings by creating a new station statistics object based on the settings stored in that file:

new_stationstatistics_object = melodist.StationStatistics.from_json(filename)

Since MELODIST is based on pandas, numerous ways to import and export pandas data frames exist. The to_csv() and read_csv() functions of pandas are ideal to load and save time series without any restriction with respect to MELODIST applications.

MELODIST has also some additional specific data input/output capabilities in melodist.data_io, including functions to read data provided by the national weather services of the Netherlands (read_single_knmi_file(), read_knmi_dataset()) and Germany (read_dwd()). Moreover, the SMET format is supported for reading and writing (read_smet(), write_smet()). This format is used in the MeteoIO library.

References

Förster, K., Hanzer, F., Winter, B., Marke, T., and Strasser, U.: An open-source MEteoroLOgical observation time series DISaggregation Tool (MELODIST v0.1.1), Geosci. Model Dev., 9, 2315-2333, doi:10.5194/gmd-9-2315-2016, 2016.

Hanzer, F., Förster, K., Nemec, J., and Strasser, U.: Projected cryospheric and hydrological impacts of 21st century climate change in the Ötztal Alps (Austria) simulated using a physically based approach, Hydrol. Earth Syst. Sci., 22, 1593-1614, doi:10.5194/hess-22-1593-2018, 2018.

Version history