summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2014-02-11 13:08:29 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-11 14:05:54 -0800
commite58f54cac1d050c090bfa5427991ae440bc78495 (patch)
treed4379185e39721d46d61ca6136001941b980ef1a /profile.c
parent92bbed3304afeb8e7ef6593f48eae982d799b5f1 (diff)
downloadsubsurface-e58f54cac1d050c090bfa5427991ae440bc78495.tar.gz
Fix ATM-vs-bar confusion
SAC should be calculated in relationship to surface pressure, not "1 bar". I also realize that we have a few other cases where we do the same mistake: the partial pressure calculations do things like po2 = o2 / 1000.0 * depth_to_mbar(sample->depth.mm, dive); which is wrong as well - the partial pressure is also relative to standard atmospheric pressures. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/profile.c b/profile.c
index 14b76f70e..07328580f 100644
--- a/profile.c
+++ b/profile.c
@@ -226,7 +226,7 @@ static int get_local_sac(struct plot_data *entry1, struct plot_data *entry2, str
/* Mean pressure in ATM */
depth = (entry1->depth + entry2->depth) / 2;
- atm = (double) depth_to_mbar(depth, dive) / SURFACE_PRESSURE;
+ atm = depth_to_atm(depth, dive);
cyl = dive->cylinder + index;