wee_database --calc-missing will only populate missing derived obs provided (1) the missing derived obs field contains no data and (2) the pre-requisites for the calculation exist. In your case you are failing on the first test - your
rainRate fields contain the value 0. You can try setting the
rainRate field to null in each affected record. Assuming you are using a SQLite database this is most reliably done using the sqlite3 utility. To do this:
1. using something like
Epoch Converter to determine the epoch timestamp for the first and last archive records in the block of records you wish to update, let's refer to these values as start_timestamp and end_timestamp
2. install the sqlite3 utility if not already installed:
$ sudo apt install sqlite3
3. stop WeeWX and make a backup of your WeeWX database, unless you have changed it this will be /home/weewx/archive/weewx.sdb or /var/lib/weewx/weewx.sdb depending on your WeeWX install type
4. set the rainRate field for the records concerned to null:
$ sqlite3 /home/weewx/archive/weewx.sdb
> UPDATE archive SET rainRate=NULL WHERE dateTime>=start_timestamp AND dateTime<=end_timestamp;
replacing start_timestamp and end_timestamp with the actual epoch timestamps. You can check the data has been cleared with the following query:
> SELECT dateTime,datetime(dateTime, 'unixepoch','localtime'),rain,rainRate FROM archive WHERE dateTime>=start_timestamp AND dateTime<=end_timestamp;
5. once happy the rainRate values have been nulled exit sqlite3 with .q
6. run
wee_database --calc-missing to calculate the missing
rainRate data, use the
--date or --from and --to to limit the span of records that
wee_database will operate on.
7. check the if rainRate has been correctly calculated:
$ sqlite3 /home/weewx/archive/weewx.sdb
> SELECT dateTime,datetime(dateTime, 'unixepoch','localtime'),rain,rainRate FROM archive WHERE dateTime>=start_timestamp AND dateTime<=end_timestamp;
> .q
If you are using MySQL/MariaDB the approach is the same, but you would use mysql in lieu of sqlite3.
Gary