Bugfix - wrong constant in the mean sea level pressure formula
authorTomas <tomasamot@gmail.com>
Thu, 7 Aug 2014 20:16:08 +0000 (22:16 +0200)
committerTomas <tomasamot@gmail.com>
Thu, 7 Aug 2014 20:16:08 +0000 (22:16 +0200)
src/barometer.c

index 0fa9a33..2bfd51e 100644 (file)
@@ -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; 
 }