Weather_Shield icon indicating copy to clipboard operation
Weather_Shield copied to clipboard

* Changing Pressure reading to pressure_raw

Open TJLTM opened this issue 2 years ago • 1 comments

  • Adding Pressure Normalization function to Sea Level equiv to output

TJLTM avatar Jun 24 '22 21:06 TJLTM

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));
}

jesawyers avatar Jun 25 '22 14:06 jesawyers