How to aggregate by calendar month

56 views
Skip to first unread message

Karen K

unread,
Nov 29, 2020, 1:10:02 PM11/29/20
to weewx-user
To create a diagramm I have to set a value for "aggregate_interval" in seconds. That works fine for days and weeks, as they are always the same length in seconds. In contrast, months have a variable length of 28, 30, or 31 days. Even 29 days are possible sometimes. So, is there a possibility to aggregate by calendar month?

And then, it is not sure, that the aggregation interval starts at the beginning of a month.
Is there any possibility to force that?

Example:
    [[[yearhilowmonth]]] 
        time_length = 31536000 # 365 days 
        aggregate_interval = 2629800 # month?
        line_gap_fraction = None
        [[[[hi]]]]
            data_type = outTemp
            aggregate_type = max
            label = month max 
        [[[[low]]]]
            data_type = outTemp
            aggregate_type = min
            label = min 
        [[[[avg]]]]
            data_type = outTemp
            aggregate_type = avg
            label = average temperature

Tom Keffer

unread,
Nov 29, 2020, 9:33:06 PM11/29/20
to weewx-user
An aggregate_interval of 365.25 / 12 * 24 * 3600 = 2629800 is a "magic number" and recognized by WeeWX as a nominal month. 

The example you gave should get you what you want: monthly highs, lows, and averages.

--
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/fff1ce23-4428-4fea-bf8d-165b95c27624n%40googlegroups.com.

Karen K

unread,
Nov 30, 2020, 6:24:51 AM11/30/20
to weewx-user
Ah, so there is a special hack included for that problem.

Thank you for explaining.

Tom Keffer

unread,
Nov 30, 2020, 8:08:27 AM11/30/20
to weewx-user
Incidentally, if you order your lines low/avg/high, you can use a bar chart, which will be easier to read.

 [[[yearhilowmonth]]]
        time_length = 31536000 # 365 days
        aggregate_interval = 2629800# month?
        line_gap_fraction = None
        plot_type = bar

        [[[[low]]]]
            data_type = outTemp
            aggregate_type = min
            label = min
        [[[[avg]]]]
            data_type = outTemp
            aggregate_type = avg
            label = average temperature
        [[[[hi]]]]
            data_type = outTemp
            aggregate_type = max
            label = month max

-tk

Reply all
Reply to author
Forward
0 new messages