def get_sensor_data(self):
        Tools.log("Buffer:"+str(self.sensor_buffer))
        try:
            sensor_data = { 'sensors': {}, 'recordTimestamp': {} }
            sensor_data['sensors']['flow'] = sum(self.sensor_buffer['flow'])
            sensor_data['sensors']['sound'] = statistics.median(self.sensor_buffer['sound'])
            sensor_data['sensors']['ultrasonic'] = statistics.median(self.sensor_buffer['ultrasonic'])
            sensor_data['sensors']['temp'] = statistics.mean(self.sensor_buffer['temp'])
            sensor_data['sensors']['humidity'] = statistics.mean(self.sensor_buffer['humidity'])
            sensor_data['recordTimestamp'] = Tools.now_int_epoch()
            Tools.log("Data to send:"+str(sensor_data))
            GLOBALS['errorCount'] -= 0.5
        except Exception, e:
            Tools.log('Error caculating data: %s' % str(e),1)

        return sensor_data

    # Clears the buffer
dataset/ETHPy150Open awslabs/simplebeerservice/sbsunit/sbs/reader.py/SBSReader.get_sensor_data/original