Fixing my database

64 views
Skip to first unread message

Auchtermuchty Weather

unread,
Feb 17, 2020, 10:00:58 AM2/17/20
to weewx-user
I've finally sorted out my rain gauge, but now I need to backfill the rainfall data.  There is a station near enough to me to use their data, but I could do with some guidance about what needs updating in my database, and if I need to run anything afterwards.  I used SQL for years in the day job so no problems there.

Andrew Milner

unread,
Feb 17, 2020, 10:18:49 AM2/17/20
to weewx-user
depends how completely you want to backfill!!
in the archive table there are columns for rain and rainrate which is a) the rain fall in the arhive period and b) the rainrate in the archive period.  For stations which do not provide rainrate this may well be a rainrate which decays over a period .

If you can fill in all the archive periods with the rainfall data the summary data could be recreated from the archive using drop daily and rebuild daily options of weewx_database utility.

alternatively you could fill in the columns in the rain daily summary table and the rainrate daily summary table for all the days you are missing

Auchtermuchty Weather

unread,
Feb 17, 2020, 11:42:29 AM2/17/20
to weewx-user
Thanks.

I need to go back to late November.  

I've found out how to get the date & time from the dateTime column.  :)

But is it just archive_day_rain.sum I need to update?

The weather station is one of the FineOffset ones, does this do rain rate?  I always assumed it was calculated.  But if fixing the rain & running weewx_database will fix it that will be great.

Looks like I need to read up weewx_database.  I can pick up the external data and put it in Excel which will let me build the SQL statements.  And yes, I will stop weewx and take a copy of weewx.sdb before I start changing data!

Auchtermuchty Weather

unread,
Feb 19, 2020, 3:59:05 AM2/19/20
to weewx-user
Ah I think I understand now.  

After a poke around looking at the .py files, I think I need to update archive.rain for one row for that date, then run wee_database --rebuild_daily for the date range I've altered.

And I need to make sure I update just one row in Archive for the date, not all of them!  I have a row every 5 minutes, so the one for 12:00:00 seems appropriate.  I can check before I try the update to make sure they all exists.  Still like the idea of using the Excel with the data from the other site to build the correct SQL.

Andrew Milner

unread,
Feb 19, 2020, 4:16:20 AM2/19/20
to weewx-user
you can put all the rain in one archive interval or you can spred it over many as long as the total for the day is correct - the choice is yours.
Reply all
Reply to author
Forward
0 new messages