Re: [weewx-user] rebuilding just a couple tables rather than dropping+rebuilding all

2016-10-13 Thread vince


> You could just redo the sums using an update sql statement. Assuming  
> is the unix epoch time of the start of the day you wish to edit, It would 
> be something like (NOT TESTED)
>
> update archive_day_rain set sum=1.0 where dateTime = ;
>
>
> alternatively, if you wanted the actual sum:
>
> update archive_day_rain set sum=(select sum(rain) from archive where 
> dateTime> and dateTime <=(+86400)) where dateTime=;
>
>
>>
yes - I did the first one and just forced the sum, thanks for confirming 
what I was thinking.

FWIW, I got  via the following:

echo "select datetime(dateTime,'unixepoch','localtime'),dateTime,sum from 
archive_day_rain order by rowid desc limit 1;" | sqlite3 weewx.sdb



-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] rebuilding just a couple tables rather than dropping+rebuilding all

2016-10-13 Thread Thomas Keffer
Issue #117  is a request to
allow selective rebuilding of the daily summaries, but it has not been
implemented yet.

rainRate is not used in weewx except for reporting purposes. If you don't
care about a graph of rain rate, it can be ignored.

Unfortunately, you can't just remove individual records from
archive_day_rain and expect it to rebuild.

You could just redo the sums using an update sql statement. Assuming 
is the unix epoch time of the start of the day you wish to edit, It would
be something like (NOT TESTED)

update archive_day_rain set sum=1.0 where dateTime = ;


alternatively, if you wanted the actual sum:

update archive_day_rain set sum=(select sum(rain) from archive where
dateTime> and dateTime <=(+86400)) where dateTime=;


Hope this helps.

-tk




On Thu, Oct 13, 2016 at 3:06 PM, vince  wrote:

> We have a bunch of storms approaching and I noticed that I was measuring
> zero rain.  Got home from work and got the ladder out and found the VP2
> rain weep hole plugged with some debris. Sigh.
>
> Three neighboring stations each measure about 1.00 inches of rain today
> for 00:00-14:00 so I'd like to add rain info to match into my archive, and
> rebuild the various tables and reports. I'd like to not have to drop all
> the tables and rebuild 10 years of summaries.  I have 910,000 archive
> records, that would take forever to run.  Is there a clean way to just
> rebuild:
>
>- the archive_day_rain table
>- the archive_day_rainRate table
>- the NOAA reports for this month and year
>- whatever else I forgot
>
> I updated the last 100 records in my archive table, setting rain=0.01 inch
> values to try to line up with the 1.00 inches of rain today that
> neighboring stations have measured:
>
>- I did not add any 'sum' values to those records (should I have ?)
>- I did not add any 'rainRate' values to those records (I'm ok with
>not doing so unless it affects other calculations somehow)
>- Should I just 'remove' today's record from archive_day_rain and
>archive_day_rainRate and expect/hope weewx to calculate them ?  Edit them ?
>
>
>
> I could probably do an offline drop+rebuild if absolutely forced to, but
> this question seems to come up often, so I'm looking to see if there's a
> quicker way for more focused edits like this
>
>
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[weewx-user] rebuilding just a couple tables rather than dropping+rebuilding all

2016-10-13 Thread vince
We have a bunch of storms approaching and I noticed that I was measuring 
zero rain.  Got home from work and got the ladder out and found the VP2 
rain weep hole plugged with some debris. Sigh.

Three neighboring stations each measure about 1.00 inches of rain today for 
00:00-14:00 so I'd like to add rain info to match into my archive, and 
rebuild the various tables and reports. I'd like to not have to drop all 
the tables and rebuild 10 years of summaries.  I have 910,000 archive 
records, that would take forever to run.  Is there a clean way to just 
rebuild:

   - the archive_day_rain table
   - the archive_day_rainRate table
   - the NOAA reports for this month and year
   - whatever else I forgot

I updated the last 100 records in my archive table, setting rain=0.01 inch 
values to try to line up with the 1.00 inches of rain today that 
neighboring stations have measured:

   - I did not add any 'sum' values to those records (should I have ?)
   - I did not add any 'rainRate' values to those records (I'm ok with not 
   doing so unless it affects other calculations somehow)
   - Should I just 'remove' today's record from archive_day_rain and 
   archive_day_rainRate and expect/hope weewx to calculate them ?  Edit them ? 



I could probably do an offline drop+rebuild if absolutely forced to, but 
this question seems to come up often, so I'm looking to see if there's a 
quicker way for more focused edits like this



-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.