Following on from my post of how to log the data from your ThermoPro 350S, I noted that the app also calculates the Heat Index - quite a handy metric as it measures the 'feels like' temperature taking into account the humidity. I'd been interested in the phenomenon after my travels last year through Spain as despite the scorching hot temperatures I felt quite comfortable yet on my return to good old blighty I was sweltering despite the temps being in the the low 20s.
Now I'm armed with the calcs I look forward to monitoring the situation.
Point to note here you don't have to have a ThermoPro device to enjoy this, it simply takes any input of heat and humidity then turns some cogs to spit out the Heat Index.
You'll need python installed to use it then just proceed...
Download the library
Grab a copy of the python script from this GitHub Gist here, download it or copy the contents into an file
There's a couple of ways of running the calc:
Command Line Interface:
You can run the file from the CLI passing the temp and humidity through the command. I.e. in Linux it would be for a temperature of 25 degC and a humidity of 50%:
python3 heatindex.py 25 50
and you should see this output:
Temperature = 25.0°C Humidity = 50.0% Heat Index = 24.6°C
Calling the function from within a python script
You just need to import the library then call the function, easy really:
from heatindex import * temp = 25 humid = 50 HI = heat_index_calc(temp,humid) print(HI)
easy-peasy!
Alternate calculations
There's a couple of different calculations which are programmed in, the first is NOAA's Weather Prediction Service's refinement of the formula. You can use it by adding an option to the command line:
python3 heatindex.py 25 50 wpc
or call it from a script using:
HI = heat_index_wpc(heat,humid)
And another is the alternative listed on the Wikipedia page (the default calc in the script uses the main one). Call it using
python heatindex.py 25 50 alt
or
HI = heat_index_calc(temp,humid,'alt')