Hi, thx for the response.I must be overlooking something, as the rainrate 
becomes zero. I took just one day, January 12, 2023. Below what I did:

1. Stop weewx: /etc/init.d/weewx stop

2. Set rainrate to NULL for 12-01-2023
 SQL: update archive set rainrate = NULL where 
date_format(from_unixtime(dateTime), '%d-%m-%Y') LIKE '12-01-2023';

3. Check for NULL (just a snippet) from 12-01-2023
SQL: select date_format(from_unixtime(dateTime), '%d-%m-%Y %H:%i') as 
datumtijd, round(rain,1) as rain,round(rainrate,1) as rainrate from archive 
where rain > 0 and date_format(from_unixtime(dateTime), '%d-%m-%Y') LIKE 
'12-01
-2023';
+------------------+------+----------+
| datumtijd        | rain | rainrate |
+------------------+------+----------+
| 12-01-2023 00:18 |  0.2 |     NULL |
| 12-01-2023 11:07 |  0.2 |     NULL |
| 12-01-2023 11:58 |  1.0 |     NULL |
| 12-01-2023 12:00 |  0.5 |     NULL |
| 12-01-2023 12:01 |  0.5 |     NULL |
| 12-01-2023 12:02 |  0.5 |     NULL |
| 12-01-2023 12:03 |  0.5 |     NULL |
<snip>

4. Run wee_database --calc-missing --date=2023-01-12
Using configuration file /etc/weewx/weewx.conf
Using database binding 'wx_binding', which is bound to database 
'archive_mysql'
Missing derived observations will be calculated from 2023-01-12 00:00:01 
CET (1673478001) through to 2023-01-13 00:00:00 CET (1673564400) inclusive.
Proceed (y/n)? y
Calculating missing derived observations...
Type beaufort has been deprecated. Use unit beaufort instead.
Processing record: 1440; Last record: 2023-01-13 00:00:00 CET (1673564400)
Recalculating daily summaries...
Records processed: 1000; time: 2023-01-12 16:40:00 CET (1673538000)
Finished recalculating daily summaries
Missing derived observations calculated in 1.33 seconds

5. Check for rainrate
SQL: select date_format(from_unixtime(dateTime), '%d-%m-%Y %H:%i') as 
datumtijd, round(rain,1) as rain,round(rainrate,1) as rainrate from archive 
where rain > 0 and date_format(from_unixtime(dateTime), '%d-%m-%Y') LIKE 
'12-01-2023';
+------------------+------+----------+
| datumtijd        | rain | rainrate |
+------------------+------+----------+
| 12-01-2023 00:18 |  0.2 |      0.0 |
| 12-01-2023 11:07 |  0.2 |      0.0 |
| 12-01-2023 11:58 |  1.0 |      0.0 |
| 12-01-2023 12:00 |  0.5 |      0.0 |
| 12-01-2023 12:01 |  0.5 |      0.0 |
| 12-01-2023 12:02 |  0.5 |      0.0 |
| 12-01-2023 12:03 |  0.5 |      0.0 |
| 12-01-2023 12:04 |  0.5 |      0.0 |
| 12-01-2023 12:05 |  0.5 |      0.0 |
| 12-01-2023 12:06 |  0.5 |      0.0 |
| 12-01-2023 12:07 |  0.5 |      0.0 |
| 12-01-2023 12:08 |  0.5 |      0.0 |
| 12-01-2023 12:09 |  0.5 |      0.0 |
| 12-01-2023 12:10 |  0.5 |      0.0 |
| 12-01-2023 12:11 |  0.5 |      0.0 |
| 12-01-2023 12:12 |  0.5 |      0.0 |
| 12-01-2023 12:13 |  0.5 |      0.0 |



What am I overlooking/missing?


Op zaterdag 14 januari 2023 om 23:17:09 UTC+1 schreef gjr80:

> You should try using the --calc-missing action 
> <http://weewx.com/docs/utilities.htm#Action_--calc-missing> with 
> wee_database. --calc-missing will calculate any missing derived 
> observations in your database, rainRate is a derived observation as far 
> as WeeWX is concerned, you may have prefer_hardware against rainRate in 
> StdWXCalculate but that should not matter in this case (prefer_hardware 
> simply 
> means try to get the observation from the station/driver and if you can't 
> calculate it). wee_database does not interrogate your station/driver for 
> data in any way.
>
> Note that for wee_database to consider an observation to be 'missing' the 
> corresponding database field(s) must be empty or have been set to 
> null/None. Being set to 0 (zero) is not considered empty nor is saving a 
> zero length string (as can happen sometimes when using a graphical frontend 
> to edit your database) and hence will not be re-calculated. Assuming you 
> are dealing with a small segment of your data, you may wish to use the 
> --from and --to command line options when using --calc-missing to limit 
> the date span to be re-calculated.
>
> Gary
> On Sunday, 15 January 2023 at 00:45:54 UTC+10 [email protected] wrote:
>
>> Hi. I have a Davis Vantage Pro 2. StdWxCalculate says that rainrate 
>> should be taken from 'prefered hardware'.
>>
>> However, I needed to add some rainticks into the database, to correct 
>> daily rainfall sums (long story, tipping bucket broke down). I want to 
>> recalculate all rainrate values.
>>
>> What is the way to do that?
>>
>> I tried wee_database --drop-daily and --rebuild-daily, but the stored 
>> rainrate values remain the same (which makes sense, as in StdWxCalculate it 
>> should take them from hardware, which Davis provides). But now, I want to 
>> recalculate rainrate values, based on the rain-values that's already in the 
>> database.
>>
>> Can this be done? How?
>>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/770ff5b3-2bf0-440b-b360-3449f2142905n%40googlegroups.com.

Reply via email to