Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* Changing Pressure reading to pressure_raw #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TJLTM
Copy link

@TJLTM TJLTM commented Jun 24, 2022

  • Adding Pressure Normalization function to Sea Level equiv to output

* Adding Pressure Normalization function to Sea Level equiv to output
@jesawyers
Copy link

jesawyers commented Jun 25, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants