def capacityAtLC(self): # EXCEL CALCULATION - Capacity at Load Center - Off Peak self.offPeakCapAtLC = list() for i in range(len(self.offPeakComputedCap)): self.offPeakCapAtLC.append([ self.offPeakComputedCap[i][0], self.offPeakComputedCap[i][1] * (1.0 + self.transmissionLoss[i][1]) ]) HEC.setDssTsValues( self.outputDSS, self.offPeakCapAtLC, self.start, "/HYDROPOWER/%s/%s//1MON/CAPACITY-AT-LC/" % (self.facility, "OFF-PEAK-CAPACITY"), 0, "MW", "POWER") # EXCEL CALCULATION - Capacity at Load Center - Off Peak self.onPeakCapAtLC = list() for i in range(len(self.onPeakComputedCap)): self.onPeakCapAtLC.append([ self.onPeakComputedCap[i][0], self.onPeakComputedCap[i][1] * (1.0 + self.transmissionLoss[i][1]) ]) HEC.setDssTsValues( self.outputDSS, self.onPeakCapAtLC, self.start, "/HYDROPOWER/%s/%s//1MON/CAPACITY-AT-LC/" % (self.facility, "ON-PEAK-CAPACITY"), 0, "MW", "POWER")
def getData(self): fl = HEC.openDSS(self.dvFile) if (isinstance(self.pumpingPath, list)): self.pumpingTS = HEC.summation(fl, self.pumpingPath, self.start, self.end) elif not (self.pumpingPath) and self.volInPath and self.volOutPath: self.volIn = HEC.getDssTsValues(fl, self.volInPath, self.start, self.end) self.volOut = HEC.getDssTsValues(fl, self.volOutPath, self.start, self.end) self.pumpingTS = list() for i in range(len(self.volIn)): self.pumpingTS.append([ self.volIn[i][0], max(self.volIn[i][1] - self.volOut[i][1], 0.0) ]) else: self.pumpingTS = HEC.getDssTsValues(fl, self.pumpingPath, self.start, self.end) fl.close()
def actualEnergyAtLC(self): # EXCEL CALCULATION - POPULATE ELC Loss self.percentLoss = list() for q in self.releaseTS: self.percentLoss.append([ q[0], float(self.characteristics.transmissionLoss[self.months[ q[0].getMonth()]]) ]) HEC.setDssTsValues( self.outputDSS, self.percentLoss, self.start, "/HYDROPOWER/%s/%s//1MON/ENERGY-AT-LC/" % (self.facility, "PERCENT-LOSS"), 0, "PERCENT", "LOSS") # EXCEL CALCULATION - POPULATE ELC Total Energy self.ELCTotal = list() revenue = list() for i in range(len(self.EPCEnergy)): self.ELCTotal.append([ self.EPCEnergy[i][0], self.EPCEnergy[i][1] * (1.0 - self.percentLoss[i][1]) ]) revenue.append([ self.EPCEnergy[i][0], self.EPCEnergy[i][1] * (1.0 - self.percentLoss[i][1]) * 0.5 * (float(a.onPeak[str(self.EPCEnergy[i][0].getMonth() + 1)]) + float(a.offPeak[str(self.EPCEnergy[i][0].getMonth() + 1)])) ]) HEC.setDssTsValues( self.outputDSS, self.ELCTotal, self.start, "/HYDROPOWER/%s/%s//1MON/ENERGY-AT-LC/" % (self.facility, "TOTAL"), 0, "GW-Hour", "ENERGY") HEC.setDssTsValues( self.outputDSS, revenue, self.start, "/HYDROPOWER/%s/%s//1MON/ECONOMICS/" % (self.facility, "GENERATION-REVENUE"), 0, "$1,000", "REVENUE") # EXCEL CALCULATION - POPULATE ELC Total Energy self.ELCLosses = list() for i in range(len(self.EPCEnergy)): self.ELCLosses.append([ self.EPCEnergy[i][0], self.EPCEnergy[i][1] - self.ELCTotal[i][1] ]) HEC.setDssTsValues( self.outputDSS, self.ELCLosses, self.start, "/HYDROPOWER/%s/%s//1MON/ENERGY-AT-LC/" % (self.facility, "LOSSES"), 0, "GW-Hour", "ENERGY")
def getCfs2Taf(self): self.cfs2taf = {} for q in self.pumpingTS: self.cfs2taf[q[0]] = 0.001 * 24.0 * 60.0 * 60.0 * float( HEC.getDaysInMonth(q[0])) / 43560.0
def capacityAtLC(self): # EXCEL CALCULATION - POPULATE Capacity at Load Center self.capAtLC = list() for i in range(len(self.percentLoss)): self.capAtLC.append([ self.percentLoss[i][0], self.availCap[i][1] * (1.0 - self.percentLoss[i][1]) ]) HEC.setDssTsValues( self.outputDSS, self.capAtLC, self.start, "/HYDROPOWER/%s/%s//1MON/CAPACITY-AT-LC/" % (self.facility, "TOTAL"), 0, "MW", "POWER")
def getData(self): fl = HEC.openDSS(self.dvFile) if self.storPath and len(self.storPath) == 2: self.storageTS0 = HEC.getDssTsValues(fl, self.storPath[0], self.start, self.end) self.storageTS1 = HEC.getDssTsValues(fl, self.storPath[1], self.start, self.end) elif self.storPath and len(self.storPath) == 3: self.storageTS0 = HEC.getDssTsValues(fl, self.storPath[0], self.start, self.end) self.storageTS1 = HEC.getDssTsValues(fl, self.storPath[1], self.start, self.end) self.storageTS2 = HEC.getDssTsValues(fl, self.storPath[2], self.start, self.end) elif self.storPath: self.storageTS = HEC.getDssTsValues(fl, self.storPath, self.start, self.end) self.releaseTS = HEC.getDssTsValues(fl, self.releasePath, self.start, self.end) if self.flowInPath: self.flowInTS = HEC.getDssTsValues(fl, self.flowInPath, self.start, self.end) if self.facility in ["oNeilPP", "cvpSanLuisPP", "swpSanLuisPP"]: self.genReleaseTS = list() for i in range(len(self.flowInTS)): self.genReleaseTS.append([ self.flowInTS[i][0], max(self.releaseTS[i][1] - self.flowInTS[i][1], 0) ]) fl.close()
from pumpPlant import pumpPlant from ratings import * import HEC import glob import os import sys # dvFile = sys.argv[1] # Gets file name as the first parameter from command line dvFile = "../../Scenarios/DCR2015_Base_ExistingNoCC_DV.dss" outputDSS = os.path.basename(dvFile).split('.')[0] + "_LtGen.dss" start = "31OCT1921 2400" end = "30SEP2003 2400" fPart = "2020D09E" aPart = "CALSIM" outputDSS = HEC.openDSS(outputDSS) ##########___POWER PLANTS___########## CVPPowerFacilities = dict() for fl in glob.glob("./tables/CVPFacilities/*PP.in"): CVPPowerFacilities[os.path.basename(fl).split(".in")[0]] = characteristics( fl) trinity = powerPlant( facility="trinityPP", dv=dvFile, outputDSS=outputDSS, storage="/%s/S1/STORAGE//1MON/%s/" % (aPart, fPart), release="/%s/C1/FLOW-CHANNEL//1MON/%s/" % (aPart, fPart), start=start,
def pumpingEnergyAtLC(self): # EXCEL CALCULATION - Actual Pumping Use at Load Center - Transmission Loss self.transmissionLoss = list() for q in self.pumpingTS: self.transmissionLoss.append([ q[0], float(self.characteristics.transmissionLoss[self.months[ q[0].getMonth()]]) ]) HEC.setDssTsValues( self.outputDSS, self.transmissionLoss, self.start, "/HYDROPOWER/%s/%s//1MON/PUMPING-AT-LC/" % (self.facility, "PERCENT-LOSS"), 0, "PERCENT", "LOSS") # EXCEL CALCULATION - Actual Pumping Use at Load Center - Total Energy self.totalEnergy = list() for i in range(len(self.totalPumpingEnergy)): self.totalEnergy.append([ self.totalPumpingEnergy[i][0], self.totalPumpingEnergy[i][1] * (1.0 + self.transmissionLoss[i][1]) ]) HEC.setDssTsValues( self.outputDSS, self.totalEnergy, self.start, "/HYDROPOWER/%s/%s//1MON/PUMPING-AT-LC/" % (self.facility, "TOTAL-PUMPING-ENERGY"), 0, "GW-Hour", "ENERGY") # EXCEL CALCULATION - Actual Pumping Use at Load Center - Off Peak Energy self.offPeakEnergy = list() offPeakCost = list() for i in range(len(self.offPeakEnergyActual)): self.offPeakEnergy.append([ self.offPeakEnergyActual[i][0], self.offPeakEnergyActual[i][1] * (1.0 + self.transmissionLoss[i][1]) ]) offPeakCost.append([ self.offPeakEnergyActual[i][0], self.offPeakEnergy[i][1] * float(a.offPeak[str(self.offPeakEnergyActual[i][0].getMonth() + 1)]) ]) HEC.setDssTsValues( self.outputDSS, self.offPeakEnergy, self.start, "/HYDROPOWER/%s/%s//1MON/PUMPING-AT-LC/" % (self.facility, "OFF-PEAK-TOTAL-PUMPING-ENERGY"), 0, "GW-Hour", "ENERGY") #HEC.setDssTsValues (self.outputDSS, offPeakCost , self.start, "/HYDROPOWER/%s/%s//1MON/ECONOMICS/" % (self.facility, "OFF-PEAK-COST"), 0, "$1,000", "COST") # EXCEL CALCULATION - Actual Pumping Use at Load Center - On Peak Energy self.onPeakEnergy = list() onPeakCost = list() for i in range(len(self.onPeakEnergyActual)): self.onPeakEnergy.append([ self.onPeakEnergyActual[i][0], self.onPeakEnergyActual[i][1] * (1.0 + self.transmissionLoss[i][1]) ]) onPeakCost.append([ self.pumpingTS[i][0], self.onPeakEnergyActual[i][1] * (1.0 + self.transmissionLoss[i][1]) * float(a.onPeak[str(self.pumpingTS[i][0].getMonth() + 1)]) ]) HEC.setDssTsValues( self.outputDSS, self.onPeakEnergy, self.start, "/HYDROPOWER/%s/%s//1MON/PUMPING-AT-LC/" % (self.facility, "ON-PEAK-TOTAL-PUMPING-ENERGY"), 0, "GW-Hour", "ENERGY") HEC.setDssTsValues( self.outputDSS, onPeakCost, self.start, "/HYDROPOWER/%s/%s//1MON/ECONOMICS/" % (self.facility, "ON-PEAK-COST"), 0, "$1,000", "COST") # EXCEL CALCULATION - Actual Pumping Use at Load Center - Losses self.losses = list() for i in range(len(self.totalPumpingEnergy)): self.losses.append([ self.totalPumpingEnergy[i][0], self.totalEnergy[i][1] - self.totalPumpingEnergy[i][1] ]) HEC.setDssTsValues( self.outputDSS, self.losses, self.start, "/HYDROPOWER/%s/%s//1MON/PUMPING-AT-LC/" % (self.facility, "LOSSES"), 0, "GW-Hour", "LOSS")
def computedCapacity(self): # EXCEL CALCULATION - Computed Capacity - Off-Peak Energy self.offPeakComputedCap = list() for i in range(len(self.offPeakEnergyActual)): if self.noUnits[i][1] < 0.5: self.offPeakComputedCap.append([ self.offPeakEnergyActual[i][0], 1000.0 * self.offPeakAdj[i][1] * self.offPeakEnergyActual[i][1] / float(peak.offPeakHours[ str(1900 + self.offPeakEnergyActual[i][0].getYear() + 0.01 * (self.offPeakEnergyActual[i][0].getMonth() + 1))]) ]) elif (math.ceil( 1000.0 * self.offPeakEnergyActual[i][1] * self.offPeakAdj[i][1] / float(peak.offPeakHours[ str(1900 + self.offPeakEnergyActual[i][0].getYear() + 0.01 * (self.offPeakEnergyActual[i][0].getMonth() + 1))]) > self.maxPossibleCap[i][1])): self.offPeakComputedCap.append([ self.offPeakEnergyActual[i][0], self.maxPossibleCap[i][1] ]) else: self.offPeakComputedCap.append([ self.offPeakEnergyActual[i][0], math.ceil( 1000.0 * self.offPeakEnergyActual[i][1] * self.offPeakAdj[i][1] / float(peak.offPeakHours[str( 1900 + self.offPeakEnergyActual[i][0].getYear() + 0.01 * (self.offPeakEnergyActual[i][0].getMonth() + 1))]) / self.unitCap[i][1]) * self.unitCap[i][1] ]) HEC.setDssTsValues( self.outputDSS, self.offPeakComputedCap, self.start, "/HYDROPOWER/%s/%s//1MON/COMPUTED-CAPACITY/" % (self.facility, "OFF-PEAK-CAPACITY"), 0, "MW", "POWER") # EXCEL CALCULATION - Computed Capacity - On-Peak Energy self.onPeakComputedCap = list() for i in range(len(self.onPeakEnergyActual)): if self.noUnits[i][1] < 0.5: self.onPeakComputedCap.append([ self.onPeakEnergyActual[i][0], 1000.0 * self.onPeakAdj[i][1] * self.onPeakEnergyActual[i][1] / float(peak.onPeakHours[str( 1900 + self.onPeakEnergyActual[i][0].getYear() + 0.01 * (self.onPeakEnergyActual[i][0].getMonth() + 1))]) ]) elif (math.ceil( 1000.0 * self.onPeakEnergyActual[i][1] * self.onPeakAdj[i][1] / float(peak.onPeakHours[str( 1900 + self.onPeakEnergyActual[i][0].getYear() + 0.01 * (self.onPeakEnergyActual[i][0].getMonth() + 1))]) > self.maxPossibleCap[i][1])): self.onPeakComputedCap.append( [self.onPeakEnergyActual[i][0], self.maxPossibleCap[i][1]]) else: self.onPeakComputedCap.append([ self.onPeakEnergyActual[i][0], math.ceil( 1000.0 * self.onPeakEnergyActual[i][1] * self.onPeakAdj[i][1] / float(peak.onPeakHours[str( 1900 + self.onPeakEnergyActual[i][0].getYear() + 0.01 * (self.onPeakEnergyActual[i][0].getMonth() + 1))]) / self.unitCap[i][1]) * self.unitCap[i][1] ]) HEC.setDssTsValues( self.outputDSS, self.onPeakComputedCap, self.start, "/HYDROPOWER/%s/%s//1MON/COMPUTED-CAPACITY/" % (self.facility, "ON-PEAK-CAPACITY"), 0, "MW", "POWER")
def energyComputation(self): # EXCEL CALCULATION - Total Pumping Energy self.totalPumpingEnergy = list() for i in range(len(self.pumpingTS)): self.totalPumpingEnergy.append([ self.pumpingTS[i][0], .001 * self.pumpingTS[i][1] * self.cfs2taf[self.pumpingTS[i][0]] * self.energyFactor[i][1] ]) HEC.setDssTsValues( self.outputDSS, self.totalPumpingEnergy, self.start, "/HYDROPOWER/%s/%s//1MON/ENERGY-COMPUTATION/" % (self.facility, "TOTAL-PUMPING-ENERGY"), 0, "GW-Hour", "ENERGY") # EXCEL CALCULATION - Off-Peak Energy - Desired self.offPeakEnergyDesired = list() for i in range(len(self.totalPumpingEnergy)): self.offPeakEnergyDesired.append([ self.totalPumpingEnergy[i][0], self.totalPumpingEnergy[i][1] * self.offPeakPercent[i][1] ]) HEC.setDssTsValues( self.outputDSS, self.offPeakEnergyDesired, self.start, "/HYDROPOWER/%s/%s//1MON/ENERGY-COMPUTATION/" % (self.facility, "OFF-PEAK-ENERGY-DESIRED"), 0, "GW-Hour", "ENERGY") # EXCEL CALCULATION - Off-Peak Energy - Physical Max self.offPeakEnergyPhysicalMax = list() for p in self.maxPossibleCap: self.offPeakEnergyPhysicalMax.append([ p[0], 0.001 * p[1] * float(peak.offPeakHours[str(1900 + p[0].getYear() + 0.01 * (p[0].getMonth() + 1))]) ]) HEC.setDssTsValues( self.outputDSS, self.offPeakEnergyPhysicalMax, self.start, "/HYDROPOWER/%s/%s//1MON/ENERGY-COMPUTATION/" % (self.facility, "OFF-PEAK-ENERGY-PHYS-MAX"), 0, "GW-Hour", "ENERGY") # EXCEL CALCULATION - Off-Peak Energy - Actual self.offPeakEnergyActual = list() for i in range(len(self.noUnits)): if self.noUnits[i][1] < 0.5: self.offPeakEnergyActual.append( [self.noUnits[i][0], self.offPeakEnergyDesired[i][1]]) else: self.offPeakEnergyActual.append([ self.noUnits[i][0], min(self.offPeakEnergyDesired[i][1], self.offPeakEnergyPhysicalMax[i][1]) ]) HEC.setDssTsValues( self.outputDSS, self.offPeakEnergyActual, self.start, "/HYDROPOWER/%s/%s//1MON/ENERGY-COMPUTATION/" % (self.facility, "OFF-PEAK-ENERGY-ACTUAL"), 0, "GW-Hour", "ENERGY") # EXCEL CALCULATION - Off-Peak Energy - Energy Check self.offPeakEnergyCheck = list() for i in range(len(self.offPeakEnergyDesired)): self.offPeakEnergyCheck.append([ self.offPeakEnergyDesired[i][0], self.offPeakEnergyDesired[i][1] - self.offPeakEnergyActual[i][1] ]) HEC.setDssTsValues( self.outputDSS, self.offPeakEnergyCheck, self.start, "/HYDROPOWER/%s/%s//1MON/ENERGY-COMPUTATION/" % (self.facility, "OFF-PEAK-ENERGY-CHECK"), 0, "GW-Hour", "ENERGY") # EXCEL CALCULATION - On-Peak Energy - Desired self.onPeakEnergyDesired = list() for i in range(len(self.totalPumpingEnergy)): self.onPeakEnergyDesired.append([ self.totalPumpingEnergy[i][0], self.totalPumpingEnergy[i][1] - self.offPeakEnergyActual[i][1] ]) HEC.setDssTsValues( self.outputDSS, self.onPeakEnergyDesired, self.start, "/HYDROPOWER/%s/%s//1MON/ENERGY-COMPUTATION/" % (self.facility, "ON-PEAK-ENERGY-DESIRED"), 0, "GW-Hour", "ENERGY") # EXCEL CALCULATION - On-Peak Energy - Physical Max self.onPeakEnergyPhysicalMax = list() for p in self.maxPossibleCap: self.onPeakEnergyPhysicalMax.append([ p[0], 0.001 * p[1] * float(peak.onPeakHours[str(1900 + p[0].getYear() + 0.01 * (p[0].getMonth() + 1))]) ]) HEC.setDssTsValues( self.outputDSS, self.onPeakEnergyPhysicalMax, self.start, "/HYDROPOWER/%s/%s//1MON/ENERGY-COMPUTATION/" % (self.facility, "ON-PEAK-ENERGY-PHYS-MAX"), 0, "GW-Hour", "ENERGY") # EXCEL CALCULATION - On-Peak Energy - Actual self.onPeakEnergyActual = list() for i in range(len(self.noUnits)): if self.noUnits[i][1] < 0.5: self.onPeakEnergyActual.append( [self.noUnits[i][0], self.onPeakEnergyDesired[i][1]]) else: self.onPeakEnergyActual.append([ self.noUnits[i][0], min(self.onPeakEnergyDesired[i][1], self.onPeakEnergyPhysicalMax[i][1]) ]) HEC.setDssTsValues( self.outputDSS, self.onPeakEnergyActual, self.start, "/HYDROPOWER/%s/%s//1MON/ENERGY-COMPUTATION/" % (self.facility, "ON-PEAK-ENERGY-ACTUAL"), 0, "GW-Hour", "ENERGY") # EXCEL CALCULATION - On-Peak Energy - Energy Check self.onPeakEnergyCheck = list() for i in range(len(self.onPeakEnergyDesired)): self.onPeakEnergyCheck.append([ self.onPeakEnergyDesired[i][0], self.onPeakEnergyDesired[i][1] - self.onPeakEnergyActual[i][1] ]) HEC.setDssTsValues( self.outputDSS, self.onPeakEnergyCheck, self.start, "/HYDROPOWER/%s/%s//1MON/ENERGY-COMPUTATION/" % (self.facility, "On-PEAK-ENERGY-CHECK"), 0, "GW-Hour", "ENERGY")
def pumpChar(self): # EXCEL CALCULATION - Energy Factor self.energyFactor = list() if self.facility in [ "tracyPump", "cvpBanksPump", "contraCostaPump", "cvpDosAmigosPump", "corningPump", "redBluffPump", "dmcIntertiePump", "sanLuisOtherPump", "dmcOtherPump", "tcOtherPump", "oNeillPump", "banksPump", "swpDosAmigosPump", "buenaVistaPump", "teerinkPump", "chrismanPump", "edmonstonPump", "pearblossomPump", "osoPump", "southBayPump", "delVallePump", "lasPerillasPump", "badgerHillPump" ]: for q in self.pumpingTS: self.energyFactor.append([ q[0], float(self.characteristics.energyFactor[self.months[ q[0].getMonth()]]) ]) elif self.facility in ["sanFelipePump"]: for s in HEC.getDssTsValues( self.outputDSS, "/HYDROPOWER/CVPSANLUISPP/STORAGE-USED//1MON/POWERPLANT-CHARACTERISTICS/", self.start, self.end): self.energyFactor.append([s[0], self.energyFactor_rate(s[1])]) elif self.facility in ["folsomPump"]: for s in HEC.getDssTsValues( self.outputDSS, "/HYDROPOWER/FOLSOMPP/STORAGE-USED//1MON/POWERPLANT-CHARACTERISTICS/", self.start, self.end): self.energyFactor.append([s[0], self.energyFactor_rate(s[1])]) elif self.facility in ["cvpSanLuisPump"]: for s in HEC.getDssTsValues( self.outputDSS, "/HYDROPOWER/CVPSANLUISPP/STORAGE-USED//1MON/POWERPLANT-CHARACTERISTICS/", self.start, self.end): self.energyFactor.append( [s[0], self.energyFactor_rate(s[1], 25.0)]) elif self.facility in ["swpSanLuisPump"]: for s in HEC.getDssTsValues( self.outputDSS, "/HYDROPOWER/SWPSANLUISPP/STORAGE-USED//1MON/POWERPLANT-CHARACTERISTICS/", self.start, self.end): self.energyFactor.append( [s[0], self.energyFactor_rate(s[1], 25.0)]) HEC.setDssTsValues( self.outputDSS, self.energyFactor, self.start, "/HYDROPOWER/%s/%s//1MON/PUMPINGPLANT-CHARACTERISTICS/" % (self.facility, "ENERGY-FACTOR"), 0, "kWh/AF", "POWER-GENERATION-PER-VOLUME") # EXCEL CALCULATION - Unit Cap self.unitCap = list() if self.facility in [ "tracyPump", "cvpBanksPump", "contraCostaPump", "sanFelipePump", "cvpDosAmigosPump", "folsomPump", "corningPump", "redBluffPump", "dmcIntertiePump", "sanLuisOtherPump", "dmcOtherPump", "tcOtherPump", "oNeillPump", "banksPump", "swpDosAmigosPump", "buenaVistaPump", "teerinkPump", "chrismanPump", "edmonstonPump", "pearblossomPump", "osoPump", "southBayPump", "delVallePump", "lasPerillasPump", "badgerHillPump" ]: for q in self.pumpingTS: self.unitCap.append([ q[0], float(self.characteristics.unitCap[self.months[ q[0].getMonth()]]) ]) elif self.facility in ["cvpSanLuisPump"]: for s in HEC.getDssTsValues( self.outputDSS, "/HYDROPOWER/CVPSANLUISPP/STORAGE-USED//1MON/POWERPLANT-CHARACTERISTICS/", self.start, self.end): self.unitCap.append([s[0], self.unitCap_rate(s[1], 25.0)]) elif self.facility in ["swpSanLuisPump"]: for s in HEC.getDssTsValues( self.outputDSS, "/HYDROPOWER/SWPSANLUISPP/STORAGE-USED//1MON/POWERPLANT-CHARACTERISTICS/", self.start, self.end): self.unitCap.append([s[0], self.unitCap_rate(s[1], 25.0)]) HEC.setDssTsValues( self.outputDSS, self.unitCap, self.start, "/HYDROPOWER/%s/%s//1MON/PUMPINGPLANT-CHARACTERISTICS/" % (self.facility, "UNIT-CAPACITY"), 0, "MW", "POWER") # EXCEL CALCULATION - # units self.noUnits = list() if self.facility in [ "tracyPump", "cvpBanksPump", "contraCostaPump", "sanFelipePump", "cvpDosAmigosPump", "folsomPump", "corningPump", "redBluffPump", "dmcIntertiePump", "sanLuisOtherPump", "dmcOtherPump", "tcOtherPump", "oNeillPump", "cvpSanLuisPump", "banksPump", "swpSanLuisPump", "swpDosAmigosPump", "buenaVistaPump", "teerinkPump", "chrismanPump", "edmonstonPump", "pearblossomPump", "osoPump", "southBayPump", "delVallePump", "lasPerillasPump", "badgerHillPump" ]: for q in self.pumpingTS: self.noUnits.append([ q[0], float(self.characteristics.noUnits[self.months[ q[0].getMonth()]]) ]) HEC.setDssTsValues( self.outputDSS, self.noUnits, self.start, "/HYDROPOWER/%s/%s//1MON/PUMPINGPLANT-CHARACTERISTICS/" % (self.facility, "NUMBER-OF-UNITS"), 0, "UNIT", "COUNT") # EXCEL CALCULATION - Off Peak Energy self.offPeakPercent = list() if self.facility in [ "tracyPump", "cvpBanksPump", "contraCostaPump", "sanFelipePump", "cvpDosAmigosPump", "folsomPump", "corningPump", "redBluffPump", "dmcIntertiePump", "sanLuisOtherPump", "dmcOtherPump", "tcOtherPump", "oNeillPump", "cvpSanLuisPump", "banksPump", "swpSanLuisPump", "swpDosAmigosPump", "buenaVistaPump", "teerinkPump", "chrismanPump", "edmonstonPump", "pearblossomPump", "osoPump", "southBayPump", "delVallePump", "lasPerillasPump", "badgerHillPump" ]: for q in self.pumpingTS: if float(self.characteristics.offPeakPercent[self.months[ q[0].getMonth()]]) < 0.001: self.offPeakPercent.append([ q[0], 1.0 - float(peak.onPeakPercent[str(1900 + q[0].getYear() + 0.01 * (q[0].getMonth() + 1))]) ]) else: self.offPeakPercent.append([ q[0], float(self.characteristics.offPeakPercent[self.months[ q[0].getMonth()]]) ]) HEC.setDssTsValues( self.outputDSS, self.offPeakPercent, self.start, "/HYDROPOWER/%s/%s//1MON/PUMPINGPLANT-CHARACTERISTICS/" % (self.facility, "OFF-PEAK-PERCENT"), 0, "PERCENT", "OFF-PEAK") # EXCEL CALCULATION - On Peak Energy self.onPeakPercent = list() if self.facility in [ "tracyPump", "cvpBanksPump", "contraCostaPump", "sanFelipePump", "cvpDosAmigosPump", "folsomPump", "corningPump", "redBluffPump", "dmcIntertiePump", "sanLuisOtherPump", "dmcOtherPump", "tcOtherPump", "oNeillPump", "cvpSanLuisPump", "banksPump", "swpSanLuisPump", "swpDosAmigosPump", "buenaVistaPump", "teerinkPump", "chrismanPump", "edmonstonPump", "pearblossomPump", "osoPump", "southBayPump", "delVallePump", "lasPerillasPump", "badgerHillPump" ]: for q in self.pumpingTS: if float(self.characteristics.offPeakPercent[self.months[ q[0].getMonth()]]) < 0.001: self.onPeakPercent.append([ q[0], float(peak.onPeakPercent[str(1900 + q[0].getYear() + 0.01 * (q[0].getMonth() + 1))]) ]) else: self.onPeakPercent.append([ q[0], 1.0 - float(self.characteristics.offPeakPercent[ self.months[q[0].getMonth()]]) ]) HEC.setDssTsValues( self.outputDSS, self.onPeakPercent, self.start, "/HYDROPOWER/%s/%s//1MON/PUMPINGPLANT-CHARACTERISTICS/" % (self.facility, "ON-PEAK-PERCENT"), 0, "PERCENT", "ON-PEAK") # EXCEL CALCULATION - Off-Peak Adjustment Factor self.offPeakAdj = list() for q in self.pumpingTS: self.offPeakAdj.append([ q[0], float(self.characteristics.offPeakCapFactor[self.months[ q[0].getMonth()]]) ]) HEC.setDssTsValues( self.outputDSS, self.offPeakAdj, self.start, "/HYDROPOWER/%s/%s//1MON/PUMPINGPLANT-CHARACTERISTICS/" % (self.facility, "OFF-PEAK-ADJUSTMENT"), 0, "FACTOR", "OFF-PEAK") # EXCEL CALCULATION - On-Peak Adjustment Factor self.onPeakAdj = list() for q in self.pumpingTS: self.onPeakAdj.append([ q[0], float(self.characteristics.onPeakCapFactor[self.months[ q[0].getMonth()]]) ]) HEC.setDssTsValues( self.outputDSS, self.onPeakAdj, self.start, "/HYDROPOWER/%s/%s//1MON/PUMPINGPLANT-CHARACTERISTICS/" % (self.facility, "ON-PEAK-ADJUSTMENT"), 0, "FACTOR", "ON-PEAK") # EXCEL CALCULATION - Max Possible Capacity self.maxPossibleCap = list() for i in range(len(self.pumpingTS)): self.maxPossibleCap.append([ self.pumpingTS[i][0], self.unitCap[i][1] * self.noUnits[i][1] ]) HEC.setDssTsValues( self.outputDSS, self.maxPossibleCap, self.start, "/HYDROPOWER/%s/%s//1MON/PUMPINGPLANT-CHARACTERISTICS/" % (self.facility, "MAX-CAPACITY"), 0, "MW", "POWER")
def energyAtPlant(self): # EXCEL CALCULATION - POPULATE EPC Powerplant Release self.EPCPPRelease = list() if self.facility in [ "trinityPP", "carrPP", "springCreekPP", "shastaPP", "keswickPP", "folsomPP", "nimbusPP", "newMelonesPP", "orovillePP", "thermalitoPP", "alamoPP", "mojavePP", "devilCanyonPP", "warnePP", "castaicPP" ]: for i in range(len(self.releaseTS)): self.EPCPPRelease.append([ self.releaseTS[i][0], min( self.releaseTS[i][1] * self.cfs2taf[self.releaseTS[i][0]], self.MPPRelease[i][1], float(self.characteristics.maxFlow[self.months[ self.releaseTS[i][0].getMonth()]]) * float(self.cfs2taf[self.releaseTS[i][0]])) ]) elif self.facility in ["cvpSanLuisPP", "oNeilPP", "swpSanLuisPP"]: for i in range(len(self.genReleaseTS)): self.EPCPPRelease.append([ self.genReleaseTS[i][0], min( self.genReleaseTS[i][1] * self.cfs2taf[self.genReleaseTS[i][0]], self.MPPRelease[i][1]) ]) HEC.setDssTsValues( self.outputDSS, self.EPCPPRelease, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-GENERATION/" % (self.facility, "RELEASE"), 0, "TAF", "FLOW") # EXCEL CALCULATION - POPULATE EPC Energy self.EPCEnergy = list() for i in range(len(self.energyFactor)): self.EPCEnergy.append([ self.energyFactor[i][0], 0.001 * self.energyFactor[i][1] * self.EPCPPRelease[i][1] ]) HEC.setDssTsValues( self.outputDSS, self.EPCEnergy, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-GENERATION/" % (self.facility, "ENERGY"), 0, "GW-Hour", "Energy") # EXCEL CALCULATION - POPULATE EPC Spill self.EPCSpill = list() if self.facility in [ "trinityPP", "carrPP", "springCreekPP", "shastaPP", "keswickPP", "folsomPP", "nimbusPP", "newMelonesPP", "orovillePP", "thermalitoPP", "alamoPP", "mojavePP", "devilCanyonPP", "warnePP", "castaicPP" ]: for i in range(len(self.releaseTS)): self.EPCSpill.append([ self.releaseTS[i][0], max( self.releaseTS[i][1] * self.cfs2taf[self.releaseTS[i][0]] - self.EPCPPRelease[i][1], 0.0) ]) elif self.facility in ["cvpSanLuisPP", "oNeilPP", "swpSanLuisPP"]: for i in range(len(self.genReleaseTS)): self.EPCSpill.append([ self.genReleaseTS[i][0], max( self.genReleaseTS[i][1] * self.cfs2taf[self.genReleaseTS[i][0]] - self.EPCPPRelease[i][1], 0.0) ]) HEC.setDssTsValues( self.outputDSS, self.EPCSpill, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-GENERATION/" % (self.facility, "SPILL"), 0, "TAF", "FLOW") # EXCEL CALCULATION - POPULATE EPC Forgone Energy self.EPCForgone = list() for i in range(len(self.energyFactor)): self.EPCForgone.append([ self.energyFactor[i][0], 0.001 * self.EPCSpill[i][1] * self.energyFactor[i][1] ]) HEC.setDssTsValues( self.outputDSS, self.EPCForgone, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-GENERATION/" % (self.facility, "FORGONE"), 0, "GW-Hour", "Energy")
def maxPosPP(self): peak = peakingSchedule("./tables/peakingPercentage.in") # EXCEL CALCULATION - POPULATE MPP Energy self.MPPEnergy = list() # using available capacity to determine MPP energy if self.facility in [ "trinityPP", "carrPP", "springCreekPP", "shastaPP", "folsomPP", "newMelonesPP", "cvpSanLuisPP", "oNeilPP", "orovillePP", "thermalitoPP", "swpSanLuisPP", "alamoPP", "mojavePP", "devilCanyonPP", "warnePP", "castaicPP" ]: for i in range(len(self.availCap)): self.MPPEnergy.append([ self.availCap[i][0], 0.001 * self.availCap[i][1] * (peak.onPeakHours[ str(1900 + self.availCap[i][0].getYear() + 0.01 * (self.availCap[i][0].getMonth() + 1))] + peak.offPeakHours[ str(1900 + self.availCap[i][0].getYear() + 0.01 * (self.availCap[i][0].getMonth() + 1))]) ]) # using unit capacity to determine MPP energy elif self.facility in ["keswickPP", "nimbusPP"]: for i in range(len(self.unitCap)): self.MPPEnergy.append([ self.unitCap[i][0], 0.001 * self.unitCap[i][1] * (peak.onPeakHours[ str(1900 + self.availCap[i][0].getYear() + 0.01 * (self.availCap[i][0].getMonth() + 1))] + peak.offPeakHours[ str(1900 + self.availCap[i][0].getYear() + 0.01 * (self.availCap[i][0].getMonth() + 1))]) * float(self.characteristics.noUnits[self.months[ self.unitCap[i][0].getMonth()]]) ]) HEC.setDssTsValues( self.outputDSS, self.MPPEnergy, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-POTENTIAL/" % (self.facility, "ENERGY"), 0, "GW-Hour", "ENERGY") # EXCEL CALCULATION - POPULATE MPP Release self.MPPRelease = list() if self.facility in ["trinityPP", "newMelonesPP"]: minElevation = {"trinityPP": 2213.0, "newMelonesPP": 808.0} for i in range(len(self.elevation)): if self.elevation[i][1] > minElevation[self.facility]: self.MPPRelease.append([ self.elevation[i][0], 1000.0 * self.MPPEnergy[i][1] / self.energyFactor[i][1] ]) else: self.MPPRelease.append([self.elevation[i][0], 0.0]) elif self.facility in [ "carrPP", "springCreekPP", "shastaPP", "keswickPP", "folsomPP", "nimbusPP", "cvpSanLuisPP", "oNeilPP", "orovillePP", "thermalitoPP", "swpSanLuisPP", "alamoPP", "mojavePP", "devilCanyonPP", "warnePP", "castaicPP" ]: for i in range(len(self.energyFactor)): if self.energyFactor[i][1] > 0.0: self.MPPRelease.append([ self.energyFactor[i][0], 1000.0 * self.MPPEnergy[i][1] / self.energyFactor[i][1] ]) else: self.MPPRelease.append([self.energyFactor[i][0], 0.0]) HEC.setDssTsValues( self.outputDSS, self.MPPRelease, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-POTENTIAL/" % (self.facility, "RELEASE"), 0, "TAF", "FLOW")
def ppChar(self): # EXCEL CALCULATION - POPULATE STORAGE COLUMNS self.minStorage = list() self.meanStorage = list() self.minStorage0 = list() self.meanStorage0 = list() self.minStorage1 = list() self.minStorage2 = list() self.meanStorage1 = list() self.meanStorage2 = list() self.usedStorage = list() self.usedStorage0 = list() self.usedStorage1 = list() # powerplant regressions depends on storage of one reservoir if self.facility in [ "trinityPP", "carrPP", "shastaPP", "keswickPP", "folsomPP", "nimbusPP", "newMelonesPP", "thermalitoPP", "devilCanyonPP" ]: i = 1 for stor in self.storageTS: if i == 1: self.minStorage.append(stor) self.meanStorage.append(stor) else: self.minStorage.append([stor[0], min(prev, stor[1])]) self.meanStorage.append([stor[0], 0.5 * (prev + stor[1])]) prev = stor[1] i += 1 if self.storageFlag == 1: self.usedStorage = self.meanStorage else: self.usedStorage = self.minStorage HEC.setDssTsValues( self.outputDSS, self.usedStorage, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-CHARACTERISTICS/" % (self.facility, "STORAGE-USED"), 0, "TAF", "STORAGE") # powerplant regressions depends on storage of two reservoirs elif self.facility in ["springCreekPP", "orovillePP", "castaicPP"]: i = 1 for stor in self.storageTS0: if i == 1: self.minStorage0.append(stor) self.meanStorage0.append(stor) else: self.minStorage0.append([stor[0], min(prev, stor[1])]) self.meanStorage0.append([stor[0], 0.5 * (prev + stor[1])]) prev = stor[1] i += 1 i = 1 for stor in self.storageTS1: if i == 1: self.minStorage1.append(stor) self.meanStorage1.append(stor) else: self.minStorage1.append([stor[0], min(prev, stor[1])]) self.meanStorage1.append([stor[0], 0.5 * (prev + stor[1])]) prev = stor[1] i += 1 if self.storageFlag == 1: self.usedStorage = self.meanStorage0 self.usedStorage0 = self.meanStorage0 self.usedStorage1 = self.meanStorage1 else: self.usedStorage = self.minStorage0 self.usedStorage0 = self.minStorage0 self.usedStorage1 = self.minStorage1 if self.facility == "springCreekPP": HEC.setDssTsValues( self.outputDSS, self.usedStorage0, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-CHARACTERISTICS/" % (self.facility, "STORAGE-USED-UPSTREAM"), 0, "TAF", "STORAGE") HEC.setDssTsValues( self.outputDSS, self.usedStorage1, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-CHARACTERISTICS/" % (self.facility, "STORAGE-USED-DOWNSTREAM"), 0, "TAF", "STORAGE") else: #orovillePP HEC.setDssTsValues( self.outputDSS, self.usedStorage0, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-CHARACTERISTICS/" % (self.facility, "STORAGE-USED"), 0, "TAF", "STORAGE") # powerplant regressions requiring three variables elif self.facility in ["cvpSanLuisPP", "swpSanLuisPP"]: i = 1 for stor in self.storageTS0: if i == 1: self.minStorage0.append(stor) self.meanStorage0.append(stor) else: self.minStorage0.append([stor[0], min(prev, stor[1])]) self.meanStorage0.append([stor[0], 0.5 * (prev + stor[1])]) prev = stor[1] i += 1 i = 1 for stor in self.storageTS1: if i == 1: self.minStorage1.append(stor) self.meanStorage1.append(stor) else: self.minStorage1.append([stor[0], min(prev, stor[1])]) self.meanStorage1.append([stor[0], 0.5 * (prev + stor[1])]) prev = stor[1] i += 1 i = 1 for stor in self.storageTS2: if i == 1: self.minStorage2.append(stor) self.meanStorage2.append(stor) else: self.minStorage2.append([stor[0], min(prev, stor[1])]) self.meanStorage2.append([stor[0], 0.5 * (prev + stor[1])]) prev = stor[1] i += 1 if self.storageFlag == 1: for i in range(len(self.meanStorage0)): self.usedStorage.append([ self.meanStorage0[i][0], self.meanStorage0[i][1] + self.meanStorage1[i][1] + self.meanStorage2[i][1] ]) else: for i in range(len(self.minStorage0)): self.usedStorage.append([ self.minStorage0[i][0], self.minStorage0[i][1] + self.minStorage1[i][1] + self.minStorage2[i][1] ]) HEC.setDssTsValues( self.outputDSS, self.usedStorage, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-CHARACTERISTICS/" % (self.facility, "STORAGE-USED"), 0, "TAF", "STORAGE") # EXCEL CALCULATION - POPULATE ELEVATION COLUMN self.elevation = list() self.elevation0 = list() self.elevation1 = list() # elevation formula uses storage as argument if self.facility in [ "trinityPP", "shastaPP", "keswickPP", "folsomPP", "nimbusPP", "newMelonesPP", "orovillePP", "thermalitoPP", "devilCanyonPP", "castaicPP" ]: for stor in self.usedStorage: self.elevation.append([stor[0], self.elevation_rate(stor[1])]) HEC.setDssTsValues( self.outputDSS, self.elevation, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-CHARACTERISTICS/" % (self.facility, "ELEVATION"), 0, "FT", "STAGE") # elevation formula uses reservoir elevation upstream and downstream as arguments elif self.facility in ["carrPP"]: for stor in self.usedStorage: self.elevation0.append( [stor[0], self.elevation_rate[0](stor[1])]) self.elevation1.append( [stor[0], self.elevation_rate[1](stor[1])]) HEC.setDssTsValues( self.outputDSS, self.elevation0, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-CHARACTERISTICS/" % (self.facility, "ELEVATION-UPSTREAM"), 0, "FT", "STAGE") HEC.setDssTsValues( self.outputDSS, self.elevation1, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-CHARACTERISTICS/" % (self.facility, "ELEVATION-DOWNSTREAM"), 0, "FT", "STAGE") # elevation formula uses reservoir storage upstream and downstream as arguments elif self.facility in ["springCreekPP"]: for i in range(len(self.usedStorage0)): self.elevation0.append([ self.usedStorage0[i][0], self.elevation_rate[0](self.usedStorage0[i][1]) ]) self.elevation1.append([ self.usedStorage1[i][0], self.elevation_rate[1](self.usedStorage1[i][1]) ]) HEC.setDssTsValues( self.outputDSS, self.elevation0, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-CHARACTERISTICS/" % (self.facility, "ELEVATION-UPSTREAM"), 0, "FT", "STAGE") HEC.setDssTsValues( self.outputDSS, self.elevation1, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-CHARACTERISTICS/" % (self.facility, "ELEVATION-DOWNSTREAM"), 0, "FT", "STAGE") elif self.facility in ["cvpSanLuisPP", "swpSanLuisPP"]: for stor in self.usedStorage: self.elevation.append( [stor[0], self.elevation_rate(stor[1], 0)]) HEC.setDssTsValues( self.outputDSS, self.elevation, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-CHARACTERISTICS/" % (self.facility, "ELEVATION"), 0, "FT", "STAGE") # EXCEL CALCULATION - POPULATE TAIL RACE COLUMN self.tailRace = list() # using no arguments in tail race formula if self.facility in ["trinityPP", "thermalitoPP", "devilCanyonPP"]: for stor in self.usedStorage: self.tailRace.append([stor[0], self.tailRace_rate()]) # using flow as argument in tail race formula elif self.facility in [ "shastaPP", "keswickPP", "folsomPP", "nimbusPP", "newMelonesPP" ]: for q in self.releaseTS: self.tailRace.append([q[0], self.tailRace_rate(q[1])]) #using downstream storage as argument in tail race formula elif self.facility in ["orovillePP", "warnePP", "castaicPP"]: for s in self.storageTS1: self.tailRace.append([s[0], self.tailRace_rate(s[1])]) try: HEC.setDssTsValues( self.outputDSS, self.tailRace, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-CHARACTERISTICS/" % (self.facility, "TAIL-RACE"), 0, "FT", "STAGE") except: pass # EXCEL CALCULATION - POPULATE ENERGY FACTOR COLUMN self.energyFactor = list() # using elevation and tailRace as arguments in energy factor formula if self.facility in [ "trinityPP", "shastaPP", "keswickPP", "folsomPP", "nimbusPP", "newMelonesPP", "orovillePP", "thermalitoPP", "castaicPP" ]: for i in range(0, len(self.elevation)): self.energyFactor.append([ self.elevation[i][0], self.energyFactor_rate(self.elevation[i][1], self.tailRace[i][1]) ]) # using upstream and downstream elevation as arguments in energy factor formula elif self.facility in ["carrPP", "springCreekPP"]: for i in range(0, len(self.elevation0)): self.energyFactor.append([ self.elevation0[i][0], self.energyFactor_rate(self.elevation0[i][1], self.elevation1[i][1]) ]) # using upstream and downstream storage as arguments in energy factor formula elif self.facility in ["cvpSanLuisPP", "swpSanLuisPP"]: for stor in self.usedStorage: self.energyFactor.append( [stor[0], self.energyFactor_rate(stor[1], oNeilStorage)]) # using zero as argument in energy factor formula elif self.facility in ["oNeilPP"]: for qOut in self.releaseTS: self.energyFactor.append([qOut[0], self.energyFactor_rate(0)]) # using energy factor from characteristics table (*.in file) elif self.facility in [ "alamoPP", "mojavePP", "devilCanyonPP", "warnePP" ]: for q in self.releaseTS: self.energyFactor.append([ q[0], float(self.characteristics.energyFactor[self.months[ q[0].getMonth()]]) ]) HEC.setDssTsValues( self.outputDSS, self.energyFactor, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-CHARACTERISTICS/" % (self.facility, "ENERGY-FACTOR"), 0, "kWh/AF", "POWER-GENERATION-PER-VOLUME") # EXCEL CALCULATION - POPULATE UNIT CAPACITY COLUMN self.unitCap = list() # using elevation and tail race as arguments in unit capacity equation if self.facility in [ "trinityPP", "shastaPP", "keswickPP", "folsomPP", "nimbusPP", "newMelonesPP" ]: for i in range(0, len(self.elevation)): self.unitCap.append([ self.elevation[i][0], self.unitCap_rate(self.elevation[i][1], self.tailRace[i][1]) ]) # using upstream and downstream elevation as arguments in unit capacity equation elif self.facility in ["carrPP", "springCreekPP"]: for i in range(0, len(self.elevation0)): self.unitCap.append([ self.elevation0[i][0], self.unitCap_rate(self.elevation0[i][1], self.elevation1[i][1]) ]) # using upstream and downstream storage as arguments in unit capacity equation elif self.facility in ["cvpSanLuisPP", "swpSanLuisPP"]: for stor in self.usedStorage: self.unitCap.append( [stor[0], self.unitCap_rate(stor[1], oNeilStorage)]) elif self.facility in ["oNeilPP"]: for qOut in self.releaseTS: self.unitCap.append([qOut[0], 3.0]) try: HEC.setDssTsValues( self.outputDSS, self.unitCap, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-CHARACTERISTICS/" % (self.facility, "UNIT-CAPACITY"), 0, "MW", "POWER") except: pass # EXCEL CALCULATION - POPULATE AVAILABLE CAPACITY COLUMN self.availCap = list() # using unit capacity and number of units in available capacity equation if self.facility in [ "trinityPP", "carrPP", "springCreekPP", "shastaPP", "folsomPP", "newMelonesPP", "cvpSanLuisPP", "swpSanLuisPP" ]: for cap in self.unitCap: self.availCap.append([ cap[0], cap[1] * float(self.characteristics.noUnits[ self.months[cap[0].getMonth()]]) * float(self.characteristics.capShare[self.months[ cap[0].getMonth()]]) ]) # using release, energyfactor, unit capacity, and number of units in available capacity # equation elif self.facility in ["keswickPP", "nimbusPP"]: for i in range(len(self.releaseTS)): self.availCap.append([ self.releaseTS[i][0], self.availCap_rate( self.releaseTS[i][1], self.energyFactor[i][1], self.unitCap[i][1], float(self.characteristics.noUnits[self.months[ self.unitCap[i][0].getMonth()]])) ]) # using release, energyfactor, unit capacity, and number of units in available capacity # equation elif self.facility in ["oNeilPP"]: for i in range(len(self.releaseTS)): self.availCap.append([ self.releaseTS[i][0], self.availCap_rate( self.genReleaseTS[i][1], self.energyFactor[i][1], self.unitCap[i][1], float(self.characteristics.noUnits[self.months[ self.unitCap[i][0].getMonth()]])) ]) elif self.facility in [ "orovillePP", "thermalitoPP", "devilCanyonPP", "warnePP", "castaicPP" ]: if self.facility == "warnePP": #not very elegant, but will work, don't want to build another If Block just for warne. Ho, P self.elevation = [[q[0], 3299.0] for q in self.releaseTS] for i in range(len(self.elevation)): self.availCap.append([ self.elevation[i][0], min( self.availCap_rate( self.elevation[i][1] - self.tailRace[i][1], self.releaseTS[i][1], float(self.characteristics.efficiency[self.months[ self.elevation[i][0].getMonth()]])), float(self.characteristics.powerRating[self.months[ self.elevation[i][0].getMonth()]])) ]) elif self.facility in ["alamoPP", "mojavePP"]: head = {"alamoPP": 133.0, "mojavePP": 135.0} for q in self.releaseTS: self.availCap.append([ q[0], min( self.availCap_rate( head[self.facility], q[1], float(self.characteristics.efficiency[self.months[ q[0].getMonth()]])), float(self.characteristics.powerRating[self.months[ q[0].getMonth()]])) ]) try: HEC.setDssTsValues( self.outputDSS, self.availCap, self.start, "/HYDROPOWER/%s/%s//1MON/POWERPLANT-CHARACTERISTICS/" % (self.facility, "AVAILABLE-CAPACITY"), 0, "MW", "POWER") except: pass