Open TJLTM opened 2 years ago
Here are two functions that I use to take a pressure reading (at altitude) and normalize to sea level pressure. I have tested these functions and they work great.
//********************************************************************************
double calcSeaLevelPress_hPa(double inP_hPa, double inAlt_mtrs)
{
double calc = 0.0;
calc = pow((1 - (inAlt_mtrs / 44330)), 5.255);
return(inP_hPa / calc);
}
//********************************************************************************
double calcCorrectedPress_hPa(double inP_hPa, double inP_SL, double inAlt_mtrs, double inDegC)
{
double calc = 0.0;
calc = (0.0065 * inAlt_mtrs) / (inDegC + (0.0065 * inAlt_mtrs) + 273.15);
calc = 1 - calc;
return(inP_hPa * pow(calc,-5.257));
}