Forum Użytkowników Stacji Pogodowych

Stacje Pogody - oprogramowanie => Inne oprogramowanie => Wątek zaczęty przez: kaliszfornijczyk w 19 Listopad, 2016, 22:18:42

Tytuł: Jak usunąć błędne dane z Weewx ?
Wiadomość wysłana przez: kaliszfornijczyk w 19 Listopad, 2016, 22:18:42
Witam.
Od niedawna mam stronę z danymi ze stacji www.tomekpogoda.cba.pl (http://www.tomekpogoda.cba.pl) niestety nie wszystkie przesyłane dane są poprawne (np. High Wind Speed 201 km/h from N/A at 16-Nov-2016 17:49 itp.) To bardzo psuje statystyki i rekordy stacji. Mam WH1080, Weewx chodzi na Raspberry Pi.
Czy ktoś może mi wytłumaczyć KROK PO KROKU jak usunąć taki rekord ?
Tytuł: Odp: Jak usunąć błędne dane z Weewx ?
Wiadomość wysłana przez: kaliszfornijczyk w 20 Listopad, 2016, 19:41:16
Znalazłem taką instrukcję :
==============================================================================
Many weather hardware will occasionally emit a bad data value. This will not only cause your plots to look bad, but it can also cause many errors in historical hi/low, NOAA reports, etc.

Here's a method for deleting these bad values in a sqlite database. You will need the command line utility sqlite3. To install it on a Debian system:

sudo apt-get install sqlite3
As always, it is prudent to work off a temporary copy of your db. Stop weewx. Copy your database to /var/tmp or another scratch location. Work on it there. Copy the modified version back into place (possibly saving the original one just in case).

For the sake of a concrete example, let's assume that you are trying to find and remove some windSpeed and windGust values greater than 100.

To find these records:

echo "SELECT * FROM archive WHERE (windSpeed > 100);" | sqlite3 mydb.sdb
echo "SELECT * FROM archive WHERE (windGust  > 100);" | sqlite3 mydb.sdb
To null out these fields:

echo "UPDATE archive SET windSpeed=NULL WHERE (windSpeed > 100);" | sqlite3 mydb.sdb
echo "UPDATE archive SET windGust=NULL  WHERE (windGust  > 100);" | sqlite3 mydb.sdb
Now you need to drop the daily summaries, which will also include these bad data. Use the tool wee_database to do this:

wee_database weewx.conf --drop-daily
The summaries will be rebuilt the next time weewx starts. As this can take a long time, you may want to do this explicitly:

wee_database weewx.conf --backfill-daily
Finally, to avoid a problem in the future, be sure to set a range of acceptable values for service StdQC. See the section StdQC in the User's Guide for details on how to do this.
========================================================================

Ja po wpisaniu komendy: echo....

pi@raspberrypi ~ $ echo "SELECT * FROM archive WHERE (windSpeed > 100);" | sqlite3 mydb.sdb

wychodzi mi coś takiego:

-bash: sqlite3: command not found

To gdzie się wpisuje to ? : echo "SELECT * FROM archive WHERE (windSpeed > 100);" | sqlite3 mydb.sdb