Xstats - Rain - sum_ge

58 views
Skip to first unread message

Chris Davies-Barnard

unread,
Oct 2, 2020, 3:06:12 AM10/2/20
to weewx-user
Morning,

I would like to be able to output the number of days over 1mm rain for the xstat options such as 7 days, 30 days etc. but 

$thirty_day.rain.sum_ge((1.0,'mm'))

does not appear to work.   Is this correct?

Regards

Chris


Tom Keffer

unread,
Oct 2, 2020, 8:06:28 AM10/2/20
to weewx-user
You're not giving a lot of information. Depends on how "thirty_day" is implemented.

--
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/bf08670a-d902-43b3-a6a3-c45e5c6382b2n%40googlegroups.com.

Chris Davies-Barnard

unread,
Oct 2, 2020, 1:26:22 PM10/2/20
to weewx-user
Apologies Tom,

So I'm using the standard example xstats extension which has the following code:

# Now use a similar process to get statistics for the last 30 days.
days_dt = datetime.date.fromtimestamp(timespan.stop) - datetime.timedelta(days=30)
days_ts = time.mktime(days_dt.timetuple())
thirty_day_stats = TimespanBinder(TimeSpan(days_ts, timespan.stop),
db_lookup,
context='thirty_day',
formatter=self.generator.formatter,
converter=self.generator.converter)


which I assumed (probably wrongly) had all the same aggregation types as everything else as there wasn't any detail in the file.

Although searching around I have found your new xstats https://github.com/tkeffer/weewx-xstats/blob/master/bin/user/xstats.py which might help me do everything else I want to do.

Thanks as always.  Think I have now been using Weewx on and off since version 2 and its always so impressive in its flexibility and stability.  

Chris.
Reply all
Reply to author
Forward
0 new messages