From c0a9b8c3fea7ccf4bdf2c7706877c7aed6a03be5 Mon Sep 17 00:00:00 2001 From: Tomas Date: Thu, 7 Aug 2014 22:16:08 +0200 Subject: [PATCH] Bugfix - wrong constant in the mean sea level pressure formula --- src/barometer.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/barometer.c b/src/barometer.c index 0fa9a33e..2bfd51e0 100644 --- a/src/barometer.c +++ b/src/barometer.c @@ -1409,10 +1409,6 @@ static double abs_to_mean_sea_level_pressure(double abs_pressure) double temp = 0.0; int result = 0; - DEBUG ("barometer: abs_to_mean_sea_level_pressure: absPressure = %lf, method = %d", - abs_pressure, - config_normalize); - if (config_normalize >= MSLP_DEU_WETT) { result = get_reference_temperature(&temp); @@ -1430,7 +1426,7 @@ static double abs_to_mean_sea_level_pressure(double abs_pressure) case MSLP_INTERNATIONAL: mean = abs_pressure / \ - pow(1.0 - 0.0065*config_altitude/288.15, 0.0065*0.0289644/(8.31447*0.0065)); + pow(1.0 - 0.0065*config_altitude/288.15, 9.80665*0.0289644/(8.31447*0.0065)); break; case MSLP_DEU_WETT: @@ -1453,6 +1449,11 @@ static double abs_to_mean_sea_level_pressure(double abs_pressure) break; } + DEBUG ("barometer: abs_to_mean_sea_level_pressure: absPressure = %lf hPa, method = %d, meanPressure = %lf hPa", + abs_pressure, + config_normalize, + mean); + return mean; } -- 2.11.0