Analyse_RLT

Bibliotheken importieren

# Name des aktuellen Notebooks für die exportierten Datein
file_name = "Analyse_RLT" 
# Ordner auf dem Server (nach files/)
ftp_folder = 'Notebooks/Auswertung'
## Bibliotheken, Module und Text- bzw- Grafikformatierungen aus zentraler Datei laden
%run ../Template/libraries_and_styles.ipynb 
## Warum auch immer muss rcParams.update() in eine eigene Zelle...
mpl.rcParams.update(params)

import mpld3
from mpld3 import plugins
from mpld3.utils import get_id 
import collections 

# https://stackoverflow.com/questions/50806166/pandas-dataframe-getting-average-value-for-each-monday-1-am
# https://stackoverflow.com/questions/52297501/how-to-plot-uncertainty-bounds-of-a-set-of-curves-where-each-curve-has-inconsist

# # %matplotlib notebook
# sys.path
# sys.path.insert(0,'c:\\users\\kolja\\appdata\local\\programs\\python\\python37\\lib\\site-packages\\plot')
# sys.path

Daten Import

daten = pd.read_csv('../1_Daten/Arbeitsdaten/Daten_15s.csv')
daten["Zeit"] = pd.to_datetime(daten["Zeit"],dayfirst=True)
daten.set_index(['Zeit'], inplace=True)

Plot Volumenströme

Linie - mitt, med, min & max

f, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, sharey=True, constrained_layout=False)
mpl.rcParams.update({'font.size': 6})
######## tägliche Mittelwerte
daten_tgl = daten 
daten_tgl['L_Zuluft_VPunkt'] = daten_tgl['L_Zuluft_1_VPunkt']  + daten_tgl['L_Zuluft_2_VPunkt'] + daten_tgl['L_Zuluft_3_VPunkt'] 
daten_tgl = daten_tgl.loc['2017-05-01':'2018-04-30'].resample('1D').mean()
## Linien
daten_tgl['L_Zuluft_1_VPunkt'].plot(ax=ax1,color=colo('rot',1), linewidth=0.5, label = 'Zuluft Sem1') 
daten_tgl['L_Zuluft_2_VPunkt'].plot(ax=ax1,color=colo('grün',1), linewidth=0.5, label = 'Zuluft Sem2') 
daten_tgl['L_Zuluft_3_VPunkt'].plot(ax=ax1,color=colo('blau',1), linewidth=0.5, label = 'Zuluft Flur') 
daten_tgl['L_Zuluft_VPunkt'].plot(ax=ax1,color=colo('orange',1), linewidth=0.5, label = 'Zuluft gesamt') 
## Achsen & Legende 
ax1.set(ylim=0) 
ax1.set_xlabel('')
ax1.set_title('tägliche Mittelwerte')  



######## tägliche Medianwerte
daten_tgl = daten 
daten_tgl['L_Zuluft_VPunkt'] = daten_tgl['L_Zuluft_1_VPunkt']  + daten_tgl['L_Zuluft_2_VPunkt'] + daten_tgl['L_Zuluft_3_VPunkt'] 
daten_tgl = daten_tgl.loc['2017-05-01':'2018-04-30'].resample('1D').median() 
## Linien
daten_tgl['L_Zuluft_1_VPunkt'].plot(ax=ax2,color=colo('rot',1), linewidth=0.5, label = 'Zuluft Sem1') 
daten_tgl['L_Zuluft_2_VPunkt'].plot(ax=ax2,color=colo('grün',1), linewidth=0.5, label = 'Zuluft Sem2') 
daten_tgl['L_Zuluft_3_VPunkt'].plot(ax=ax2,color=colo('blau',1), linewidth=0.5, label = 'Zuluft Flur') 
daten_tgl['L_Zuluft_VPunkt'].plot(ax=ax2,color=colo('orange',1), linewidth=0.5, label = 'Zuluft gesamt') 
## Achsen & Legende 
ax2.set(ylim=0) 
ax2.set_xlabel('')
ax2.set_title('tägliche Medianwerte')



######## tägliche Maximalwerte
daten_tgl = daten 
daten_tgl['L_Zuluft_VPunkt'] = daten_tgl['L_Zuluft_1_VPunkt']  + daten_tgl['L_Zuluft_2_VPunkt'] + daten_tgl['L_Zuluft_3_VPunkt'] 
daten_tgl = daten_tgl.loc['2017-05-01':'2018-04-30'].resample('1D').max()
## Linien
daten_tgl['L_Zuluft_1_VPunkt'].plot(ax=ax3,color=colo('rot',1), linewidth=0.5, label = 'Zuluft Sem1') 
daten_tgl['L_Zuluft_2_VPunkt'].plot(ax=ax3,color=colo('grün',1), linewidth=0.5, label = 'Zuluft Sem2') 
daten_tgl['L_Zuluft_3_VPunkt'].plot(ax=ax3,color=colo('blau',1), linewidth=0.5, label = 'Zuluft Flur') 
daten_tgl['L_Zuluft_VPunkt'].plot(ax=ax3,color=colo('orange',1), linewidth=0.5, label = 'Zuluft gesamt') 
## Achsen & Legende
# ax3.set_ylabel(r'\textbf{Volumenstrom} (m\textsuperscript{3}/h)')    
ax3.set(ylim=0) 
ax3.set_xlabel('')
ax3.set_title('tägliche Maximalwerte') 
monthlyX(ax3)



######## tägliche Minimalwerte
daten_tgl = daten 
daten_tgl['L_Zuluft_VPunkt'] = daten_tgl['L_Zuluft_1_VPunkt']  + daten_tgl['L_Zuluft_2_VPunkt'] + daten_tgl['L_Zuluft_3_VPunkt'] 
daten_tgl = daten_tgl.loc['2017-05-01':'2018-04-30'].resample('1D').min()
## Linien
daten_tgl['L_Zuluft_1_VPunkt'].plot(ax=ax4,color=colo('rot',1), linewidth=0.5, label = 'Zuluft Sem1') 
daten_tgl['L_Zuluft_2_VPunkt'].plot(ax=ax4,color=colo('grün',1), linewidth=0.5, label = 'Zuluft Sem2') 
daten_tgl['L_Zuluft_3_VPunkt'].plot(ax=ax4,color=colo('blau',1), linewidth=0.5, label = 'Zuluft Flur') 
daten_tgl['L_Zuluft_VPunkt'].plot(ax=ax4,color=colo('orange',1), linewidth=0.5, label = 'Zuluft gesamt') 
## Achsen & Legende
# ax4.set_ylabel(r'\textbf{Volumenstrom} (m\textsuperscript{3}/h)')    
ax4.set(ylim=0) 
ax4.set_xlabel('')
# ax4.get_yaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator
# h0, l0 = ax4.get_legend_handles_labels() 
# legend = plt.legend(h0, l0, ncol=4, loc=1)
# set_legend_linewidth(legend)   
ax4.set_title('tägliche Minimalwerte') 
# monthlyX(ax4) 



plt.savefig(output_folder + '/' + file_name + '_Volumenstroeme_tgl_4_fach.pdf')
mpl.rcParams.update({'font.size': 10})

Linie - Mittel & Hintergrund

## läuft
mist  = daten.loc['2017-05-01':'2018-04-30'].resample('1D').min()
daten_tgl = daten
daten_tgl['L_Zuluft_VPunkt'] = daten_tgl['L_Zuluft_1_VPunkt']  + daten_tgl['L_Zuluft_2_VPunkt'] + daten_tgl['L_Zuluft_3_VPunkt'] 

stat = pd.DataFrame()
stat['Date'] = mist.index
stat['V_Punkt_mean'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Zuluft_VPunkt'].resample('1D').mean().values
stat['V_Punkt_median'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Zuluft_VPunkt'].resample('1D').median().values
stat['V_Punkt_min'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Zuluft_VPunkt'].resample('1D').min().values
stat['V_Punkt_max'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Zuluft_VPunkt'].resample('1D').max().values
stat['S_Gas_Vpunkt'] = daten_tgl.loc['2017-05-01':'2018-04-30']['S_Gas_Vpunkt'].resample('1D').sum().values/240/1000
stat['L_Aussenlufttemperatur_1'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Aussenlufttemperatur_1'].resample('1D').mean().values


fig, ax = plt.subplots()
ax.fill_between(stat['Date'], stat['V_Punkt_min'], stat['V_Punkt_max'],edgecolor='black', facecolor=colo('grey',1.5), alpha=1, label = 'min - max')

# ax.plot(stat['Date'], stat['V_Punkt_median'],color=colo('red',1), linewidth=0.3, label = 'Medianwert')
ax.plot(stat['Date'], stat['V_Punkt_mean'],color=colo('blau',1),   linewidth=0.5, label = 'Mittelwert')

ax2 = ax.twinx() 
ax2.plot(stat['Date'], stat['S_Gas_Vpunkt'],color=colo('rot',1),   linewidth=0.5, label = 'Gasverbrauch')
ax2.set_ylabel(r'\textbf{Gasverbrauch} (m\textsuperscript{3}/d)')  
ax2.set(ylim=0) 
# ax3 = ax.twinx() 
# ax3.plot(stat['Date'], stat['L_Aussenlufttemperatur_1'],color=colo('orange',1),   linewidth=0.5, label = 'Gasverbrauch')
# ax3.set_ylabel(r'\textbf{Temperatur} ($^\circ$C)')  

## Achsen & Legende
ax.set_ylabel(r'\textbf{Volumenstrom} (m\textsuperscript{3}/h)')    
ax.set(ylim=0) 
ax.set_yticks([0,100, 500, 1000,1500])  
ax.set_xlabel('')
ax.get_yaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator
h0, l0 = ax.get_legend_handles_labels() 
h2, l2 = ax2.get_legend_handles_labels() 
legend = plt.legend(h0+h2, l0+l2, ncol=1, loc=1)
set_legend_linewidth(legend)   

## jeden Donnerstag eine Linie
# from datetime import date, timedelta
# dstart = date(2017,5,1)
# dend = date(2018,4,30) 
# days = [dstart + timedelta(days=x) for x in range((dend-dstart).days + 1) if (dstart + timedelta(days=x)).weekday() == 3]

# xposition = [pd.to_datetime('05.01.17'), pd.to_datetime('30.04.18')]
# for xc in days:
#     ax.axvline(x=xc, color='k', linestyle='-',linewidth=0.5)



ax.set(xlim=[pd.to_datetime("05.01.17 00:00:00"),pd.to_datetime("30.04.18 23:00:00")])
## X Achse mit Monaten und 2 mal dem Jahr :-)
monthlyX(ax)
plt.savefig(output_folder + '/' + file_name + '_Volumenstroeme_tgl_Linie.pdf')


plt.show()
fig, ax = plt.subplots()

daten['L_Zuluft_1_VPunkt'].plot(ax=ax,color=colo('rot',1), linewidth=0.5, label = 'Seminar 1') 
daten['L_Zuluft_2_VPunkt'].plot(ax=ax,color=colo('grün',1), linewidth=0.5, label = 'Seminar 2') 
daten['L_Zuluft_3_VPunkt'].plot(ax=ax,color=colo('blau',1), linewidth=0.5, label = 'Voyer')  


ax.set_ylabel(r'\textbf{Volumenstrom} (m\textsuperscript{3}/h)')   
ax.set(ylim=0) 
ax.set_xlabel('') 

h0, l0 = ax.get_legend_handles_labels() 
legend = plt.legend(h0, l0, ncol=1, loc=1)
set_legend_linewidth(legend) 

ax.get_yaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator
## X Achse mit Monaten und 2 mal dem Jahr :-)
ax.set(xlim=[pd.to_datetime("05.01.17 00:00:00"),pd.to_datetime("30.04.18 23:59:00")])
monthlyX(ax)

plt.savefig(output_folder + '/' + file_name + '_Volumenstroeme_tgl_Linie_einzeln.pdf') 
# daten.head()

Anteile

Anteile = pd.DataFrame()
Anteile['L_Zuluft_1_VPunkt_Anteil'] = daten['L_Zuluft_1_VPunkt'] / daten['L_Zuluft_VPunkt'] * 100
Anteile['L_Zuluft_2_VPunkt_Anteil'] = daten['L_Zuluft_2_VPunkt'] / daten['L_Zuluft_VPunkt'] * 100
Anteile['L_Zuluft_3_VPunkt_Anteil'] = daten['L_Zuluft_3_VPunkt'] / daten['L_Zuluft_VPunkt'] * 100

Anteile = Anteile.resample('D').mean()

Anteile = Anteile.rolling(5).mean()

fig, ax = plt.subplots()
Anteile['L_Zuluft_1_VPunkt_Anteil'].plot(ax=ax,color=colo('rot',1), linewidth=0.5, label = 'Seminar 1') 
Anteile['L_Zuluft_2_VPunkt_Anteil'].plot(ax=ax,color=colo('grün',1), linewidth=0.5, label = 'Seminar 2') 
Anteile['L_Zuluft_3_VPunkt_Anteil'].plot(ax=ax,color=colo('blau',1), linewidth=0.5, label = 'Voyer')  
ax.set_ylabel(r'\textbf{Volumenstrom} (m\textsuperscript{3}/h)')   
ax.set(ylim=0) 
ax.set_xlabel('') 
h0, l0 = ax.get_legend_handles_labels() 
legend = plt.legend(h0, l0, ncol=1, loc=1)
set_legend_linewidth(legend) 
ax.get_yaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator
## X Achse mit Monaten und 2 mal dem Jahr :-)
ax.set(xlim=[pd.to_datetime("05.01.17 00:00:00"),pd.to_datetime("30.04.18 23:59:00")])
monthlyX(ax)
plt.savefig(output_folder + '/' + file_name + '_Volumenstroeme_tgl_Linie_Anteil.pdf') 

Histogramm

sample = '15s' 
vol = daten['2017-05-01':'2018-04-30'].resample(sample).mean()
vol['L_Zuluft_VPunkt'] = vol['L_Zuluft_1_VPunkt']  + vol['L_Zuluft_2_VPunkt'] + vol['L_Zuluft_3_VPunkt'] 
vol.dropna(inplace= True)

Histo Analyse

## Anzahl der bins festlegen
binsNR = [*range(1, 61, 1)] 
## bin_t = die Dauer, die jedes bin in Summe enthält
bin_t = pd.cut(vol['L_Zuluft_VPunkt'],60,labels=binsNR).value_counts().sort_index()
## intervall = das Intervall (von, bis] für jedes bin
values, interval = pd.cut(vol['L_Zuluft_VPunkt'],60,retbins=True)
## Mittelwerte des Intervalle berechnen 
interval_m = []
for i in range(0, 60):
    interval_m.append((interval[i] + interval[i+1])/2)
## df aus Dauer und Mittelwert
df = pd.DataFrame({'Dauer':(bin_t/240), 'V_Punkt':interval_m}) 

## Zeiten der drei Abschnitte berechnen
u = 0
for i in range(1, 13):
     u = u + bin_t[i]
m = 0
for i in range(13, 37):
    m = m + bin_t[i]
o = 0
for i in range(37, 61):
    o = o + bin_t[i]

Summe1 = bin_t.sum()/240
Summe2 = (u+m+o)/240
t_u = u/240
t_m = m/240
t_o = o/240

## mittlerer Volumenstrom eines jeden Abschnittes
## relativen Anteil berechnen
faktor = []
for i in range(1, 13):
    faktor.append(bin_t[i] / u)
for i in range(13, 37):
    faktor.append(bin_t[i] / m)
for i in range(37, 61):
    faktor.append(bin_t[i] / o)
df['faktor'] = faktor
## Volumenstrom * relativer Anteil
df['V_mittel'] = df.V_Punkt * faktor
## Abschnitte aufsummieren
V_m_u = df.loc[1:12]['V_mittel'].sum()
V_m_m = df.loc[13:36]['V_mittel'].sum()
V_m_o = df.loc[37:60]['V_mittel'].sum()

## Ausgabe
print(f'Kontrolle: {Summe1 - Summe2}') 
print(f'unten Dauer: {round(t_u,1)} h, durschn. Volumenstrom: {round(V_m_u,1)}m³') 
print(f'mitte Dauer: {round(t_m,1)} h, durschn. Volumenstrom: {round(V_m_m,1)}m³')
print(f'oben Dauer : {round(t_o,1)} h, durschn. Volumenstrom: {round(V_m_o,1)}m³') 

# display(df.head())
# display(df.tail())
# interval
Kontrolle: 0.0
unten Dauer: 3137.5 h, durschn. Volumenstrom: 169.6m³
mitte Dauer: 1950.8 h, durschn. Volumenstrom: 847.7m³
oben Dauer : 3613.4 h, durschn. Volumenstrom: 1483.0m³

Histo Plot gesamt

## Histo
bins  = 60
oben  = 36
unten = 12
plt.figure(figsize=(2.78,2.05))
N, bins, patches = plt.hist(vol['L_Zuluft_VPunkt'], bins=bins, orientation="horizontal", label='Value')
plt.hist(vol['L_Zuluft_VPunkt'], bins=bins, orientation="horizontal", label='Value', edgecolor='black', linewidth=.4, histtype='step')
## die drei Bereiche einfärben, Füllung und Rahmen
for i in range(0,unten):
    patches[i].set_facecolor(colo('grün',.6))
    patches[i].set_edgecolor(colo('grün',.6))
for i in range(unten,oben):
    patches[i].set_facecolor(colo('grün',1))
    patches[i].set_edgecolor(colo('grün',1))    
for i in range(oben,60):
    patches[i].set_facecolor(colo('grün',1.6))
    patches[i].set_edgecolor(colo('grün',1.6))

## notwendig um die Achsen der Figur zu bekommen
ax = plt.gca()
## Label für Legende
top    = mpatches.Patch(facecolor =colo('grün',1.6),   edgecolor='black', label=r'$1.179 - 1.891$')
center = mpatches.Patch(facecolor =colo('grün',1), edgecolor='black', label='') #r'$\dot V \hspace{0.38cm}   500 - 1.000$')
bottom = mpatches.Patch(facecolor =colo('grün',.6),    edgecolor='black', label='') #r'$\dot V \hspace{0.74cm}   0 - \hspace{0.25cm} 500$')
## \hphantom{} funktioniert nicht in der Legende bzw. nicht vor dem ersten sichtbaren Zeichen, daher die Notlösung mit .text()
ax.text(.646, 458, r'$468 - 1.150$', transform=ax.get_yaxis_transform())
ax.text(.65,  265, r'$110 - \hphantom{1.}438$', transform=ax.get_yaxis_transform()) 
## Legende
legend = plt.legend(handles=[top,center,bottom],loc='lower right', bbox_to_anchor=(1., .06))  
set_legend_linewidth(legend)  
## Hintergrund der Legende transparent, damit der Text sichtbar wird ;-)
legend.get_frame().set_alpha(None)
legend.get_frame().set_facecolor((0, 0, 0, 0))

## Y Achse formatieren
ax.set(ylim=[0,1900]) 
## Ticks sind Mittelwerte des jeweiligen Abteils
ax.set_yticks([V_m_u, V_m_m,V_m_o]) 
# ax.set_ylabel(r'\textbf{Volumenstrom} ($m^3/h$)')   
ax.get_yaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator
## X Achse skalieren mit dem Faktir 1/240, damit die 15s in Stunden abgebildet werden
ax.set_xlabel(r'\textbf{Zeit} (h)')   
ax.set(xlim=[0,500000]) 
ax.set_xticks([0,120000, 240000,360000,480000])  
x_vals = ax.get_xticks()
ax.set_xticklabels(['{:3.0f}%'.format(x / 240) for x in x_vals])
## remove minorticks
plt.tick_params(axis='x', which='minor', bottom=False)

## Stundenwerte
ax.text(.19,  175,  r'$3.137 h$', transform=ax.get_yaxis_transform()) 
ax.text(.19,  880,  r'$1.950 h$', transform=ax.get_yaxis_transform()) 
ax.text(.19,  1560, r'$3.613 h$', transform=ax.get_yaxis_transform()) 

plt.savefig(output_folder + '/' + file_name + '_Volumenstroeme_Histogramm_gesamt.pdf') 
plt.show()

Histo Plot einzeln

daten_std = daten.resample('15s').mean()#.reset_index()
daten_std['L_Zuluft_VPunkt'] = daten_std['L_Zuluft_1_VPunkt']  + daten_std['L_Zuluft_2_VPunkt'] + daten_std['L_Zuluft_3_VPunkt'] 
daten_std['L_Zuluft_VPunkt'].isna().sum()  

bins = 40 
fig, ax = plt.subplots(nrows=3, ncols=1, sharex=True , constrained_layout=False,figsize=(3,2.05))
plt.subplots_adjust(hspace=.0)
# plt.hist(daten_std['L_Zuluft_VPunkt'],   bins=100, orientation="horizontal", color=colo('orange',1), linewidth=0.5, label = 'Zuluft gesamt')  
daten_std['L_Zuluft_1_VPunkt'].plot.hist(ax=ax[0], bins=bins, orientation="horizontal", color=colo('rot',1),    linewidth=0.4, edgecolor='black', label = 'Seminar 1',  histtype='stepfilled')  
daten_std['L_Zuluft_1_VPunkt'].plot.hist(ax=ax[0], bins=bins, orientation="horizontal", color=colo('black',1),  linewidth=0.3,                    label = '_nolegend_', histtype='step')  

daten_std['L_Zuluft_2_VPunkt'].plot.hist(ax=ax[1], bins=bins, orientation="horizontal", color=colo('orange',1), linewidth=0.4, edgecolor='black', label = 'Seminar 2',  histtype='stepfilled')  
daten_std['L_Zuluft_2_VPunkt'].plot.hist(ax=ax[1], bins=bins, orientation="horizontal", color=colo('black',1),  linewidth=0.4,                    label = '_nolegend_', histtype='step')  

daten_std['L_Zuluft_3_VPunkt'].plot.hist(ax=ax[2], bins=bins, orientation="horizontal", color=colo('blau',1),   linewidth=0.4, edgecolor='black', label = 'Foyer',       histtype='stepfilled')  
daten_std['L_Zuluft_3_VPunkt'].plot.hist(ax=ax[2], bins=bins, orientation="horizontal", color=colo('black',1),  linewidth=0.4,                    label = '_nolegend_', histtype='step')  

# W_raus.plot.barh(position = 1.5, color = (Farben_raus), edgecolor='black',linewidth = 0.3, width = 0.5, ax = ax, stacked = True, alpha = 1,align='edge')


## Legende  
h0, l0 = ax[0].get_legend_handles_labels()
h2, l2 = ax[1].get_legend_handles_labels()  
h4, l4 = ax[2].get_legend_handles_labels()  
legend = plt.legend(h0+h2+h4, l0+l2+l4, loc='lower right', ncol=1, bbox_to_anchor=(1., .14))  
set_legend_linewidth(legend)  
# legend.get_frame().set_linewidth(0.3)

## Grenzen und Ticks
# ax[0].set(xlim=[0,2000]) 
# ax[1].set(xlim=[0,2000]) 
# ax[2].set(xlim=[0,2000]) 
ax[0].set(ylim=[0,1400]) 
ax[1].set(ylim=[0,180]) 
ax[2].set(ylim=[0,500]) 
ax[0].set_yticks([0,618]) 
ax[1].set_yticks([0,104]) 
ax[2].set_yticks([0,142])  
## Beschriftung Y Achse
ax[0].set_xlabel('')
ax[1].set_xlabel('')
ax[2].set_xlabel(r'\textbf{Zeit} (h)')   
## Tausendertrennzeichen
ax[0].get_yaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator
ax[1].get_yaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator
ax[2].get_yaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator
ax[0].get_xaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator
ax[1].get_xaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator
ax[2].get_xaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator

## X Achse skalieren mit dem Faktir 1/240, damit die 15s in Stunden abgebildet werden
ax[0].set_xticks([0,120000, 240000,360000,480000])  
x_vals = ax[0].get_xticks()
ax[0].set_xticklabels(['{:3.0f}%'.format(x / 240) for x in x_vals])
## remove minorticks
plt.tick_params(axis='x', which='minor', bottom=False)


## Beschriftungen Y Achse
ax[0].text(-0.28, -800, r'\textbf{Volumenstrom} ($m^3/h$)', va='center', rotation='vertical', transform=ax[0].get_yaxis_transform()) 

## Save
plt.savefig(output_folder + '/' + file_name + '_Volumenstroeme_Histogramm.pdf', bbox_inches='tight') 
print(f'Seminar 1: {round(daten_std.L_Zuluft_1_VPunkt.mean(),1)}')
print(f'Seminar 2: {round(daten_std.L_Zuluft_2_VPunkt.mean(),1)}')
print(f'Flur:      {round(daten_std.L_Zuluft_3_VPunkt.mean(),1)}') 
Seminar 1: 618.2
Seminar 2: 103.8
Flur:      142.6

Verhältnisse

Bypass

http://localhost:8888/notebooks/WRG/WRG_Effizienz.ipynb#

Plot Druck Zuluft Histogramm

daten_std = daten
daten_std.dropna(inplace= True)

fig, ax = plt.subplots()
bins = 1000
# .dropna()].isna().sum()
## Histogramme mit Rahmen
plt.hist(daten_std['L_Zuluft_Druck'], bins=bins, orientation="horizontal", color=colo('grün',1),  linewidth=0.5, edgecolor='black', label = 'Druck Zuluft',     histtype='stepfilled')    
plt.hist(daten_std['L_Zuluft_Druck'], bins=bins, orientation="horizontal", color=colo('black',1), linewidth=0.5,                    label = '_nolegend_', histtype='step')    
# plt.hist(daten_std['L_Abluft_Druck'], bins=bins, orientation="horizontal", color=colo('rot',1),   linewidth=0.5, edgecolor='black', label = 'Abluft',     histtype='stepfilled') 
# plt.hist(daten_std['L_Abluft_Druck'], bins=bins, orientation="horizontal", color=colo('black',1), linewidth=0.5,                    label = '_nolegend_', histtype='step') 
## Achsenbeschriftung
ax.set_ylabel(r'\textbf{Druck} (Pa)')     
ax.set_xlabel(r'\textbf{Zeit} (h)')   
## Legende
h0, l0 = ax.get_legend_handles_labels() 
legend = plt.legend(h0, l0, ncol=1, loc=1)  
set_legend_linewidth(legend)  
# legend.get_frame().set_linewidth(0.3)
## Y Achse formatieren
ax.set(ylim=[60,100]) 
# ax.set_yticks([60,65,70,75,80,85,90,95,100]) 
ax.set_yticks([93,86,81,72,65]) 
ax.axhline(y=93, linewidth=0.8,   color=colo('black',1), xmin=0.0001, xmax=.01)
ax.axhline(y=86, linewidth=0.8,   color=colo('black',1), xmin=0.0001, xmax=.01)
ax.axhline(y=81, linewidth=0.8,   color=colo('black',1), xmin=0.0001, xmax=.01)
ax.axhline(y=72, linewidth=0.8,   color=colo('black',1), xmin=0.0001, xmax=.01)
ax.axhline(y=65, linewidth=0.8,   color=colo('black',1), xmin=0.0001, xmax=.01)

## X Achse skalieren mit dem Faktir 1/240, damit die 15s in Stunden abgebildet werde
ax.get_xaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator
x_vals = ax.get_xticks()
ax.set_xticklabels(['{:3.0f}%'.format(x / 240) for x in x_vals])
ax.set(xlim=[0,50000]) 
# ax.set_xticks([0,120000, 240000,360000,480000])  
## remove minorticks
plt.tick_params(axis='x', which='minor', bottom=False)

# plt.savefig(output_folder + '/' + file_name + '_Luftdruck_Histogramm.pdf') 

Plot WRG und hoher V_Punkt

daten['bypass'] = np.where(daten['L_Zuluft_Druck'] < 73, 0, 1)
daten['bypass'] = np.where(daten['L_Zuluft_Druck'] > 82, 0, daten['bypass'])
daten["bypass_hVp"] = np.where(daten['L_Zuluft_VPunkt'] < 1179, 0, 1)
daten['both'] = np.where(daten['bypass'] > 0, 1, 0)
daten['both'] = np.where(daten['bypass_hVp'] > 0,  daten['both'],0)


df = pd.DataFrame()
df = daten['bypass'].resample('D').apply({'sum'})/240
df['bypass_hVp'] = daten['bypass_hVp'].resample('D').apply({'sum'})/240
df['both'] = daten['both'].resample('D').apply({'sum'})/240


print(df['sum'].sum()) 
print(df['bypass_hVp'].sum()) 
print(df['both'].sum()) 

fig, ax = plt.subplots()
df['sum'].plot(ax=ax,color=colo('grün',1),     linewidth=0.5, label = 'Stunden mit Luftaustausch') 
df['bypass_hVp'].plot(ax=ax,color=colo('blau',1),     linewidth=0.5, label = 'Volumenstrom über 1.179') 
df['both'].plot(ax=ax,color=colo('rot',1),     linewidth=0.5, label = 'both') 

# ax.fill_between(df.index, 0, df['sum'],edgecolor='black', facecolor=colo('grün',1), alpha=.4)
ax.set(ylim=[0,24]) 

## Legende
h0, l0 = ax.get_legend_handles_labels() 
legend = plt.legend(h0, l0, ncol=3, loc=1)  
set_legend_linewidth(legend)  

ax.set_ylabel(r'\textbf{Stunden} (h/d)')     
ax.set_xlabel('')   

# # jeden xxx-tag eine Linie
# from datetime import date, timedelta
# dstart = date(2017,5,1)
# dend = date(2018,4,30) 
# days = [dstart + timedelta(days=x) for x in range((dend-dstart).days + 1) if (dstart + timedelta(days=x)).weekday() == 0]

# # xposition = [pd.to_datetime('05.01.17'), pd.to_datetime('30.04.18')]
# for xc in days:
#     ax.axvline(x=xc, color='k', linestyle='-',linewidth=0.5)


plt.show()
1835.2749999999999
3613.708333333333
189.41666666666669

Plot Druck Zuluft

## läuft
mist  = daten.loc['2017-05-01':'2018-04-30'].resample('1D').min()
daten_tgl = daten 

stat = pd.DataFrame()
stat['Date'] = mist.index

stat['L_Zuluft_mean'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Zuluft_Druck'].resample('1D').mean().values
stat['L_Zuluft_median'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Zuluft_Druck'].resample('1D').median().values
stat['L_Zuluft_min'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Zuluft_Druck'].resample('1D').min().values
stat['L_Zuluft_max'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Zuluft_Druck'].resample('1D').max().values


stat['L_Abluft_mean'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Abluft_Druck'].resample('1D').mean().values
stat['L_Abluft_median'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Abluft_Druck'].resample('1D').median().values
stat['L_Abluft_min'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Abluft_Druck'].resample('1D').min().values
stat['L_Abluft_max'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Abluft_Druck'].resample('1D').max().values


fig, ax = plt.subplots()

ax.fill_between(stat['Date'], stat['L_Zuluft_min'], stat['L_Zuluft_max'],edgecolor='black', facecolor=colo('blau',1.5), alpha=.8, label = 'min - max')
ax.plot(stat['Date'], stat['L_Zuluft_median'],color=colo('blau',1.5), linewidth=0.3, label = 'L_Zuluft_Medianwert')
ax.plot(stat['Date'], stat['L_Zuluft_mean'],color=colo('blau',1),   linewidth=0.5, label = 'L_Zuluft_Mittelwert')



ax.fill_between(stat['Date'], stat['L_Abluft_min'], stat['L_Abluft_max'],edgecolor='black', facecolor=colo('rot',1.5), alpha=.8, label = 'min - max')
ax.plot(stat['Date'], stat['L_Abluft_median'],color=colo('rot',1.5), linewidth=0.3, label = 'L_Abluft_Medianwert')
ax.plot(stat['Date'], stat['L_Abluft_mean'],color=colo('rot',1),   linewidth=0.5, label = 'L_Abluft_Mittelwert')

## Achsen & Legende
ax.set_ylabel(r'\textbf{Druck} ($pa$)')    
ax.set(ylim=[0,175]) 
# ax.set_yticks([0,100, 500, 1000,1500])  
ax.set_xlabel('')
ax.get_yaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator
h0, l0 = ax.get_legend_handles_labels() 
legend = plt.legend(h0, l0, ncol=2, loc=1)
set_legend_linewidth(legend)   

## jeden Donnerstag eine Linie
# from datetime import date, timedelta
# dstart = date(2017,5,1)
# dend = date(2018,4,30) 
# days = [dstart + timedelta(days=x) for x in range((dend-dstart).days + 1) if (dstart + timedelta(days=x)).weekday() == 3]

# xposition = [pd.to_datetime('05.01.17'), pd.to_datetime('30.04.18')]
# for xc in days:
#     ax.axvline(x=xc, color='k', linestyle='-',linewidth=0.5)



ax.set(xlim=[pd.to_datetime("05.01.17 00:00:00"),pd.to_datetime("30.04.18 23:00:00")])
## X Achse mit Monaten und 2 mal dem Jahr :-)
monthlyX(ax)
plt.savefig(output_folder + '/' + file_name + '_L_Zuluft_Druck_tgl_Linie.pdf')


plt.show()

Druck Zu- und Abluft Histogramm

## NANs machen Warnings... 
# daten_std.dropna(inplace= True)
# print(daten_std.isna().sum()) 

daten_std = daten.resample('15s').mean()#.reset_index()
daten_std.dropna(inplace= True)

fig, ax = plt.subplots()
bins = 1000
# .dropna()].isna().sum()
## Histogramme mit Rahmen
plt.hist(daten_std['L_Zuluft_Druck'], bins=bins, orientation="horizontal", color=colo('grün',1),  linewidth=0.5, edgecolor='black', label = 'Zuluft',     histtype='stepfilled')    
plt.hist(daten_std['L_Zuluft_Druck'], bins=bins, orientation="horizontal", color=colo('black',1), linewidth=0.5,                    label = '_nolegend_', histtype='step')    
plt.hist(daten_std['L_Abluft_Druck'], bins=bins, orientation="horizontal", color=colo('rot',1),   linewidth=0.5, edgecolor='black', label = 'Abluft',     histtype='stepfilled') 
plt.hist(daten_std['L_Abluft_Druck'], bins=bins, orientation="horizontal", color=colo('black',1), linewidth=0.5,                    label = '_nolegend_', histtype='step') 
## Achsenbeschriftung
ax.set_ylabel(r'\textbf{Druck} (Pa)')     
ax.set_xlabel(r'\textbf{Zeit} (h)')   
## Legende
h0, l0 = ax.get_legend_handles_labels() 
legend = plt.legend(h0, l0, ncol=1, loc=1)  
set_legend_linewidth(legend)  
# legend.get_frame().set_linewidth(0.3)
## Y Achse formatieren
ax.set(ylim=[0,125]) 
ax.set_yticks([0,25,50,75,100,125]) 

## X Achse skalieren mit dem Faktor 1/240, damit die 15s in Stunden abgebildet werden
ax.set_xticks([0,96000,48000])  
ax.set(xlim=[0,96000]) 
x_vals = ax.get_xticks()
ax.set_xticklabels(['{:3.0f}%'.format(x / 240) for x in x_vals])

ax.get_xaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator
x_vals = ax.get_xticks()
ax.set_xticklabels(['{:3.0f}%'.format(x / 240) for x in x_vals])

## remove minorticks
plt.tick_params(axis='x', which='minor', bottom=False)

plt.savefig(output_folder + '/' + file_name + '_Luftdruck_Histogramm.pdf') 

Plot CO2 Konzentration

Linie

fig, ax = plt.subplots()

daten['L_Seminarraum_1_CO2'].plot(ax=ax,color=colo('grün',1), linewidth=0.5, label = 'Seminarraum 1')  
daten['L_Seminarraum_2_CO2'].plot(ax=ax,color=colo('rot',1), linewidth=0.5, label = 'Seminarraum 1') 

ax.set_ylabel(r'\textbf{CO\textsubscript{2}-Kontentration} (ppm)') 
ax.set(ylim=300) 
ax.set_xlabel('')
ax.get_yaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator

h0, l0 = ax.get_legend_handles_labels() 
legend = plt.legend(h0, l0, ncol=2, loc=1) 
set_legend_linewidth(legend) 
ax.set(xlim=[pd.to_datetime("05.01.17 00:00:00"),pd.to_datetime("30.04.18 23:59:00")])
monthlyX(ax)
plt.savefig(output_folder + '/' + file_name + '_CO2_Konzentration.pdf') 

Min-Max, Mittelwert

## läuft
mist  = daten.loc['2017-05-01':'2018-04-30'].resample('1D').min()
daten_tgl = daten 

stat = pd.DataFrame()
stat['Date'] = mist.index

stat['Seminarraum_1_mean'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Seminarraum_1_CO2'].resample('1D').mean().values
stat['Seminarraum_1_median'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Seminarraum_1_CO2'].resample('1D').median().values
stat['Seminarraum_1_min'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Seminarraum_1_CO2'].resample('1D').min().values
stat['Seminarraum_1_max'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Seminarraum_1_CO2'].resample('1D').max().values


stat['L_Seminarraum_2_mean'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Seminarraum_2_CO2'].resample('1D').mean().values
stat['L_Seminarraum_2_median'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Seminarraum_2_CO2'].resample('1D').median().values
stat['L_Seminarraum_2_min'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Seminarraum_2_CO2'].resample('1D').min().values
stat['L_Seminarraum_2_max'] = daten_tgl.loc['2017-05-01':'2018-04-30']['L_Seminarraum_2_CO2'].resample('1D').max().values


fig, ax = plt.subplots()

ax.fill_between(stat['Date'], stat['Seminarraum_1_min'], stat['Seminarraum_1_max'],edgecolor='black', facecolor=colo('blau',1.5), alpha=.8, label = 'min - max')
# ax.plot(stat['Date'], stat['Seminarraum_1_median'],color=colo('blau',1.5), linewidth=0.3, label = 'Seminarraum_1_Medianwert')
ax.plot(stat['Date'], stat['Seminarraum_1_mean'],color=colo('blau',1),   linewidth=0.5, label = 'Seminarraum_1_Mittelwert')



ax.fill_between(stat['Date'], stat['L_Seminarraum_2_min'], stat['L_Seminarraum_2_max'],edgecolor='black', facecolor=colo('rot',1.5), alpha=.8, label = 'min - max')
# ax.plot(stat['Date'], stat['L_Seminarraum_2_median'],color=colo('rot',1.5), linewidth=0.3, label = 'L_Seminarraum_2_Medianwert')
ax.plot(stat['Date'], stat['L_Seminarraum_2_mean'],color=colo('rot',1),   linewidth=0.5, label = 'L_Seminarraum_2_Mittelwert')

## Achsen & Legende
ax.set_ylabel(r'\textbf{CO2} ($ppm$)')    
# ax.set(ylim=[0,175]) 
# ax.set_yticks([0,100, 500, 1000,1500])  
ax.set_xlabel('')
ax.get_yaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator
h0, l0 = ax.get_legend_handles_labels() 
legend = plt.legend(h0, l0, ncol=2, loc=1)
set_legend_linewidth(legend)   

## jeden Donnerstag eine Linie
# from datetime import date, timedelta
# dstart = date(2017,5,1)
# dend = date(2018,4,30) 
# days = [dstart + timedelta(days=x) for x in range((dend-dstart).days + 1) if (dstart + timedelta(days=x)).weekday() == 3]

# xposition = [pd.to_datetime('05.01.17'), pd.to_datetime('30.04.18')]
# for xc in days:
#     ax.axvline(x=xc, color='k', linestyle='-',linewidth=0.5)



ax.set(xlim=[pd.to_datetime("05.01.17 00:00:00"),pd.to_datetime("30.04.18 23:00:00")])
## X Achse mit Monaten und 2 mal dem Jahr :-)
monthlyX(ax)
plt.savefig(output_folder + '/' + file_name + '_L_Zuluft_Druck_tgl_Linie.pdf')


plt.show()

Histogramm

daten_std = daten 
daten_std.dropna(inplace= True)

fig, ax = plt.subplots()
bins = 1000
# .dropna()].isna().sum()
## Histogramme mit Rahmen
# plt.hist(daten_std['L_Seminarraum_1_CO2'], bins=bins, orientation="horizontal", color=colo('blau',1),  linewidth=0.5, edgecolor='black', label = 'Seminar 1',     histtype='stepfilled')    
plt.hist(daten_std['L_Seminarraum_1_CO2'], bins=bins, orientation="horizontal", color=colo('blau',1.5), linewidth=0.5,                    label = '_nolegend_', histtype='step')    
# plt.hist(daten_std['L_Seminarraum_2_CO2'], bins=bins, orientation="horizontal", color=colo('rot',1),   linewidth=0.5, edgecolor='black', label = 'Seminar 2',     histtype='stepfilled') 
plt.hist(daten_std['L_Seminarraum_2_CO2'], bins=bins, orientation="horizontal", color=colo('rot',1.5), linewidth=0.5,                    label = '_nolegend_', histtype='step') 
## Achsenbeschriftung
ax.set_ylabel(r'\textbf{CO2} (ppm)')     
ax.set_xlabel('')   
## Legende
h0, l0 = ax.get_legend_handles_labels() 
legend = plt.legend(h0, l0, ncol=1, loc=1)  
set_legend_linewidth(legend)  
# legend.get_frame().set_linewidth(0.3)
## Y Achse formatieren
# ax.set(ylim=[0,125]) 
# ax.set_yticks([0,25,50,75,100,125]) 

## X Achse skalieren mit dem Faktor 1/240, damit die 15s in Stunden abgebildet werden
# ax.set_xticks([0,96000,48000])  
# ax.set(xlim=[0,96000]) 
# x_vals = ax.get_xticks()
# ax.set_xticklabels(['{:3.0f}%'.format(x / 240) for x in x_vals])

ax.get_xaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator
x_vals = ax.get_xticks()
ax.set_xticklabels(['{:3.0f}%'.format(x / 240) for x in x_vals])

## remove minorticks
plt.tick_params(axis='x', which='minor', bottom=False)

plt.savefig(output_folder + '/' + file_name + '_CO2_Histogramm.pdf') 

Plot Abluftfeuchte

# %matplotlib inline
fig, ax = plt.subplots()

daten['L_Duschen_Ablufttfeuchte'].plot(ax=ax,color=colo('grün',1), linewidth=0.5, label = 'Duschen Abluftfeuchte') 
ax.set_ylabel(r'\textbf{rel Luftfeuchte} (\%)')

ax2 = ax.twinx()
daten['L_Duschen_Ablufttemperatur'].plot(ax=ax2,color=colo('rot',1), linewidth=0.5, label = 'Duschen Ablufttemperatur') 
ax2.set_ylabel(r'\textbf{Temperatur} ($^\circ$C)')  

ax.set_ylim(0,100) 
ax2.set_ylim(0,100) 
ax.set_xlabel('')

h0, l0 = ax.get_legend_handles_labels()
h2, l2 = ax2.get_legend_handles_labels()
legend = plt.legend(h0+h2, l0+l2, ncol=2, loc=1) 
set_legend_linewidth(legend) 
ax.set(xlim=[pd.to_datetime("05.01.17 00:00:00"),pd.to_datetime("30.04.18 23:59:00")])
monthlyX(ax)
plt.savefig(output_folder + '/' + file_name + '_Abluftfeuchte.pdf') 

Plot Nacherhitzer

daten['L_Nacherhitzer_delta'] = daten['L_Nacherhitzer_VL'] - daten['L_Nacherhitzer_RL']

fig, ax = plt.subplots()

daten['L_Nacherhitzer_VL'].plot(ax=ax,color=colo('rot',1), linewidth=0.5, label = 'Nacherhitzer VL') 
daten['L_Nacherhitzer_RL'].plot(ax=ax,color=colo('grün',1), linewidth=0.5, label = 'Nacherhitzer RL')   

ax2 = ax.twinx()
daten['L_Nacherhitzer_delta'].plot(ax=ax2,color=colo('blau',1), linewidth=0.5, label = r'Nacherhitzer $\Delta$T')  
ax2.set_ylabel(r'\textbf{Temperatur} ($^\circ$C)') 

ax.set_ylabel(r'\textbf{Temperatur} ($^\circ$C)') 
ax.set(ylim=20) 
ax2.set_ylim(-30,20)
ax2.axhline(y=0, linewidth=0.4, color='black', xmin=0.01, xmax=1)
ax.set_xlabel('')
ax.set(xlim=[pd.to_datetime("05.01.17 00:00:00"),pd.to_datetime("30.04.18 23:59:00")])
monthlyX(ax)
h0, l0 = ax.get_legend_handles_labels()
h2, l2 = ax2.get_legend_handles_labels()
legend = plt.legend(h0+h2, l0+l2, ncol=3, loc=1)   
set_legend_linewidth(legend) 

plt.savefig(output_folder + '/' + file_name + '_Nacherhitzer.pdf')

Plot Lufttemperaturen

## Lufttemperaturen alle Werte 
fig, ax = plt.subplots()
daten['L_Zulufttemperatur'].plot(ax=ax,color=colo('rot',1), linewidth=0.5, label = 'Zuluft') 
daten['L_Ablufttemperatur'].plot(ax=ax,color=colo('grün',1), linewidth=0.5, label = 'Abluft') 
daten['L_Fortlufttemperatur'].plot(ax=ax,color=colo('blau',1), linewidth=0.5, label = 'Fortluft')  
daten['L_Aussenlufttemperatur_1'].plot(ax=ax,color='xkcd:tangerine', linewidth=0.5, label = 'Außenlufttemperatur 1') 

ax.set_ylabel(r'\textbf{Temperatur} ($^\circ$C)') 
ax.set(ylim=-10) 
ax.set_xlabel('')
ax.xaxis.set_tick_params(width=0.5)
ax.yaxis.set_tick_params(width=0.5) 
h0, l0 = ax.get_legend_handles_labels() 
legend = plt.legend(h0, l0, ncol=4, loc=1) 
set_legend_linewidth(legend) 
ax.set(xlim=[pd.to_datetime("05.01.17 00:00:00"),pd.to_datetime("30.04.18 23:59:00")])
monthlyX(ax)
plt.savefig(output_folder + '/' + file_name + '_Lufttemperaturen.pdf') 


 ## Lufttemperaturen Tagesdurschschnitt 
fig, ax = plt.subplots()
daten['L_Zulufttemperatur'].resample('D').mean().plot(ax=ax,color=colo('rot',1), linewidth=0.5, label = 'Zuluft') 
daten['L_Ablufttemperatur'].resample('D').mean().plot(ax=ax,color=colo('grün',1), linewidth=0.5, label = 'Abluft') 
daten['L_Fortlufttemperatur'].resample('D').mean().plot(ax=ax,color=colo('blau',1), linewidth=0.5, label = 'Fortluft')  
daten['L_Aussenlufttemperatur_1'].resample('D').mean().plot(ax=ax,color='xkcd:tangerine', linewidth=0.5, label = 'Außenlufttemperatur 1') 

ax.set_ylabel(r'\textbf{Temperatur} ($^\circ$C)') 
ax.set(ylim=-10) 
ax.set_xlabel('')
ax.xaxis.set_tick_params(width=0.5)
ax.yaxis.set_tick_params(width=0.5) 
h0, l0 = ax.get_legend_handles_labels() 
legend = plt.legend(h0, l0, ncol=4, loc=1) 
set_legend_linewidth(legend) 
ax.set(xlim=[pd.to_datetime("05.01.17 00:00:00"),pd.to_datetime("30.04.18 23:59:00")])
monthlyX(ax)
plt.savefig(output_folder + '/' + file_name + '_Lufttemperaturen.pdf') 

Save & Upload

## Skriptlaufzeit Ende (Funktion in: libraries_and_styles.ipynb)
hours, minutes, seconds = laufzeit()
## Notebook speichern vor dem Upload (Funktion in: libraries_and_styles.ipynb)
save_notebook() 
## Notebook als Markdown Datei mit eingebetten Grafiken speichern und auf den Server laden
%run ../Template/save_and_upload.ipynb  
 Uebersicht_Hydraulikkreise Lueftung_Sommer_Winter