Übersicht_Hydraulikkreise

Bibliotheken importieren

# Name des aktuellen Notebooks für die exportierten Datein
file_name = "Uebersicht_Hydraulikkreise" 
# 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)

Daten Import

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

Messdaten = daten[['S_Solar_VL', 'S_Solar_RL','S_Solar_Vpunkt', 
                   'S_Heizung_VL', 'S_Heizung_RL', 'S_Heizung_Vpunkt',
                   'S_Kessel_VL', 'S_Kessel_RL', 'S_Kessel_Vpunkt', 
                   'S_FriWa_VL_Sek','S_FriWa_RL_Sek', 'S_FriWa_Vpunkt_Sek', 
                   'S_FriWa_VL_Prim','S_FriWa_RL_Prim', 'S_FriWa_Vpunkt_Prim','S_Gas_Vpunkt','S_Solarstrahlung']]

Plot Solar

fig, ax = plt.subplots()
Messdaten['S_Solar_VL'].plot(ax=ax,color=colo('rot',1), linewidth=0.5, label = 'Solar VL')
Messdaten['S_Solar_RL'].plot(ax=ax,color=colo('blau',1),linewidth=0.5, label = 'Solar RL')
ax.set_ylabel(r'\textbf{Temperatur} ($^\circ$C)')

ax2 = ax.twinx()
Messdaten['S_Solar_Vpunkt'].plot(ax=ax2,color=colo('grün',1),linewidth=0.5,alpha = 0.5,label = r'Solar \.V')
ax2.set_ylabel(r'\textbf{Volumenstrom} (l/h)')

ax.set(xlim=[pd.to_datetime("05.01.17 00:00:00"),pd.to_datetime("30.04.18 23:00:00")])
ax.set(ylim=0)
ax2.set(ylim=0)
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=3, loc=1)
set_legend_linewidth(legend) 

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

Plot Heizung

fig, ax = plt.subplots()

Messdaten['S_Heizung_VL'].plot(ax=ax,color=colo('rot',1), linewidth=0.5, label = 'Heizung VL')
Messdaten['S_Heizung_RL'].plot(ax=ax,color=colo('blau',1),linewidth=0.5, label = 'Heizung RL')
ax.set_ylabel(r'\textbf{Temperatur} ($^\circ$C)')

ax2 = ax.twinx()
Messdaten['S_Heizung_Vpunkt'].plot(ax=ax2,color=colo('grün',1),linewidth=0.5,label = r'Heizung \.V')
ax2.set_ylabel(r'\textbf{Volumenstrom} (l/h)')

ax.set(xlim=[pd.to_datetime("05.01.17 00:00:00"),pd.to_datetime("30.04.18 23:00:00")])
ax.set(ylim=0)
ax2.set(ylim=0)
ax2.get_yaxis().set_major_formatter(mpl.ticker.FuncFormatter(lambda x, loc: locale.format_string('%d', x, 1))) ## dot as thousand separator
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=3, loc=1)
set_legend_linewidth(legend) 

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

Plot Kessel

fig, ax = plt.subplots()
Messdaten['S_Kessel_VL'].plot(ax=ax,color=colo('rot',1), linewidth=0.5, label = 'Kessel VL')
Messdaten['S_Kessel_RL'].plot(ax=ax,color=colo('blau',1),linewidth=0.5, label = 'Kessel RL')
ax.set_ylabel(r'\textbf{Temperatur} ($^\circ$C)')

ax2 = ax.twinx()
Messdaten['S_Kessel_Vpunkt'].plot(ax=ax2,color=colo('grün',1),linewidth=0.5,alpha = 0.5,label = r'Kessel \.V')
ax2.set_ylabel(r'\textbf{Volumenstrom} (l/h)')

ax.set(xlim=[pd.to_datetime("05.01.17 00:00:00"),pd.to_datetime("30.04.18 23:00:00")])
ax.set(ylim=0)
ax2.set(ylim=0)
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=3, loc=1)
set_legend_linewidth(legend) 

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

Plot FriWa Sek

fig, ax = plt.subplots()

Messdaten['S_FriWa_VL_Sek'].plot(ax=ax,color=colo('rot',1), linewidth=0.5, label = 'FriWa Sek VL')
Messdaten['S_FriWa_RL_Sek'].plot(ax=ax,color=colo('blau',1),linewidth=0.5, label = 'FriWa Sek RL')
ax.set_ylabel(r'\textbf{Temperatur} ($^\circ$C)')

ax2 = ax.twinx()
Messdaten['S_FriWa_Vpunkt_Sek'].plot(ax=ax2,color=colo('grün',1),linewidth=0.5, label = r'FriWa_Sek \.V')
ax2.set_ylabel(r'\textbf{Volumenstrom} (l/h)')

ax.set(xlim=[pd.to_datetime("05.01.17 00:00:00"),pd.to_datetime("30.04.18 23:00:00")])
ax.set(ylim=0)
ax2.set(ylim=0)
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=3, loc=1) 
set_legend_linewidth(legend) 

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

Plot FriWa Prim

fig, ax = plt.subplots()
Messdaten['S_FriWa_VL_Prim'].plot(ax=ax,color=colo('rot',1), linewidth=0.5, label = 'FriWa Prim VL')
Messdaten['S_FriWa_RL_Prim'].plot(ax=ax,color=colo('blau',1),linewidth=0.5, label = 'FriWa Prim RL')
ax.set_ylabel(r'\textbf{Temperatur} ($^\circ$C)')

ax2 = ax.twinx()
Messdaten['S_FriWa_Vpunkt_Prim'].plot(ax=ax2,color=colo('grün',1),linewidth=0.5, label = r'FriWa_Prim \.V')
ax2.set_ylabel(r'\textbf{Volumenstrom} (l/h)')

ax.set(xlim=[pd.to_datetime("05.01.17 00:00:00"),pd.to_datetime("30.04.18 23:00:00")])
ax.set(ylim=0)
ax2.set(ylim=0)
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=3, loc=1)
set_legend_linewidth(legend) 

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

Plot Solar vs Gas

Woche = pd.DataFrame() 
Woche['S_Solarstrahlung'] = Messdaten['S_Solarstrahlung'].resample('D').mean()
Woche['S_Gas_Vpunkt'] = Messdaten['S_Gas_Vpunkt'].resample('D').sum() 

fig, ax = plt.subplots()
Woche['S_Solarstrahlung'].plot(ax=ax,color=colo('orange',1), linewidth=0.8, label = 'Solarstrahlung') 
ax.set_ylabel(r'\textbf{Leistung} [W/m2]')
ax.set(ylim=0)

ax2 = ax.twinx()
Woche['S_Gas_Vpunkt'].plot(ax=ax2,color=colo('blau',1),linewidth=0.8,label = r'Gas \.V')
ax2.set_ylabel(r'\textbf{Volumenstrom} (l/h)') 

ax2.set(ylim=0)
ax.set_xlabel('') 
ax2.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=2, loc=1)
set_legend_linewidth(legend) 

plt.savefig(output_folder + '/' + file_name + '_Solar_vs_Gas.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  
 WRG_Effizienz Analyse_RLT