correct the amount of rain fall

450 views
Skip to first unread message

Massimiliano Neri

unread,
Apr 21, 2017, 3:00:32 PM4/21/17
to weewx-user
I am using Weewx for 2 weeks, I need to correct the amount of rain fall, either daily, monthly and annually. You can tell me the procedure for making these fixes. thank you.

Thomas Keffer

unread,
Apr 21, 2017, 6:01:50 PM4/21/17
to weewx-user
See if this answers your question: Cleaning up old "bad" information.

If not, come on back and give us a little more information.

-tk

On Fri, Apr 21, 2017 at 12:00 PM, Massimiliano Neri <icnm...@gmail.com> wrote:
I am using Weewx for 2 weeks, I need to correct the amount of rain fall, either daily, monthly and annually. You can tell me the procedure for making these fixes. thank you.

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

Massimiliano Neri

unread,
Apr 21, 2017, 6:07:27 PM4/21/17
to weewx...@googlegroups.com

Hello Thomas, I would like to reset the content of the rest of the day on 21-04-2017, how can I make the SQL statement?

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/EQ3Cuyxx7Mg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Massimiliano Neri
Via del Castello 4 -
05015 Fabro (TR) - ITALY.

Phone:    +39 339 1997334
Fax:       +39 0763 831347

E-mail PEC: neri_mas...@pec.it

Visita il sito:



Massimiliano Neri

unread,
Apr 21, 2017, 6:09:12 PM4/21/17
to weewx-user

Hello Thomas, I would like to reset the content of the rain of the day on 21-04-2017, how can I make the SQL statement?

Thomas Keffer

unread,
Apr 21, 2017, 6:30:17 PM4/21/17
to weewx-user
We need more information than that.

What time zone? UTC+02:00?

How did you install? Using setup.py, or Debian? Or, something else?

Do you want to zero out all rain data for the day? Or, is there just one bad value? If just one value, roughly how big is the value?

Try this and tell me what you get

cd /var/lib/weewx
echo "SELECT dateTime, rain FROM archive WHERE dateTime > 1492725600 and dateTime <= 1492812000 AND rain > 0;" | sqlite3 weewx.sdb

(NB: 1492725600 is midnight 21-04-2017, and 1492812000 is midnight 22-04-2017 in the time zone UTC+02:00.)

-tk


-tk


--

Massimiliano Neri

unread,
Apr 22, 2017, 7:08:55 AM4/22/17
to weewx...@googlegroups.com

Hi thomas, 1) The time zone for this season is UTC + 02:00 2) First installed the dependency packages autonomously, then installed weewx from the .DEB repository. I installed both, Sqlite3 and MySQL. 3) I would like to know how to reset the value of rain all day long, and how to change a single value. 4) Also the 'datetime' I see is UNIX time? Do you know of an online portal to calculate it?

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/EQ3Cuyxx7Mg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Massimiliano Neri

unread,
Apr 22, 2017, 7:09:40 AM4/22/17
to weewx-user

Hi thomas, 1) The time zone for this season is UTC + 02:00 2) First installed the dependency packages autonomously, then installed weewx from the .DEB repository. I installed both, Sqlite3 and MySQL. 3) I would like to know how to reset the value of rain all day long, and how to change a single value. 4) Also the 'datetime' I see is UNIX time? Do you know of an online portal to calculate it?

Il giorno venerdì 21 aprile 2017 21:00:32 UTC+2, Massimiliano Neri ha scritto:

Andrew Milner

unread,
Apr 22, 2017, 7:37:32 AM4/22/17
to weewx-user
Google for epoch converter - unix time is epoch time

The daily total is in the sum column of archive_day_rain table

Individual value per archive interval are in rain column of archive table

Values can be amended using phpmyadmin or phpliteadmin or using the appropriate sql statements through sql or SQLite as appropriate

Thomas Keffer

unread,
Apr 22, 2017, 8:27:01 AM4/22/17
to weewx-user
3. Follow the procedure given in the Wiki Cleaning up old 'bad' data. Be sure to work off a copy of your data!

To zero out all rain values for the day 21-04-2017 in your time zone, the SQL statement for SQLITE would be:

cd /var/lib/weewx
echo "UPDATE archive set rain = 0 WHERE dateTime > 1492725600 and dateTime <= 1492812000;" | sqlite3 /var/tmp/backup.sdb

If you wish to change only large values (how large?), say over .1, then use

echo "UPDATE archive set rain = 0 WHERE dateTime > 1492725600 and dateTime <= 1492812000 AND rain > 0.1;" | sqlite3 /var/tmp/backup.sdb

If you are using MySQL, the procedure is similar. If you can't figure it out, then you should stick with SQLITE, which is easier to administer. 


-tk



Massimiliano Neri

unread,
Apr 22, 2017, 2:12:58 PM4/22/17
to weewx-user
Try ... Thank you Thomas :-)

Il giorno venerdì 21 aprile 2017 21:00:32 UTC+2, Massimiliano Neri ha scritto:

Luc Heijst

unread,
Apr 22, 2017, 6:15:52 PM4/22/17
to weewx-user
Hi Massimiliano,
I noticed you are using Meteotemplate. Weewx and Meteotemplate both use their own databases. So when you correct the data in the weewx database it won't have effect on the Meteotemplate database. You will have to correct the data also for Meteotemplate.
Luc
Reply all
Reply to author
Forward
0 new messages