-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Weird values on heat index calculations #10
Comments
Hi Robert, Note: I move this issue to the repository of temperature as this is a bulk archive of released versions. |
A quick look shows I only implemented the first formula without the adjustments. From the link So code needs to be reworked. Note: HeatIndexC() should become a wrapper around HeatIndex() to minimize footprint and reduce chance on errors. |
I got my formulas from - https://en.wikipedia.org/wiki/Heat_index which does not mention the NOAA adjustments. |
@RobertDB59 Can you verify if this works as expected? |
Checked the table generated with the example with the table at https://www.calculator.net/heat-index-calculator.html Will push the change today an merge the changes. Thanks again for pointing out the issue, |
Hi Rob, Keep up the good work. |
I think there is a minor typo
Shouldn't this be subtracted instead of added to HI? |
Checked the website again and it is a major typo where T is temperature in degrees F and RH is relative humidity in percent. HI is the heat index expressed as an apparent temperature in degrees F. If the RH is less than 13% and the temperature is between 80 and 112 degrees F, then the following adjustment is subtracted from HI:
where ABS and SQRT are the absolute value and square root functions, respectively. On the other hand, if the RH is greater than 85% and the temperature is between 80 and 87 degrees F, then the following adjustment is added to HI:
A 0.3.1 release is coming soon ... |
updated, merged and released 0.3.1 |
Verified and it seems to be all good. Just an idea, maybe you could use the celsius to fahrenheid calculation and vice versa already present in your library for the heat index calculation in a future release. Thanks again en een fijne dag verder. |
Already did that, but I left the code with all the constants in comments. I might consider a Celsius only heatindex once, that would safe some float math. On the other hand the gain would be most 10% as the float math is already pretty heavy. Check in code float heatIndexC(float celcius, float humidity)
{
float TF = celcius * (9.0 / 5.0) + 32;
float HI = (heatIndex(TF, humidity) - 32) * (5.0 / 9.0);
return HI;
...
Dank je wel ! |
Born and raised in Eindhoven, close to Helmond, and I moved 12 years ago to the south of France. So yes I speak Dutch as well. |
What I was trying to say is that you could use
instead of
Btw celcius is written with an S in the middle as celsius. Maybe you have done that on purpose. |
My daughter lives near the High Tech Campus, and I studied there so Eindhoven is very familiar. Both Celcius and Celsius exist, see on this page - https://en.wikipedia.org/wiki/Talk%3ACelsius I will update it soon as I also wanted to add the Rankine and Reamure temperature scale conversions too. I close this issue, as the problem is solved. If there are other issues, please let me know. |
Bad weather over here so I am working on a update - #14 |
Hallo Rob,
Misschien kun je de volgende snippet gebruiken voor de luchtdruk berekening
naar zeeniveau.
Wij wonen op 430 meter hoogte waardoor de de hier heersende luchtdruk niet
overeenkomt met een meetstation in Perpignan.
// calculate the barometric pressure at sea level
float baroReadingC( float pressure, float celsius, float altitude){
return pressure * pow( 1 - (( 0.0065 * altitude) / ( celsius + 0.0065 *
altitude + 273.15)), -5.257);
}
Groet, Robert
Op za 8 jan. 2022 om 16:02 schreef Rob Tillaart ***@***.***>:
… @RobertDB59 <https://github.com/RobertDB59>
Bad weather over here so I am working on a update - #14
<#14>
with a convertor class.
—
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARHYEWEIJTII2RS5F5K7HU3UVBGZHANCNFSM5LJL6LMQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thank you for this function, I will add it to the temperature library. float baroToSeaLevelC( float pressure, float celsius, float altitude)
{
float altitudeFactor = 0.0065 * altitude;
float kelvin = celsius + 273.15;
return pressure * pow( 1 - (altitudeFactor / (kelvin + altitudeFactor)), -5.257);
} Q: Do you have a reference source (NOAA or so) for the code? found this
update: added the function in upcoming 0.3.2 release |
It is called the Hypsometric equation, also known as the thickness
equation, relates an atmospheric pressure ratio to the equivalent thickness
of an atmospheric layer. There are multiple sources on the web explaining
this calculation. I don't remember what authority I used as reference.
Op zo 9 jan. 2022 om 10:21 schreef Rob Tillaart ***@***.***>:
… Thank you for this function, I will add it to the temperature library.
My proposal is to change the name to baroToSeaLevelC(...) as that is more
descriptive.
Q: Do you have a reference source (NOAA or so) for the code?
I also came across a function that predicted the boiling temperature of
water at some altitude.
(it is linear with height however only true to some extend )
—
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARHYEWBZX5ASTAUG7PY4H7DUVFHTBANCNFSM5LJL6LMQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
OK, found some references and they match the equation (enough). So merged into the library. |
I am not very familiar with github to propose modifications or add stuff so
I keep using this thread for now.
Maybe it is adviced to change the "wind chill" function.
As https://en.wikipedia.org/wiki/Wind_chill states " Windchill temperature
is defined only for temperatures at or below 10 °C (50 °F) and wind speeds
above 4.8 kilometres per hour (3.0 mph).[11]
<https://en.wikipedia.org/wiki/Wind_chill#cite_note-noaa-11>
I added following line to my function ( I have evertything metric :) )
if( kilometerPerHour < 4.8 || celsius > 10) wchill = celsius;
return wchill;
Same as for heat index, temperature equal to or greater than 80 °F (27 °C)
and relative humidity equal to or greater than 40%, also from the wiki page.
Otherwise heat index equals air temperature.
Hope this helps
Op zo 9 jan. 2022 om 11:50 schreef Rob Tillaart ***@***.***>:
… OK, found some references and they match the equation (enough). So merged
into the library.
thanks again.
—
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARHYEWAQ4MEZEMTEGORZ7ZTUVFR65ANCNFSM5LJL6LMQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi Robert,
You can always create a new issue if it concerns a new topic, or reopen an exiting one if related. These are good remarks, I will add them for a new 0.3.3 release. |
https://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml has some other definition about below 80F range. I reread it The Rothfusz regression is not appropriate when conditions of temperature and humidity warrant a heat index value below about 80 degrees F. In those cases, a simpler formula is applied to calculate values consistent with Steadman's results: HI = 0.5 * {T + 61.0 + [(T-68.0)1.2] + (RH0.094)} In practice, the simple formula is computed first and the result averaged with the temperature. If this heat index value is 80 degrees F or higher, the full regression equation along with any adjustment as described above is applied. and I notice I do not compute this simple first so I have to fix this. |
Changes implemented in develop branch and PR created - #15 update: After some failures the unit test run successful again. |
Merged PR and released 0.3.3 version. |
When using the formula's given in the library temperature.h the value's I am getting are way off to the values when I use an online heat index calculator. This is for both formula's °C and °F. When I use the following formula:
HI = 0.5 * (T + 61.0 + ((T-68.0)*1.2) + (RH*0.094))
found at https://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml it returns imho a more correct value.
Maybe I am missing something?
The text was updated successfully, but these errors were encountered: