def getUPSPaths(location=None):
	return reports.MBR.criticalpower.getPowerPaths(location)
	
def getPowerHist(startDate,endDate, location=None):
	tagpaths = getUPSPaths(location)
		
	hist = reports.MBR.common.util.getHistory(tagpaths, startDate, endDate, customArgs={})
	return reports.MBR.common.util.generateSumCol(hist, sumColName="CalculatedUPSTotalkW")	
	

def processData(startDate,endDate, interval, location=None):
	histDS = getPowerHist(startDate,endDate, location)
	return reports.MBR.common.util.averageIntervalData(histDS, interval)
	
def beginReport(startDate,endDate, intervalMins, location=None):
	return processData(startDate,endDate, intervalMins, location)
	
