Apparent Temperature and Humidex calculations in wd.py are not unit of measure aware
Formulas for AT and Humidex require various parameters in particular units. Current formulas in wd.py use packet and record data with no conversion/units of measure check. Consequently, metric users see correct AT and Humidex values but imperial or US units see incorrect (extremely high) values.
Comments (21)
-
reporter -
Commit merged. Thank You.
-
reporter Hmm, your humidex looks ok but your apparent temp is close to freezing, looks like I solved one issue and created another. Will have to have another look at this.
-
do I need to back it out?
-
reporter No no need, it won't be messing up anything on your site as I don't believe native Saratoga displays apparent temp. Expect you will get another wd.py or another testtags tho! Need to give this some thought.
-
Cool. Thanks for the reply.
-
reporter Fernando, Testtags.php.tmpl apptemp and humidex calcs were a bit of a dogs breakfast so have pushed commit 990cfa7 that has tidied these up. Not sure this will correct the apptemp issue mentioned above but it should make troubleshooting easier. Could you pls implement this and then we can see where we stand.
-
gjr,
Commit merged. Thank You.
-
reporter Ok, out for a couple of hours, will have a look when I am back.
-
reporter Fernando, seems the missing data on your site means something is clearly wrong, given the new testtags template I would say that is the culprit. Are you getting any error message in your logs? If so could you email me the relevant extract from your log pls. Send it to me private email if you like rather than clogging this.
-
gjr,
Check your email.
-
I also reverted back. Will await for a fix.
Thanks.
-
reporter -
gjr,
Commit merged.
Thanks.
-
gjr,
I got no errors on the logs.
looking good so far.
-
reporter Yes. Ok, apptemp is still freezing which is making me think we have an error in wd.py. I will put together a version that provides some output to the logs as to what is going on so we can track down the issue. Won't have it to you until tomorrow your time though.
-
gjr,
I placed the new wd.py
-
reporter Ok, when you get an archive period or two in the logs can you drop me a copy please. thanks
-
gjr,
As requested check your email.
Thank You.
-
reporter Identified an error in wd.py whereby archive records of extraTemp1 (humidex) and extraTemp2(apparent temperature) were not calculated correctly if the underlying databases stored in US units. Commit f6722c5 corrects this. To install just need to download wd.py, save over old one and stop/start weewx. Will close this issue now.
-
reporter - changed status to resolved
Commit f6722c5 resolved final outstanding aspect of this issue.
- Log in to comment
Refer commit d135881. Added if..then..else to check usUnits and apply appropriate unit conversions to outTemp and windSpeed used in Humidex and AT formulae. As usual to install just replace wd.py with new version and stop/start Weewx. Will wait until I see a US units install functioning correctly before closing this issue.