Skip to content

Commit

Permalink
Adds ctd_l2_density
Browse files Browse the repository at this point in the history
  • Loading branch information
lukecampbell committed Mar 12, 2013
1 parent 89117b3 commit 79e02b3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ion_functions/data/data_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,13 @@ def data_density(SP, p, t, lat, lon):

return gsw.rho(abs_sal, cons_temp, p)

def data_l2_density(conductivity, temp,pressure, lat, lon):
'''
Based on calculations done here: https://github.com/ooici/coi-services/blob/master/ion/processes/data/transforms/ctd/ctd_L2_density.py#L55
'''
from pygsw import vectors as gsw
sp = gsw.sp_from_c(conductivity/42.914, temp, pressure)
sa = gsw.sa_from_sp(sp, pressure, lon, lat)
rho = gsw.rho(sa, temp, pressure)
return rho

0 comments on commit 79e02b3

Please sign in to comment.