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

Formulae for calculation? #18

Open
stigvi opened this issue May 17, 2021 · 7 comments
Open

Formulae for calculation? #18

stigvi opened this issue May 17, 2021 · 7 comments

Comments

@stigvi
Copy link

stigvi commented May 17, 2021

Is it possible to document how the "feels like" temperature is calculated and also how you get to this particular formulae?

@stigvi stigvi added the enhancement New feature or request. label May 17, 2021
@phreaq
Copy link

phreaq commented May 18, 2021

I just looked thru the code, and here's the formula

e_value = humd * 0.06105 * math.exp((17.27 * temp) / (237.7 + temp))        
feeling = temp + 0.348 * e_value - 0.7 * wind - 4.25

fwiw, it seems like wind is a large factor, so excluding it will give the 'feels like' temperature a higher reading

@TATERxxWARDY
Copy link

Does this account for heat index as well? I was looking into writing up this calculation elsewhere before I found this integration on HACS and the scientific resources I found mentioned heat index playing a large factor during the summer months

@Limych
Copy link
Owner

Limych commented Jun 10, 2021

This sensor actually calculates the "temperature in the shade", because there is not enough calculation of the contribution of solar radiation. This parameter depends on the specific location, and it is rather difficult to calculate it mathematically.

@Limych Limych removed the enhancement New feature or request. label Jun 10, 2021
@Limych
Copy link
Owner

Limych commented Jun 10, 2021

The whole formula:

image
where
Ta = Dry bulb temperature (°C)
e = Water vapour pressure (hPa) [humidity]
ws = Wind speed (m/s) at an elevation of 10 meters
Q = Net radiation absorbed per unit area of body surface (W/m2)

E is computed like this
image
where
rh = Relative Humidity [%]

While temperature and humidity are regional and seasonal factors, wind and radiation are microclimatic factors and are influenced by the local environment.

@Margucci
Copy link

For the wind speed, is the input supposed to be in kph, mph, or m/s?

@Limych
Copy link
Owner

Limych commented Apr 17, 2022

For the wind speed, is the input supposed to be in kph, mph, or m/s?

For this sensor — any of this units. Value will be automatically converted to m/s for calculations.

@Sudo-Rob
Copy link

Sudo-Rob commented Nov 21, 2022

I've been looking for a solution for adding feels-like temperature to a weather card and thought this could be perfect. The issue I'm experiencing is the feels-like values are well off from where I'd expect them to be. When I look at your calculations, it appears you have omitted the use of Q. This results in a relatively large spread between ambient temperature and the feels-like temperature.

Comparing results with the US/Canada methodology (http://solberg.snr.missouri.edu/gcc/OFCMWindchillReport.pdf), I can get close with Q = 64 W-m^-2. That said, I have only checked a couple of cases. When I try to match the Australian BoM data (http://www.bom.gov.au/info/thermal_stress/#apparent), it looks as if Q could be a function of wind speed. There's not much specificity regarding Q.

I'm not a proponent of any particular method, but the NWS formulae are easy to calculate. At least I can match the models to the published charts. There are a few corner cases for heat-index requiring some conditional logic, but they're manageable. The wind chill calculation has two limitations to consider. There is a gap, however, between 50°F and 70°F where neither method is typically used. I've come up with a way of bridging the gap which seems reasonable to me. Effectively, its a weighted average between the two methods of calculating feels-like temperature. Here's how it behaves for a wind speed of 40 mph and relative humidity of 80%.

image

I appreciate the work you've done as it solves a problem I have with using the NWS API. If you're taking requests for improvement, I respectfully suggest either providing an option for including Q in the calculation (that is, if a static value can work), or alternately migrating to a different model.

Additional references:
https://www.weather.gov/media/epz/wxcalc/windChill.pdf
https://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml
https://journals.ametsoc.org/downloadpdf/journals/apme/23/12/1520-0450_1984_023_1674_ausoat_2_0_co_2.xml

Edit: I have a working sensor template using the NWS model as described above.

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

No branches or pull requests

6 participants