Ejemplo n.º 1
0
Example: Comparing aggregated data

Meteorological data provided by Meteostat (https://dev.meteostat.net)
under the terms of the Creative Commons Attribution-NonCommercial
4.0 International Public License.

The code is licensed under the MIT license.
"""

from datetime import datetime
import matplotlib.pyplot as plt
from meteostat import Stations, Daily

# Get weather stations by WMO ID
stations = Stations()
stations = stations.id('meteostat', ('D1424', '10729', '10803', '10513'))
stations = stations.fetch()

# Get names of weather stations
names = stations['name'].to_list()

# Time period
start = datetime(2000, 1, 1)
end = datetime(2019, 12, 31)

# Get daily data
data = Daily(stations, start, end)
data = data.aggregate(freq='1Y').fetch()

# Plot chart
fig, ax = plt.subplots(figsize=(8, 6))
Ejemplo n.º 2
0
"""
Example: Aggregation

Meteorological data provided by Meteostat (https://dev.meteostat.net)
under the terms of the Creative Commons Attribution-NonCommercial
4.0 International Public License.

The code is licensed under the MIT license.
"""

from datetime import datetime
from meteostat import Stations, Hourly

# Hourly
stations = Stations()
stations = stations.id('wmo', '10637')
station = stations.fetch()

# Time period
start = datetime(2018, 1, 1)
end = datetime(2018, 1, 1, 23, 59)

# Get hourly data & aggregate
data = Hourly(station, start, end)
data = data.aggregate('1D')
data = data.fetch()

# Print
print(data)
Ejemplo n.º 3
0
"""
Example: Get weather stations by identifier

Meteorological data provided by Meteostat (https://dev.meteostat.net)
under the terms of the Creative Commons Attribution-NonCommercial
4.0 International Public License.

The code is licensed under the MIT license.
"""

from meteostat import Stations

# Get weather station with ICAO ID EDDF
stations = Stations()
station = stations.id('icao', 'EDDF').fetch()

# Print station
print(station)
Ejemplo n.º 4
0
Example: Comparing multiple weather stations

Meteorological data provided by Meteostat (https://dev.meteostat.net)
under the terms of the Creative Commons Attribution-NonCommercial
4.0 International Public License.

The code is licensed under the MIT license.
"""

from datetime import datetime
import matplotlib.pyplot as plt
from meteostat import Stations, Daily

# Get weather stations by WMO ID
stations = Stations()
stations = stations.id('wmo', ('71624', '72295', '68816', '94767'))
stations = stations.fetch()

# Get names of weather stations
names = stations['name'].to_list()

# Time period
start = datetime(2019, 1, 1)
end = datetime(2019, 12, 31)

# Get daily data
data = Daily(stations, start, end)
data = data.fetch()

# Plot chart
data.unstack('station')['tavg'].plot(