Weekly page not showing wind gust max data in table

129 views
Skip to first unread message

Phil Green

unread,
Aug 31, 2020, 4:18:21 AM8/31/20
to weewx-user
Hello,
I have just spotted and issue with the reporting of the max wind gust on the weekly setting in the table at the left of my webpage.
I have altered the skin to show when the gust occurred.
The table is correct for month & year.
The graphical data is correct on the right hand side.
Can I check the data manually in the data base?
See attached screen shots.
Regards
Phil

Year.png
Week.png
Month.png

Tom Keffer

unread,
Aug 31, 2020, 5:27:44 PM8/31/20
to weewx-user
NB: The weekly statistics start Sunday. It is not the same as "last 7 days."

The week started early Sunday morning at 0000, 30 August. From your graph, the wind speed was zero all Sunday morning. So, max gust this week would be zero.

Or, am I misunderstanding your problem?

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/a3e4cc3d-98c7-4c59-8393-2bb5ededf9ccn%40googlegroups.com.

Phil Green

unread,
Sep 1, 2020, 7:19:25 AM9/1/20
to weewx-user
Hello Tom,
Thanks for the clarification, I thought the Weekly stats were a rolling 7 days not from Sunday. 
Thanks for great software & support. 
Regards
Phil

Graham Eddy

unread,
Sep 1, 2020, 7:36:02 AM9/1/20
to weewx-user
→ see $span($day_delta=7) for rolling 7 days (vs $week for since start of week)

Phil Green

unread,
Sep 4, 2020, 7:00:47 AM9/4/20
to weewx-user
Thanks for the info.
Where would I change the 
$week to $span($day_delta=7)

In the actual report file, in my case hilo.inc or in some definition elsewhere to set the aggravation period?
I have tried it in hilo.inc 
changing:-
#set $archive_data = [('day', $day), ('week', $week), ('month', $month), ('year', $year), ('rainyear', $rainyear)]
to:
#set $archive_data = [('day', $day), ('week', $span($day_delta=7)), ('month', $month), ('year', $year), ('rainyear', $rainyear)]
but it causes syntax errors.
So where would I change the definition of $week to a rolling 7 day period?
Regards
Phil

Tom Keffer

unread,
Sep 4, 2020, 8:05:48 AM9/4/20
to weewx-user
You didn't post what the "syntax errors" are, so it's hard to evaluate what went wrong. I suspect the problem is a technical one: precisely seven days earlier from the time may or may not lie on the start of a day. If it does not lie on the start of a day, then the daily summaries cannot be used to calculate 'wind' statistics. But, without seeing the "syntax error", I'm just guessing.

Why not just use the search list extension example that comes with WeeWX? It creates a tag $seven_day, which does what you want.

See the section Extending the list in the Customization Guide.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

Phil Green

unread,
Sep 4, 2020, 8:50:34 AM9/4/20
to weewx-user
Hello Tom,
I will try $seven_day rather than $week.
When I tried $span($day_delta=7) instead of $week I got the errors.
I have looked back in my log at the error messages and they are shown below, I have since gone back to using $week

Sep  4 11:35:15 Pi3-Weewx weewx[5658] INFO weewx.manager: Added record 2020-09-04 11:35:00 BST (1599215700) to database 'weewx.sdb'
Sep  4 11:35:15 Pi3-Weewx weewx[5658] INFO weewx.manager: Added record 2020-09-04 11:35:00 BST (1599215700) to daily summary in 'weewx.sdb'
Sep  4 11:35:15 Pi3-Weewx weewx[5658] INFO weewx.restx: PWSWeather: Published record 2020-09-04 11:35:00 BST (1599215700)
Sep  4 11:35:15 Pi3-Weewx weewx[5658] INFO weewx.restx: Wunderground-PWS: Published record 2020-09-04 11:35:00 BST (1599215700)
Sep  4 11:35:17 Pi3-Weewx weewx[5658] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'NameMapper.NotFound'>'
Sep  4 11:35:17 Pi3-Weewx weewx[5658] ERROR weewx.cheetahgenerator: **** Ignoring template /home/weewx/skins/Seasons/index.html.tmpl
Sep  4 11:35:17 Pi3-Weewx weewx[5658] ERROR weewx.cheetahgenerator: **** Reason: cannot find 'maxtime' while searching for 'wind.maxtime'
Sep  4 11:35:17 Pi3-Weewx weewx[5658] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Sep  4 11:35:17 Pi3-Weewx weewx[5658] ERROR weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/cheetahgenerator.py", line 322, in generate
Sep  4 11:35:17 Pi3-Weewx weewx[5658] ERROR weewx.cheetahgenerator: ****      unicode_string = compiled_template.respond()
Sep  4 11:35:17 Pi3-Weewx weewx[5658] ERROR weewx.cheetahgenerator: ****    File "_home_weewx_skins_Seasons_index_html_tmpl.py", line 309, in respond
Sep  4 11:35:17 Pi3-Weewx weewx[5658] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1707, in _handleCheetahInclude
Sep  4 11:35:17 Pi3-Weewx weewx[5658] ERROR weewx.cheetahgenerator: ****      self._CHEETAH__cheetahIncludes[_includeID].respond(trans)
Sep  4 11:35:17 Pi3-Weewx weewx[5658] ERROR weewx.cheetahgenerator: ****    File "cheetah__home_weewx_skins_Seasons_hilo_inc_1599215717_0843155_15331.py", line 372, in respond
Sep  4 11:35:17 Pi3-Weewx weewx[5658] ERROR weewx.cheetahgenerator: ****  NameMapper.NotFound: cannot find 'maxtime' while searching for 'wind.maxtime'
Sep  4 11:35:17 Pi3-Weewx weewx[5658] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 2.57 seconds
Sep  4 11:35:19 Pi3-Weewx weewx[5658] INFO weewx.imagegenerator: Generated 14 images for report SeasonsReport in 1.14 seconds

In hilo.ic
The section showing when the max wind occurred, I copied the variable from the tooltip for that section as tooltips don't work on my iPad in Safari?

      <tr>
        <td class="label">Wind Max</td>
        #for $archive in $archive_data
        <td class="data new_row hilo_$archive[0]">
          <span title="$archive[1].wind.maxtime">
            $archive[1].wind.max.format(add_label=False) ($archive[1].wind.maxtime)</span><br/>
          $archive[1].wind.gustdir.format(add_label=False)
        </td>
        #end for
        <td class="units">
          $unit.label.wind<br/>
          $unit.label.windDir
        </td>
      </tr>


Will let you know how I get on using $seven_day

Regards
Phil

Tom Keffer

unread,
Sep 4, 2020, 10:21:07 AM9/4/20
to weewx-user
Yes, that would be the error I outlined earlier. Type 'wind' appears only in the daily summaries. Seven days prior to a moment does not necessarily start at the beginning of a day, so the daily summaries are not always available.

But, it makes me think: perhaps tag $span should have an argument that forces the start time to be the beginning of the day...? Something like

$span($day_delta=7, $bod=True)

If 'bod' (aka, 'beginning of day') is True, then the start time is rounded to the start of the day.

Or, am I being too clever?

-tk

Graham Eddy

unread,
Sep 4, 2020, 10:48:12 AM9/4/20
to weewx...@googlegroups.com
it sounds like a useful generalisation if it covers cases such as official rain start time each day being 9am - rather than $bod, make it $hour or $offset or similar e.g. $span($day_delta=1, $hour=9) for previous day’s rain and $span($day_delta=0, $hour=9) for today’s rain.
i guess it would imply a $span($week_delta=1, $day=2) and perhaps even $span($week_delta=2, $day=3, $hour=9)

Phil Green

unread,
Sep 4, 2020, 10:51:49 AM9/4/20
to weewx-user
Hello Tom,
I have implemented the tag $seven_day.
The report is working fine for the past seven days now, although one thing I spotted for the pressure low for the past seven days occurred at 0345 last Friday morning, not at 0345 today Friday, but it is clear on the plotted data on the graph what's happening.
So will leave it be for now.
First time I have implemented a change to my Weewx system in a while.
This is my station page hosted on a Raspberry Pi3 at home.

I am a professional electronic engineer/firmware developer  using 'C' so need all the help I can get with Python, it has another level of complexity, plus I never got on with C++!
Thanks again for your help.
Regards
Phil

Phil Green

unread,
Sep 4, 2020, 10:58:18 AM9/4/20
to weewx-user
Just realised that the report may not have updated as the graphs for Weekly were updated at 1500 and I have made the changes since.
Reply all
Reply to author
Forward
0 new messages