In [1]:
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import pandas as pd
In [76]:
filename = 'data_meteoblue/'+'history_export_2017-07-10T14_30_52.csv'
In [77]:
data = pd.read_csv(filename, sep=';' , header=10)#, delimiter=None, header='infer'
In [78]:
data
Out[78]:
In [80]:
data.index = pd.to_datetime( data[['Year', 'Month', 'Day', 'Hour', 'Minute']] )
data = data.drop( ['Year', 'Month', 'Day', 'Hour', 'Minute'], axis=1 )
In [81]:
data.columns
Out[81]:
In [82]:
data['Total cloud cover [sfc]'].plot()
Out[82]:
In [92]:
import weatherfeed as wf
import sunradiation as sun
In [38]:
coords_grenoble = (45.1973288, 5.7139923)
startday = pd.to_datetime('26/06/2017', format='%d/%m/%Y').tz_localize('Europe/Paris')
lastday = pd.to_datetime('10/07/2017', format='%d/%m/%Y').tz_localize('Europe/Paris')
In [39]:
weatherdata = wf.buildmultidayDF(startday, lastday, coords_grenoble )
In [83]:
weatherdata['temperature'].plot( figsize=(14, 6))
data['Temperature [2 m above gnd]'].plot(style='r')
Out[83]:
In [84]:
data.index.dayofyear
Out[84]:
In [87]:
zoom_mask = data.index.map(lambda x: x.dayofyear) == 185
In [88]:
weatherdata['temperature'].loc[ zoom_mask].plot( figsize=(14, 6))
data['Temperature [2 m above gnd]'].loc[ zoom_mask].plot(style='r')
Out[88]:
In [89]:
weatherdata['cloudCover'].plot( figsize=(14, 6))
cc = data['Total cloud cover [sfc]']/100
cc.plot(style='r')
Out[89]:
In [106]:
zoom_mask = data.index.map(lambda x: x.dayofyear) == 181
data['Shortwave Radiation - backwards [sfc]'].loc[zoom_mask].plot(figsize=(14, 6))
Out[106]:
In [93]:
sundata = sun.buildmultidayDF( coords_grenoble, weatherdata.index, cloudCover = weatherdata['cloudCover'] )
In [94]:
sundata['I0'].plot()
Out[94]:
In [107]:
zoom_mask = data.index.map(lambda x: x.dayofyear) == 181
data['Shortwave Radiation - backwards [sfc]'].loc[zoom_mask].plot(figsize=(14, 6))
sundata['I0'].loc[zoom_mask].plot()
# surface horizontal vs dans direction du soleil
Out[107]:
In [ ]: