Last active
December 24, 2015 13:49
-
-
Save seumasmorrison/6808020 to your computer and use it in GitHub Desktop.
Function for converting salt water pressure readings to depth in metres taking account of latitude. Based upon Seabird description of UNESCO formulae - http://www.seabird.com/application_notes/AN69.htm
This file contains 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
import math | |
def decibars_to_metres(latitude, pressure): | |
x = (math.sin(latitude/ 57.29578))**2 | |
g = 9.780318 * ( 1.0 + ( 5.2788*(10**-3) + (2.36*(10**-5)) * x) * x ) + \ | |
(1.092 * (10**-6) ) * pressure | |
return (((-1.82*(10**-15) * pressure + 2.279*(10**-10) ) * \ | |
pressure - 2.2512*(10**-5) * pressure + 9.72659) * pressure) / g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment