Skip to content

Instantly share code, notes, and snippets.

@seumasmorrison
Last active December 24, 2015 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seumasmorrison/6808020 to your computer and use it in GitHub Desktop.
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
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