Use of plotgen_ts in image generator xtype calls

32 views
Skip to first unread message

R

unread,
Jun 15, 2026, 7:55:45 PM (6 days ago) Jun 15
to weewx-development
Tom,

I am working on a modified ImageGenerator class to create some custom plots. I notice the code in ImageGenerator.gen_plot() passes plotgen_ts (vide option_dict) to  weewx.xtypes.get_series(). Comments in the code specifically stat the need to pass plotgen_ts.

My question is why? The weewx.xtypes.get_series() call includes the timespan of interest (x_domain) and aggregate interval (aggregate_interval) separately, I can see no need for any other 'timestamp'. As far as I can tell no get_series() method in any type in the code base uses plotgen_ts, in fact I can find no reference to plotgen_ts outside image generator.py.

 

Tom Keffer

unread,
Jun 16, 2026, 7:22:56 AM (6 days ago) Jun 16
to R, weewx-development
It's a good question. A safari through our git logs showed that Gary Roderick added it about 5 years ago, but he has since disappeared. 

See PR #673.

The commit message doesn't help much. I suspect it was something that Gary wanted to do. Unfortunately, his repositories disappeared with him.

I suppose we could remove it and see who complains. :-)

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/weewx-development/8a64f3e4-7c23-49dd-b77f-3a44b4e78ff5n%40googlegroups.com.

Paul R Anderson

unread,
Jun 16, 2026, 3:18:51 PM (6 days ago) Jun 16
to Tom Keffer, R, weewx-development
I believe calls to plotgen_ts may be related to stacked windrose-extension By Gary Roderick (gjr80)
Given that Gary's Github is gone it is archived at:


It's a pretty nice extension, I use it , and know many others have used it as well . Would hate to see it break.
Some brief excerpt from stackedwindrose.py

       # initialise some properties for later use
        self.plotgen_ts = None

               # Get end time for plot. In order try gen_ts, last known good
                # archive time stamp and then current time.
                self.plotgen_ts = gen_ts
                if not self.plotgen_ts:
                    self.plotgen_ts = db_manager.lastGoodStamp()
                    if not self.plotgen_ts:
                        self.plotgen_ts = time.time()

                    # get data tuples for speed and direction
                    # TODO. Review, may need to be time_length + 1
                    _span = weeutil.weeutil.TimeSpan(self.plotgen_ts - time_length,
                                                     self.plotgen_ts)
                    (_t_vec, _t_vec_stop, _sp_vec) = db_manager.getSqlVectors(_span,
                                                                              self.obs)
                    (_t_vec, _t_vec_d_stop, dir_data) = db_manager.getSqlVectors(_span,
                                                                                 self.dir_name)
Thanks,
Paul

Tom Keffer

unread,
Jun 16, 2026, 4:49:37 PM (6 days ago) Jun 16
to Paul R Anderson, R, weewx-development
Thanks, Paul.

I miss Gary.

R

unread,
Jun 16, 2026, 9:17:24 PM (5 days ago) Jun 16
to weewx-development
Reading the PR comments I guess it was to be used for 'complex plots', who knows.

stackedwindrose.py is completely independent of class ImageGenerator/imagegenerator.py so any use/change to plotgen_ts in class ImageGenerator/imagegenerator.py will have no impact on stackedwindrose.py. In fact looking at the code extract above, stackedwindrose.py uses some very old getSqlVectors calls rather than xtypes. I suspect the use of plotgen_ts by stackedwindrose is simply a case of using a common naming convention in a similar type environment.

No matter and in any case as I initially said I was working on a customised image generator and saw plotgen_ts being passed to an xtype. As I was altering plotgen_ts I wondered if there were wider implications of such changes though I could not find any (other) use of plotgen_ts in the code base. I guess someone may use it either in an xtype (though I suspect that is unlikely given its history). Anyway, my custom generator will only be used here so I don't think I need concern myself with any possible side effects.

Reply all
Reply to author
Forward
0 new messages