windRun charts?

192 views
Skip to first unread message

pannetron

unread,
Jun 3, 2024, 5:25:18 PM6/3/24
to weewx-user
Where may I find references for calculating and plotting daily, monthly, etc. charts for windrun?  Specifically for the Belchertown skin?  My docs searches came up empty.

Thanks!

Russ

vince

unread,
Jun 3, 2024, 6:36:26 PM6/3/24
to weewx-user
Ummmm by googling for “weewx belchertown windrun” or “weewx windrun” or “belchertown windrun” perhaps ?

You might try rewording your question a bit to make it easier to figure out what exactly you are asking or trying to accomplish…

Russ Panneton

unread,
Jun 3, 2024, 8:00:36 PM6/3/24
to weewx...@googlegroups.com

You might try rewording your question a bit to make it easier to figure out what exactly you are asking or trying to accomplish…


Thanks!  I want to create charts showing windrun by day over N weeks and a chart showing windrun by week over N months.  My db has entries for "archive_day_windrun" with "sum" and "wsum" fields." I'm unclear on *exactly* what the definition is for those fields; I'm a python guy but looking at wxxtypes.py didn't answer my question.  I also failed to find any call to "calc_windrun()" that might inform me.  My guess is that "sum" from the db for a day is what I want to use for plots and is the avg daily windSpeed * 24.  Searching the Belchertown docs, I failed to find something to get me started on creating a chart for weekly, monthly, etc. windrun.  We live in a WINDY area and I'm interested in plotting our windiest days and months.  So I'm looking for a link or RTFM that might help me get started!  I'll spend more time in the weewx docs on types and Belchertown on creating charts/graphs to see what I may have overlooked...

I'm relatively new to weewx so I'm still learning how to navigate ;-)  I'm still happily running weewx 4.10.2 and Belchertown 1.2 until I spin up another pi4 with weewx 5.x - https://panneton.net/weather

vince

unread,
Jun 3, 2024, 8:40:26 PM6/3/24
to weewx-user
Belchertown can be a little complicated.  Basically you want to copy its graphs.conf.example to graphs.conf, then edit your custom graphs.conf to add definitions for whatever graphs you want to add.  I *think* you need to restart weewx to make them take effect, but it doesn't hurt anything to do so regardless.

So in graphs.conf if you look under [day] you will see the graphs it adds to the daily pick.  Similarly for [homepage], [month], [week], [year].

Just add a section that looks like the others, naming it something [unique] and referencing the windrun element.

Something like the following (untested):

    [[chart123]]
        title = Wind Run
        [[[windrun]]]


pannetron

unread,
Jun 4, 2024, 10:42:07 AM6/4/24
to weewx-user
That much I knew, and it's the easy part.  What I want help with is adding windrun as, I guess, an aggregate type. I think that's core weewx. Here's the relevant traceback. You can see that xtypes.get_series() failed to find an aggregate type for windrun:

Jun  4 08:05:17 pi4-3 wee_reports[25376] ERROR weewx.reportengine: Caught unrecoverable exception in generator 'user.belchertown.HighchartsJsonGenerator'
Jun  4 08:05:17 pi4-3 wee_reports[25376] ERROR weewx.reportengine:         ****  Error trying to use database binding wx_binding to graph observation windrun. Error was: 'windrun' or 'max'.
Jun  4 08:05:17 pi4-3 wee_reports[25376] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Jun  4 08:05:17 pi4-3 wee_reports[25376] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/user/belchertown.py", line 2335, in get_observation_data
Jun  4 08:05:17 pi4-3 wee_reports[25376] ERROR weewx.reportengine:         ****      (time_start_vt, time_stop_vt, obs_vt) = archive.getSqlVectors(TimeSpan(start_ts, end_ts), obs_lookup, aggregate_type, aggregate_interval)
Jun  4 08:05:17 pi4-3 wee_reports[25376] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/manager.py", line 612, in getSqlVectors
Jun  4 08:05:17 pi4-3 wee_reports[25376] ERROR weewx.reportengine:         ****      return weewx.xtypes.get_series(obs_type, timespan, self,
Jun  4 08:05:17 pi4-3 wee_reports[25376] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/xtypes.py", line 116, in get_series
Jun  4 08:05:17 pi4-3 wee_reports[25376] ERROR weewx.reportengine:         ****      raise weewx.UnknownType(msg)
Jun  4 08:05:17 pi4-3 wee_reports[25376] ERROR weewx.reportengine:         ****  weewx.UnknownType: 'windrun' or 'max'
Jun  4 08:05:17 pi4-3 wee_reports[25376] ERROR weewx.reportengine:  

So now I'm reading the XTypes documentation to learn how to add windrun: https://github.com/weewx/weewx/wiki/xtypes

pannetron

unread,
Jun 4, 2024, 10:51:45 AM6/4/24
to weewx-user
Maybe I'll punt on windrun and just look at average windspeed...

vince

unread,
Jun 4, 2024, 12:58:29 PM6/4/24
to weewx-user
You give up quickly.  If windrun is in your db and your Belchertown 'records' page, you just need to find the right incantation to graph it however you want.

First check your db to be sure....

My VP2 data from the archive table

sqlite> select datetime(dateTime,'unixepoch','localtime'),windrun from archive order by rowid desc limit 5;
2024-06-04 09:40:00|0.5
2024-06-04 09:35:00|0.583333333333333
2024-06-04 09:30:00|0.5
2024-06-04 09:25:00|0.5
2024-06-04 09:20:00|0.333333333333333


or from the day summary table

select datetime(dateTime,'unixepoch','localtime'),dateTime,min,max,sum,wsum from archive_day_windrun order by rowid desc limit 10;

sqlite> select datetime(dateTime,'unixepoch','localtime'),sum,wsum from archive_day_windrun order by rowid desc limit 5;
2024-06-04 00:00:00|29.75|8925.0
2024-06-03 00:00:00|117.0|35100.0
2024-06-02 00:00:00|60.25|18075.0
2024-06-01 00:00:00|25.1666666666667|7550.0
2024-05-31 00:00:00|37.6666666666667|11300.0

(the last few days have been very windy here and it's only 9am)

and the Belchertown skin 'Records' page should show your yearly and alltime record totals for a day

Highest Daily Wind Run188.83 milesJanuary 9, 2024228.67 milesNovember 15, 2021


vince

unread,
Jun 4, 2024, 2:51:13 PM6/4/24
to weewx-user
FWIW, this seems to generate the same high peak for the year that matches Belchertown's records page for the year, although I'm at a bit of a loss regarding .

See if this works for you in your [year] section of graphs.conf

     [[yearwindrun]]
       title = Wind Run
       yscale = None, None, 0.02
       plot_type = bar
       [[[windrun]]]
          aggregate_type = sum
          aggregate_interval = 86400

If you want to generate a similar graph in cheetah for a normal (non-highcharts) skin, just add one level of [ ] around the example above and stick it in skin.conf

I'm terrible at tweaking cheetah vs. highcharts graphs so I don't have a good solution if you want stuff in your week or month graphs.   Basically you want the sum of the windrun for a day.

Russ Panneton

unread,
Jun 4, 2024, 3:34:52 PM6/4/24
to weewx...@googlegroups.com
Thank you, I'll give this a try!  The data is in my db, at least since weewx has been populating it the last couple of years vs. old wview.

Russ Panneton

unread,
Jun 4, 2024, 5:19:08 PM6/4/24
to weewx...@googlegroups.com
Same error out of weewx.xtypes.get_series()...

vince

unread,
Jun 4, 2024, 5:20:25 PM6/4/24
to weewx-user
Cannot help you. Works here.

Russ Panneton

unread,
Jun 4, 2024, 5:31:11 PM6/4/24
to weewx...@googlegroups.com
Thanks for engaging with me, I appreciate it!  Your suggestion on how to add info to the graphs.conf file, once I crack the aggregate type problem, will come in handy!

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/jz-NJ6803eQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/cff7d57c-393e-4ac9-84b2-0f15f063f540n%40googlegroups.com.

Karen K

unread,
Jun 5, 2024, 7:24:50 AM6/5/24
to weewx-user
The keywords for graphs.conf differ a little bin from those in weewx.conf. The plot type is "type" only. "yscale" is not available. Use "yAxis_min", "yAxis_max", and "yAxis_tickinterval" instead. "windrun" must be included in the database. If not, use "weectl database" to insert it.
Reply all
Reply to author
Forward
0 new messages