wxtrends.php appears confused re: units

Issue #12 resolved
Vince Skahan created an issue

I have US units set everywhere and the WD generated raw data appears right, yet the wxstatus.php page seems confused re: which units to use for any time periods other than current.

What seems to be happening is it's needlessly converting deg-C to deg-F (even though the WD data and weewx are in deg-F). Similarly the pressure in inches is needlessly converted to what looks like something close to atmospheres (perhaps).

Current 53.2 0 4 SSW 91 30.118 0.00 5 minutes ago 127.8 0 2 SSW 91 0.889 0.00 10 minutes ago 127.8 1 2 SSW 91 0.889 0.00 15 minutes ago 127.8 0 1 SSW 91 0.889 0.00

Uncertain if this is a weewx-WD issue or a saratoga bug.

Comments (22)

  1. Vince Skahan reporter

    yes, I found that one and gave it a good read and the TNET web link to decode the WD files helped a 'lot'.

    Please run it against http://weather.skahan.net/WD and you will see that (at a minima) the metric and imperial units are being calculated backwards for a whole lotta parameters. The weewx site would be http://weather.skahan.net/weewx if you want to look at that, and http://weather.skahan.net/saratoga if you want to see those pages.

    (note - I'm in the process of hacking the saratoga to make weewx a recognized station type, so the saratoga pages might come and go. Be gentle please, as this is a very weak computer, so lots of requests to the saratoga pages will bog it down and perhaps even timeout. Checking the weewx pages should be fine).

    Thanks...

  2. Gary Roderick

    Vince, the issue with your trends.php page is that what I call the 'ago' tags (ie 5 min ago, 10 min ago etc) are all being pulled from the archive database with some hard coded queries, the limitations of which have only been highlighted when the templates are being run against US customary or non-metric databases. if you can bare with us I am sure we can sort the issue. Note that this issue will affect any of the ago tags where the US customary and metric units are different (eg temperature, wind speed, pressure) but should be fine where they are the same eg humidity, wind direction. Gary

  3. Oz Greg repo owner

    Looks like the some of the stats ie seventyfivemin_temp_vt = (seventyfivemin_temp, 'degree_C', 'group_temperature') have an assumption of Metric which is incorrect..

    If we use the weewx.US or weewx.METRIC constant we should be able to code around this..

  4. Gary Roderick

    Yes Greg that is the issue and I am working on the fix right now. All 5min to 2hour ago tags as well as 24hr ago tags have the same issue. Do you want me to continue or are you going to fix it?

  5. Gary Roderick

    Just pushed commit c94203d that should address the issues with 'ago' obs on trends page and perhaps some 'ago' obs on dashboard (eg temp 24hr ago). File wdtags.py needs to be replaced with new version and of course Weewx stopped and restarted.

  6. Gary Roderick

    xcom7, testtags is still being generated with metric data. Can you confirm your [Units], Groups, group_temperature setting in your weewxwd skin.conf.

  7. Fernando

    gjr,

    Look at issue #11 for more details... Yes you are right everything is still default on the skin.conf but if I change it everything starts going crazy... I start getting crazy values.. I have not change it sense a few commits back. Is it safe to change?

  8. Gary Roderick

    xcom7, we have 3 main things that affect what units are generated in testtags.php and clientraw.txt; namely the custom generator code that pulls the data out of weewx, the tags used in the respective tmpl files and the skin.conf group settings that control how weewx interprets the data our custom generator pulls from weewx. With so many variables, changing one can have various effects on the other two. We had an error in our custom generator that was causing an inadvertent unit conversion on some of the tags. My commit yesterday fixed that (we believe). As you are aware clientraw.txt has a rigid format that requires tags in particular units. Once we have our custom generator functioning correctly the clientraw template will take care of these Unit settings. Testtags on the other hand is coded to be almost solely in your local (preferred) units. This is dependent on having your local group settings correct in the weewxwd skin.conf eg I have degree_C and I would expect you would have degree_F for temperature. There may well still be errors in clientraw and testtags but until we can prove that we have the custom generator code functioning correctly for both imperial and metric databases we will continue to chase our tails. Could I ask that you change your skin.conf Units, Groups settings to those that you customarily use. We can then see your testtags through using testtags.php?sce=view to see if it and the custom generator are functioning correctly.

  9. Fernando

    gjr,

    Things look better for sure. Though some of the values still look a bit odd and skeptical. For sure the Rain History.

    Take a look at my page Almanac and you will see some of the history does not make sense.

  10. Gary Roderick

    This is excellent, 5min-120min trend data shows we have the units issue sorted. Rain history etc is a separate issue. Generally if you are seeing 99.99 or suchlike it is because there were some issues getting that data out of weewx when I coded testtags.. If a reading is not flashing green every so often then it is coming from testtags.php and I can work through that as I can see your testtags,php. Thanks

  11. Vince Skahan reporter

    much better today but not quite there....

    rain history mon=99.99 in, year = 999.9 in total (sorry, not even here in Seattle :-) warmest night of year shows 99.9 F (nope) warmest day of year 'date' is 31-Dec-1969 baro lows all are null, dates 30-Nov-1999 gust high = 99.9 mph gust ave highs today/yest = 99.9 gust ave high dates all are 31-Dec-1969

    The temp/pressure values look good now, so it's getting better though :-)

  12. Gary Roderick

    refer my previous comment re 99.99 or 999 values! Also, current testtags does not have alltime records and a few other left field year/month ones. Am publishing a new version that should fix this (as soon as I make sure I have not overwritten Greg's recent changes!)

  13. Gary Roderick

    Commit c94203d resolved the issue 'ago' tags having wrong unit/values on dashboard and wxtrends.php page. commit 6de272e has provided many more tags that should see some of the other nonsense obs on these pages corrected. As the original issue of trend data being confused re units has been resolved I intend to close this issue tonite. I intend to open a new issue with an attached list of known tag issues (ie a list of tags for which we don't yet have weewx equivalents). Any issues on top of these should be opened as a new and separate issue.

  14. Gary Roderick

    Wxtrends.php issue initially reported here fixed with commit c94203d. There are still issues on wxtrends.php wrt Records and Stats and Wind Data. These will be addressed separately.

  15. Log in to comment