def show_load_profile(self, window): """ Build & display the load profile graphic """ elp = self.get_load_profile() dmd_hrs = len(elp.loc[elp['Total'] > 0]) if dmd_hrs > 0: pls = 'Peak Hourly Load KW: Total= {0:4.2f},\tAC= {1:4.2f},\tDC= {2:4.2f}' pl = pls.format( max(elp['Total']) / 1000, (max(elp['AC'])) / 1000, (max(elp['DC'])) / 1000) tdls = 'Daily Load KW: Total= {0:4.2f},\tAC= {1:4.2f},\tDC= {2:4.2f}' tdl = tdls.format( sum(elp['Total']) / 1000, sum(elp['AC']) / 1000, sum(elp['DC']) / 1000) avhs = 'Avg Hourly Load KW: Total= {0:4.2f},\tAC= {1:4.2f},\tDC= {2:4.2f}' avhl = avhs.format( sum(elp['Total']) / (1000 * dmd_hrs), sum(elp['AC']) / (1000 * dmd_hrs), sum(elp['DC']) / (1000 * dmd_hrs)) pltlist = [{ 'label': 'Load', 'data': np.array(elp['Total']), 'type': 'Bar', 'color': 'grey', 'width': 0.4, 'xaxis': np.array([x for x in range(24)]) }] tbf.plot_graphic(window, 'Hour of Day', 'Watts', np.array([x for x in range(24)]), pltlist, 'Hourly Electrical Use Profile', (6, 4), text_inserts=[pl, tdl, avhl])
def show_array_worst_day(self): """ Create graphic of Solar Array Worst Day Performance """ if self.array_out is not None: worst_day_perform = self.array_out.loc[self.array_out['DayofYear'] == self.mnthly_array_perfm[2]] xlabels = np.arange(24) pltslist = [{'label': 'Array Power', 'data': worst_day_perform['ArrayPower'], 'type': 'Line', 'xaxis': xlabels, 'width': 2.0, 'color': 'b'}, {'label': 'Hourly Load', 'data': worst_day_perform['Total_Load'], 'type': 'Line', 'xaxis': xlabels , 'width': 2.0, 'color': 'r'}] tbf.plot_graphic(self.rdw, 'Time of Day', 'Watts', xlabels, pltslist, 'Worst Day Array Output', (6,4))
def show_array_performance(self): """ Create graphic of Annual Solar Array Performance """ if self.array_out is not None: mpi = self.mnthly_array_perfm[0] xaxis = np.arange(1,13) pltslist = [{'label':'Avg Power', 'data':mpi.loc[:,'Avg ArrayPower'], 'type': 'Bar', 'color': 'b', 'width': 0.2, 'xaxis': xaxis}, {'label':'Best Power', 'data':mpi.loc[:,'Best ArrayPower'], 'type': 'Bar', 'color': 'g', 'width': 0.2, 'xaxis':np.arange(1,13) - 0.2}, {'label':'Worst Power', 'data':mpi.loc[:,'Worst ArrayPower'], 'type': 'Bar', 'color': 'y', 'width': 0.3, 'offset': 0.3, 'xaxis':np.arange(1,13) + 0.2}, {'label':'Daily Load', 'data':mpi.loc[:,'Daily Load'], 'type': 'Line', 'color': 'r', 'xaxis': xaxis, 'width': 4.0, 'linestyle': 'solid' } ] tbf.plot_graphic(self.rdw, 'Month of Year', 'Watts', np.arange(1,13), pltslist, 'Annual Array Performance', (6,4))
def show_bank_overview(self): """ Create graphic of Battery Bank Overview Performance """ if self.master.power_flow is not None: ovr = self.create_overview() xlabels = ovr.index pltslist = [{ 'label': 'Sunrise', 'data': ovr['Sunrise'], 'type': 'Line', 'xaxis': xlabels, 'width': 2.0, 'color': 'r' }, { 'label': 'Sunset', 'data': ovr['Sunset'], 'type': 'Line', 'xaxis': xlabels, 'width': 2.0, 'color': 'b' }] dp = plot_graphic(self.master.rdw, 'Month', 'SOC', xlabels, pltslist, 'Bank SOC', (6, 4))
def show_bank_soc(self): """ Create graphic of Battery Bank SOC Performance """ if self.master.power_flow is not None: xlabels = np.arange(24) pltslist = [{ 'label': 'Best Day SOC', 'data': self.master.power_flow['BatSoc'].loc[ self.master.power_flow['DayofYear'] == self.master.mnthly_pwr_perfm[1]], 'type': 'Line', 'xaxis': xlabels, 'width': 2.0, 'color': 'b' }, { 'label': 'Worst Day SOC', 'data': self.master.power_flow['BatSoc'].loc[ self.master.power_flow['DayofYear'] == self.master.mnthly_pwr_perfm[2]], 'type': 'Line', 'xaxis': xlabels, 'width': 2.0, 'color': 'r' }] dp = plot_graphic(self.master.rdw, 'Time of Day', 'SOC', xlabels, pltslist, 'Range of Bank SOC', (6, 4))