Commit 2f5a9d3f authored by Winstead, Christopher's avatar Winstead, Christopher
Browse files

Merge branch 'master' of https://code.ornl.gov/evw/EnergyPlus-PBC

parents 5046d686 2556f5a4
import pandas as pd
import matplotlib.pyplot as plt
import os
import numpy as np
files = [f for f in os.listdir('./buildings') if os.path.isfile('./buildings/'+f+'/'+f)]
fl = files[0]
print(fl)
eso = pd.read_csv('buildings/'+fl+'/eplusout.eso', engine='python', names='abcdefghijk')
indexes = eso[eso['d']=='Zone Air Temperature [C] !TimeStep']
indexes = indexes['a'].tolist()
temps = eso[eso['a']==indexes[0]]['b']
indexes.pop(0)
temps.reset_index(drop=True, inplace=True)
for idx in indexes:
tmp_temp = eso[eso['a']==idx]['b']
tmp_temp = pd.DataFrame(tmp_temp)
tmp_temp.reset_index(drop=True, inplace=True)
temps = pd.concat([temps, tmp_temp], axis=1, ignore_index=True)
#temps = temps[2881:]
#temps = temps.convert_objects(convert_numeric=True)
temps.reset_index(drop=True, inplace=True)
files.pop(0)
for idf, fl in enumerate(files):
eso = pd.read_csv('buildings/'+fl+'/eplusout.eso', engine='python', names='abcdefghijk')
indexes = eso[eso['d']=='Zone Air Temperature [C] !TimeStep']
indexes = indexes['a'].tolist()
for idx in indexes:
tmp_temp = eso[eso['a']==idx]['b']
tmp_temp = pd.DataFrame(tmp_temp)
tmp_temp.reset_index(drop=True, inplace=True)
temps = pd.concat([temps, tmp_temp], axis=1, ignore_index=True)
temps = temps[2881:]
temps = temps.convert_objects(convert_numeric=True)
temps.reset_index(drop=True, inplace=True)
temps.plot()
plt.plot([i for i in range(0,1440)], [23.8889 for i in range(0,1440)], '--b')
plt.plot([i for i in range(0,1440)], [24.7222 for i in range(0,1440)], '--r')
files = [f for f in os.listdir('./buildings') if os.path.isfile('./buildings/'+f+'/'+f)]
fl = files[0]
eso = pd.read_csv('buildings/'+fl+'/eplusout.eso', engine='python', names='abcdefghijk')
indexes = eso[eso['d']=='Zone Thermostat Cooling Setpoint Temperature [C] !TimeStep']
indexes = indexes['a'].tolist()
temps = eso[eso['a']==indexes[0]]['b']
indexes.pop(0)
temps.reset_index(drop=True, inplace=True)
for idx in indexes:
tmp_temp = eso[eso['a']==idx]['b']
tmp_temp = pd.DataFrame(tmp_temp)
tmp_temp.reset_index(drop=True, inplace=True)
temps = pd.concat([temps, tmp_temp], axis=1, ignore_index=True)
temps = temps[2881:]
temps = temps.convert_objects(convert_numeric=True)
temps.reset_index(drop=True, inplace=True)
files.pop(0)
for idf, fl in enumerate(files):
eso = pd.read_csv('buildings/'+fl+'/eplusout.eso', engine='python', names='abcdefghijk')
indexes = eso[eso['d']=='Zone Thermostat Cooling Setpoint Temperature [C] !TimeStep']
indexes = indexes['a'].tolist()
for idx in indexes:
tmp_temp = eso[eso['a']==idx]['b']
tmp_temp = pd.DataFrame(tmp_temp)
tmp_temp.reset_index(drop=True, inplace=True)
temps = pd.concat([temps, tmp_temp], axis=1, ignore_index=True)
temps = temps[2881:]
temps = temps.convert_objects(convert_numeric=True)
temps.reset_index(drop=True, inplace=True)
temps.plot()
onOff = temps.copy()
#onOff[onOff > 23.89] = 1
#onOff[onOff < 23.89] = 0
onOff.replace(30.0, 0, inplace=True)
onOff.replace(16.0, 1, inplace=True)
numUnits = onOff.sum(axis=1)
plt.figure(3)
numUnits.plot(label=None)
print(numUnits)
# HVAC Electricity #
files = [f for f in os.listdir('./buildings') if os.path.isfile('./buildings/'+f+'/'+f)]
fl = files[0]
print(fl)
eso = pd.read_csv('buildings/'+fl+'/eplusout.mtr', engine='python', names='abcdefghijk')
indexes = eso[eso['c']=='Electricity:Facility [J] !TimeStep']
indexes = indexes['a'].tolist()
temps = eso[eso['a']==indexes[0]]['b']
indexes.pop(0)
temps.reset_index(drop=True, inplace=True)
for idx in indexes:
tmp_temp = eso[eso['a']==idx]['b']
tmp_temp = pd.DataFrame(tmp_temp)
tmp_temp.reset_index(drop=True, inplace=True)
temps = pd.concat([temps, tmp_temp], axis=1, ignore_index=True)
temps = temps[2881:]
temps = temps.convert_objects(convert_numeric=True)
temps.reset_index(drop=True, inplace=True)
files.pop(0)
for idf, fl in enumerate(files):
eso = pd.read_csv('buildings/'+fl+'/eplusout.mtr', engine='python', names='abcdefghijk')
indexes = eso[eso['c']=='Electricity:Facility [J] !TimeStep']
indexes = indexes['a'].tolist()
for idx in indexes:
tmp_temp = eso[eso['a']==idx]['b']
tmp_temp = pd.DataFrame(tmp_temp)
tmp_temp.reset_index(drop=True, inplace=True)
temps = pd.concat([temps, tmp_temp], axis=1, ignore_index=True)
temps = temps[2881:]
temps = temps.convert_objects(convert_numeric=True)
temps.reset_index(drop=True, inplace=True)
temps2 = temps.sum(axis=1)
print(max(temps2)/60.0/1000.0)
plt.figure(5)
temps2.plot()
plt.show()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment