example.modelchain_example.get_weather_data

example.modelchain_example.get_weather_data(filename='weather.csv', **kwargs)[source]

Imports weather data from a file.

The data include wind speed at two different heights in m/s, air temperature in two different heights in K, surface roughness length in m and air pressure in Pa. The height in m for which the data applies is specified in the second row. In case no weather data file exists, an example weather data file is automatically downloaded and stored in the same directory as this example.

Parameters:
  • filename (str) – Filename of the weather data file. Default: ‘weather.csv’.

  • datapath (str, optional) – Path where the weather data file is stored. Default is the same directory this example is stored in.

Returns:

DataFrame with time series for wind speed wind_speed in m/s, temperature temperature in K, roughness length roughness_length in m, and pressure pressure in Pa. The columns of the DataFrame are a MultiIndex where the first level contains the variable name as string (e.g. ‘wind_speed’) and the second level contains the height as integer at which it applies (e.g. 10, if it was measured at a height of 10 m). The index is a DateTimeIndex.

Return type:

pandas.DataFrame