Created
September 16, 2012 16:48
-
-
Save KitWallace/3733169 to your computer and use it in GitHub Desktop.
an function to convert observed pressure at altitude to sea-level. Formula is given in the datasheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def readSeaLevelPressure(self, altitude=0) : | |
"Calculates the sea level pressure from a pressure at an altitude in metres" | |
pressure = float(self.readPressure()) | |
pressureSL = pressure / pow( ( 1.0 - float(altitude) / 44330) , 5.225) | |
if (self.debug) : | |
print("DBG: Sea Level Pressure = %d" % (pressureSL)) | |
return pressureSL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment