calculate rainRate for second rain gauge...?

180 views
Skip to first unread message

Christian Peters

unread,
Jun 25, 2020, 3:04:21 PM6/25/20
to weewx-user
Hi,

I read form a second rain gauge via filpile rain values/data into the data base value 'hail', as there is no second rain1, rain2...
As it is in the same group as rain all should be fine.
It works if I query
$day.hail.sum
it works.

But if I query
$current.hailRate
I got N/A. It's not provided by the gauge an I think i has to be calculated by software.

I tried that to get the hailRate:

[StdWXCalculate]
   
   
[[Calculations]]
       
# How to calculate derived quantities.  Possible values are:
       
#  hardware        - use the value provided by hardware
       
#  software        - use the value calculated by weewx
       
#  prefer_hardware - use value provide by hardware if available,
       
#                      otherwise use value calculated by weewx
       
....
        hailRate
= software

but it seems not implemented!? Any chance to get the calculation of rainRate (hailRate) for my second gauge by software calculation working!?


Thanks in advance.

Christian

gjr80

unread,
Jun 25, 2020, 7:50:46 PM6/25/20
to weewx-user
Hi,

As you have found adding hailRate to [StdWXCalculate] [[Calculations]] does nothing as StdWXCalculate does not know how to calculate hailRate. It was not specifically raised to address this issue but issue #491, if it continues down the path it is presently on, will likely see StdWXCalculate evolve such that the user will be able to define their own rate based derived observations (just like rainRate) via a few config lines in weewx.conf. If you can hang on until (hopefully) the next WeeWX point release you should see this feature added (provided I can get it past Tom and provided the next point release does not come out too soon :) ). Since your hailRate observation would be a derived one, and given that wee_database now has the ability to backfill derived observations, the delay should not see you miss any data.

If you really do want to implement your derived hailRate now you would need to modify the current StdWXCalculate behaviour or write a separate service to calculate hailRate.

Gary

Christian Peters

unread,
Jun 26, 2020, 4:34:51 PM6/26/20
to weewx-user
Gary,

thanks for that clarification. I'll have a look at the new feature if it will be released in the next weewx point release.

As there there seems to be a rainRate software computation available, maybe this could be copied and rainRate substituted by hailRate to get the hailrate working working?
This would be a workaround and maybe not to difficult to patch and fit my needs...but I know it would be wiped out with a new update of weewx....
I think at the moment I'm not skilled enough to write a service for the missing hailRate....

Where can I find the rainRate software computation in wewx?

Regards,

Christian

gjr80

unread,
Jun 27, 2020, 4:52:16 AM6/27/20
to weewx-user
Christian,

The StdWXCalculate service calculates rainRate for those systems where the driver does not provide it. You will find the StdWXCalculate code in bin/weewx/wxservices.py (https://github.com/weewx/weewx/blob/master/bin/weewx/wxservices.py). Adding hailRate is relatively straightforward but will require a good understanding of how the StdWXCalculate code operates.

Gary

Christian Peters

unread,
Jun 29, 2020, 2:40:08 AM6/29/20
to weewx-user
Gary,

thanks for the link and the explanation. I fear there is some code to understand and to change that to hailRate, will be be out of my skills I fear.
Should I raise a feature request in weewx git to add a second or third rain value in the databse with included rainRate computation?

Adding a additional
rain1
field to the database and assign it to the rain group would not enable rainRate computation for that added new value I think?

Thanks for your help.

Regards,

Christian

gjr80

unread,
Jun 29, 2020, 4:55:48 AM6/29/20
to weewx-user
I would not worry about raising anything Christian, the code I am working on would allow something like a rate based field to be calculated from some other (user specified) field. You still have to add any necessary extra fields to your database yourself, but StdWXCalculate could be configured to create the rate based field. No guarantees as it needs the Tom-tick but it looks good so far.

Gary

Christian Peters

unread,
Jul 6, 2020, 2:30:42 AM7/6/20
to weewx-user
Gary,

thanks...so I will wait for your code and hope it will be merged to get easy calculated some kind of rate in the future.

Regards,

Christian

Glenn McKechnie

unread,
Nov 13, 2022, 1:16:11 AM11/13/22
to weewx...@googlegroups.com
Breathing life into an old thread...

Did this idea get the "Tom-tick"?

I'm using hail and hailrate.

I've had a look at issue #491 and the new wxxtypes and wondering if
that is what was being referenced here. I can't see a way to make hail
(or snow!) work with it (RainRater) though. Hopefully some simple
stanza under [StdWXCalculate] [[WXXTypes]]?

I co-opted the hail field a while ago and have 5 years of data
supplied via a modified OWFS driver.

It would be helpful to have the hailrate to compare with the rainrate
from the original rain gauge as I'm cleaning up some extreme rain
values; which also means that issue #787 (wee_database --calc-missing
does not correctly calculate rainRate) bites if I want the historical
values?
--


Cheers
Glenn

rorpi - read only raspberry pi & various weewx addons
https://github.com/glennmckechnie

gjr80

unread,
Nov 16, 2022, 4:25:03 PM11/16/22
to weewx-user
Glenn,

Other things and a need to reacquaint myself with #491 have delayed me getting back to you. You are correct that StdWXCalculate cannot calculate rate based fields other than rainRate. #491 considered a number of approaches for calculating delta fields from total fields (the case in hand being field rain from a rain total field) and a number of approaches were considered, these approaches impacted on some of the other StdWXCalculate functions and I suspect my comment earlier in this thread was based on some of the early development code written under #491. As it turned out the final #491 solution resulted in the current hard coded rainRate approach.

Happy you look at generalising rate based calculation in StdWXCalculate and I have raised issue #813 to track this. Should have some time in the next week to work on this.

Gary

Glenn McKechnie

unread,
Nov 16, 2022, 5:11:19 PM11/16/22
to weewx...@googlegroups.com
Hi Gary,

Thanks for that.
I can appreciate that other things can often rank higher on the ever
changing ToDo list; such is its nature.

Will bookmark #813, and happy to test any code.
I can probably fire up a separate instance of weewx with another ow
adapter and rain ( hail / snow) counter if need be.

Hope you (and others) are high and dry in this wet summer we are
having. Seems odd to be in the middle of fire preparations but Aus
really is a country of extremes.


On 17/11/2022, gjr80 <gjrod...@gmail.com> wrote:
> Glenn,
>
> Other things and a need to reacquaint myself with #491
> <https://github.com/weewx/weewx/issues/491> have delayed me getting back to
>
> you. You are correct that StdWXCalculate cannot calculate rate based fields
>
> other than rainRate. #491 considered a number of approaches for calculating
>
> delta fields from total fields (the case in hand being field rain from a
> rain total field) and a number of approaches were considered, these
> approaches impacted on some of the other StdWXCalculate functions and I
> suspect my comment earlier in this thread was based on some of the early
> development code written under #491. As it turned out the final #491
> solution resulted in the current hard coded rainRate approach.
>
> Happy you look at generalising rate based calculation in StdWXCalculate and
>
> I have raised issue #813 <https://github.com/weewx/weewx/issues/813> to
> --
> 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/1e8d4083-e7ae-4c9c-bc54-36efb147c886n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages