def read_altitude(self, sealevel_pa=101325.0):
        """Calculates the altitude in meters."""
        # Calculation taken straight from section 3.6 of the datasheet.
        pressure = float(self.read_pressure())
        altitude = 44330.0 * (1.0 - pow(pressure / sealevel_pa, (1.0/5.255)))
        self.logger.debug('Altitude {0} m', altitude)
        return altitude
def read_altitude ( self , sealevel_pa = 101325.0 ) : pressure = float ( self . read_pressure ( ) ) altitude = 44330.0 * ( 1.0 - pow ( pressure / sealevel_pa , ( 1.0 / 5.255 ) ) ) self . logger . debug ( 'Altitude {0} m' , altitude ) return altitude
Calculates the altitude in meters.