batteryreduction        A function for data reduction
