Replacing charting/plotting with PyCha

60 views
Skip to first unread message

Ken C

unread,
Apr 18, 2012, 3:32:39 PM4/18/12
to weewx...@googlegroups.com
I just got PyCha and Cairo installed on my weewx embedded server, and would like to use them to generate all of the plots/charts. I'm comfortable with PyCha after having gone through all the examples, so no problem there.

Ideally, I'd like to replace the charting/plotting code, so that it handles the same parameters from skins.conf. 

I haven't looked at the weewx plotting code yet, but I'm looking for any pointers or gotchas before I start. Is genplot.py the entry point for plotting? Is that where I should start?

Cheers,
Ken

Ken C

unread,
Apr 18, 2012, 3:45:25 PM4/18/12
to weewx...@googlegroups.com
A better question for me to ask is, how best to test the changes? Since I don't want to wait every x minutes for the plotting to run automatically, how do I manually trigger the report generation to run?

After a quick look through genplot.py, I can see that it does all the heavy lifting. Since PyCha presents a higher level of abstraction, it's going to be a hack 'n' slash job :)

Ken

vds

unread,
Apr 18, 2012, 6:00:35 PM4/18/12
to weewx...@googlegroups.com
On Wednesday, April 18, 2012 12:32:39 PM UTC-7, Ken C wrote:
I just got PyCha and Cairo installed on my weewx embedded server, and would like to use them to generate all of the plots/charts. 

I guess my question is 'why' ?

Is there a chart you can't do, or is it performance, or footprint of weewx while running, or is it just for the fun of the adventure ?

Ken C

unread,
Apr 18, 2012, 8:38:43 PM4/18/12
to weewx...@googlegroups.com
I never justify 'Why?' on the Internet.

Any contribution towards my original question?

Cheers,
Ken

Thomas Keffer

unread,
Apr 18, 2012, 9:40:52 PM4/18/12
to weewx...@googlegroups.com
Hi, Ken

I'm on the road and away from my development machine right now, so what follows is from memory.

weeplot/genplot.py is the actual charting software used by weewx. I would think a better start point is weewx/imagegenerator.py. It contains ImageGenerator, a superclass of ReportGenerator, which is responsible for generating the charts. It uses genplot.py as an implementation for generating those plots, but your job would be to substitute a different implementation.

To have weewx just run the reports, use bin/runreports.py, giving the configuration file (weewx.conf) as its sole argument. Well, not quite. By default, it generates a report current as of the last timestamp in the database. You can give a timestamp as a second argument and it will generate a report current as of that time.

-tk




Ken

--
You received this message because you are subscribed to the Google Groups "Weewx Weather Station Discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msg/weewx-user/-/30PTLuJRK18J.

To post to this group, send email to weewx...@googlegroups.com.
To unsubscribe from this group, send email to weewx-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/weewx-user?hl=en.



--
Thomas Keffer

kef...@threefools.org
+1 541-386-8891 (h)
+1 541-490-9507 (c)
Skype: tkeffer

Ken C

unread,
Apr 19, 2012, 12:08:56 AM4/19/12
to weewx...@googlegroups.com
Thanks Thomas, that's a great help. I'll let you know how I get on.

Cheers,
Ken


On Wednesday, 18 April 2012 21:40:52 UTC-4, Tom Keffer wrote:
Hi, Ken

I'm on the road and away from my development machine right now, so what follows is from memory.

weeplot/genplot.py is the actual charting software used by weewx. I would think a better start point is weewx/imagegenerator.py. It contains ImageGenerator, a superclass of ReportGenerator, which is responsible for generating the charts. It uses genplot.py as an implementation for generating those plots, but your job would be to substitute a different implementation.

To have weewx just run the reports, use bin/runreports.py, giving the configuration file (weewx.conf) as its sole argument. Well, not quite. By default, it generates a report current as of the last timestamp in the database. You can give a timestamp as a second argument and it will generate a report current as of that time.

-tk

On Wed, Apr 18, 2012 at 12:45 PM, Ken C <kenca...@gmail.com> wrote:
A better question for me to ask is, how best to test the changes? Since I don't want to wait every x minutes for the plotting to run automatically, how do I manually trigger the report generation to run?

After a quick look through genplot.py, I can see that it does all the heavy lifting. Since PyCha presents a higher level of abstraction, it's going to be a hack 'n' slash job :)

Ken

--
You received this message because you are subscribed to the Google Groups "Weewx Weather Station Discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msg/weewx-user/-/30PTLuJRK18J.

To post to this group, send email to weewx...@googlegroups.com.
To unsubscribe from this group, send email to weewx-user+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/weewx-user?hl=en.

vds

unread,
Apr 19, 2012, 3:36:59 PM4/19/12
to weewx...@googlegroups.com
On Wednesday, April 18, 2012 5:38:43 PM UTC-7, Ken C wrote:
I never justify 'Why?' on the Internet.

Any contribution towards my original question?

I didn't ask for any justification.....

I had never heard of that package before, so I'm curious what
in there makes it worth spending time on trying to switch to,
considering weeewx seems to solve its core problem scenario
pretty well.

And I'd suggest you try decaf before you get all huffy.


Philippe Amram

unread,
Apr 20, 2012, 9:08:51 AM4/20/12
to weewx...@googlegroups.com
I'm not a specialist, but if I had to use new interface tools, I might choose Google Charts (https://developers.google.com/chart/interactive/docs/gallery/controls).
All the best
Cheers

Philippe

Thomas Keffer

unread,
Apr 20, 2012, 9:54:04 AM4/20/12
to weewx...@googlegroups.com
Or flot.

-tk

--
You received this message because you are subscribed to the Google Groups "Weewx Weather Station Discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msg/weewx-user/-/JWdFpnkOexoJ.

To post to this group, send email to weewx...@googlegroups.com.
To unsubscribe from this group, send email to weewx-user+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/weewx-user?hl=en.

Philippe AMRAM

unread,
Apr 20, 2012, 9:57:15 AM4/20/12
to weewx...@googlegroups.com
Looks excellent !

Philippe
Reply all
Reply to author
Forward
0 new messages