Skip to content

Instantly share code, notes, and snippets.

@KitWallace
Created September 16, 2012 16:48
Show Gist options
  • Save KitWallace/3733169 to your computer and use it in GitHub Desktop.
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
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