Apparent Temperature and Humidex calculations in wd.py are not unit of measure aware

Issue #29 resolved
Gary Roderick created an issue

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)

  1. Gary Roderick reporter

    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.

  2. Gary Roderick 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.

  3. Gary Roderick 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.

  4. Gary Roderick 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.

  5. Gary Roderick 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.

  6. Gary Roderick 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.

  7. Gary Roderick reporter

    Ok, when you get an archive period or two in the logs can you drop me a copy please. thanks


  8. Gary Roderick 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.

  9. Log in to comment