Max/min Daily/Monthly/Yearly sum

81 views
Skip to first unread message

michael.k...@gmx.at

unread,
Sep 25, 2022, 9:00:33 AM9/25/22
to weewx-user
How to calculatate the maximum or minimum daily/monthly/yearly sum of a value?

E.g.: the wettest day of the month (so far)? The wettest month of the year(so far)? The wettest day of the year (so far)? The wettest year? The wettest month of all time? The wettest day of all time?

The dryest day of the month? The  dryest month of the year? The  dryest  year? The  dryest  month of all time?

And how to exclude the current month, year for these calculations? From the 1st of January's point of view, the current year is probably the dryest year of all time, from the 1st of the current month's view, the current month is probably the dryest of the year, at least ex aequo.

Tom Keffer

unread,
Sep 25, 2022, 2:37:44 PM9/25/22
to weewx...@googlegroups.com
That's a lot of questions! Answer to a few of them:

Wettest day of the month: $month.rain.maxsum
Time of the wettest day of the month: $month.rain.maxsumtime
Driest day of the month: $month.rain.minsum
Time of the driest day of the month: $month.rain.minsumtime

Similar pattern for the wettest / driest day of the year.
Similar pattern for the wettest / driest day for all time (use tag $alltime)

To get wettest/driest month or year would require some custom code (aggregates like ".maxsum" work only for days). You can either write a custom search list extension, or a custom xtypes aggregation.

See the xtypes extension weewx-xtypes. You may find it useful if for no other reason than as a guide to how to write a custom aggregation. It wouldn't be hard to extend it to do things like historical highs and lows for months and years.

-tk







--
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/8cf127e5-209e-482f-a1cb-5778eb9efbdan%40googlegroups.com.

michael.k...@gmx.at

unread,
Sep 27, 2022, 1:21:47 PM9/27/22
to weewx-user
Thank you for explaining, I've found these things in the docs, but was wondering if there is already a solution not only for days but also moths and years. For the driest days/months/years it won't work in a reasonable way without excluding the current week/month/year.

Regarding the maxsumtime,  can you explain why the maxsumtime is "Dienstag um 06:55" ("Tuesday at 06:55a.m.") for this week? It is true that today (Tuesday) it rained 6,5mm and yesterday it rained less and the week here starts with Mondays., so the wettest day of the week inclunding the sum is correct. But today it rained also after 06:55. Not to mention that I rather doubt that a time specification beyond the day's date makes any sense with daily sums.
2022-09-27 19_11_10-Das Wetter in Rif - Brave.png

Here's the snippet for the "Max. tägl. Regenmenge" row:
<tr>
    <th>$BootstrapLabels.stats.maxRainSumDay</th>
    <td>&nbsp;</td>
    <td>$week.rain.maxsum<br><span class="statsTime">$week.rain.maxsumtime</span></td>
    <td>$month.rain.maxsum<br><span class="statsTime">$month.rain.maxsumtime</span></td>
    <td>$year.rain.maxsum<br><span class="statsTime">$year.rain.maxsumtime</span></td>
    <td>$alltime.rain.maxsum<br><span class="statsTime">$alltime.rain.maxsumtime</span></td>
</tr>

Reply all
Reply to author
Forward
0 new messages