UPDATE weewx.archive SET windrun = (windSpeed * `interval` / 60.0) where windSpeed > 0;MariaDB [weewx]> SELECT * FROM `archive_day_windrun` ORDER BY `sum` DESC LIMIT 1;
+------------+------+------------+---------------+------------+------------------+-------+------------------+---------+
| dateTime | min | mintime | max | maxtime | sum | count | wsum | sumtime |
+------------+------+------------+---------------+------------+------------------+-------+------------------+---------+
| 1452038400 | 0 | 1452056460 | 32.6649722222 | 1452038460 | 9986.70872221597 | 1418 | 599202.523332966 | 85080 |
+------------+------+------------+---------------+------------+------------------+-------+------------------+---------+
1 row in set (0.00 sec)
MariaDB [weewx]> select avg(windSpeed) as avg_windspeed, (avg(windSpeed)*24) as thisDayWindRun from archive where dateTime >= 1452038400 and dateTime <= 1452142799;
+---------------------+-------------------+
| avg_windspeed | thisDayWindRun |
+---------------------+-------------------+
| 0.09232844574780066 | 2.215882697947216 |
+---------------------+-------------------+
1 row in set (0.00 sec)
MariaDB [weewx]> select sum(windspeed) from archive where dateTime >= 1452038400 and dateTime <= 1452142799;
+--------------------+
| sum(windspeed) |
+--------------------+
| 157.42000000000013 |
+--------------------+
1 row in set (0.00 sec)
MariaDB [weewx]> SELECT * FROM `archive_day_windSpeed` where dateTime = 1452038400;
+------------+------+------------+------+------------+--------+-------+--------+---------+
| dateTime | min | mintime | max | maxtime | sum | count | wsum | sumtime |
+------------+------+------------+------+------------+--------+-------+--------+---------+
| 1452038400 | 0 | 1452038460 | 3.5 | 1452098700 | 157.37 | 1419 | 9442.2 | 85140 |
+------------+------+------------+------+------------+--------+-------+--------+---------+
1 row in set (0.00 sec)
--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/275c4b9f-b0e6-411f-acab-f62dc1bbc057%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-de...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/21f464e6-2c18-41aa-b1be-c6b43e9f037f%40googlegroups.com.
UPDATE weewx.archive SET windrun = (windSpeed * `interval` / 60.0) where windSpeed > 0;
MariaDB [weewx]> SELECT * FROM `archive_day_windrun` ORDER BY `sum` DESC LIMIT 1; +------------+------+------------+---------------+------------+------------------+-------+------------------+---------+ | dateTime | min | mintime | max | maxtime | sum | count | wsum | sumtime | +------------+------+------------+---------------+------------+------------------+-------+------------------+---------+ | 1452038400 | 0 | 1452056460 | 32.6649722222 | 1452038460 | 9986.70872221597 | 1418 | 599202.523332966 | 85080 | +------------+------+------------+---------------+------------+------------------+-------+------------------+---------+ 1 row in set (0.00 sec)
If windrun is a scalar sum, then I'm pretty sure I just add all the windspeed together to get the daily windrun?
MariaDB [weewx]> SELECT * FROM `archive_day_windrun` WHERE year( FROM_UNIXTIME( dateTime ) ) = "2019" ORDER BY `archive_day_windrun`.`sum` DESC LIMIT 1;
+------------+--------------------+------------+------------------+------------+------------------+-------+------------------+---------+
| dateTime | min | mintime | max | maxtime | sum | count | wsum | sumtime |
+------------+--------------------+------------+------------------+------------+------------------+-------+------------------+---------+
| 1549688400 | 0.0211988304093567 | 1549774800 | 128.972153488369 | 1549774500 | 22617.0506134748 | 287 | 22617.0506134748 | 287 |
+------------+--------------------+------------+------------------+------------+------------------+-------+------------------+---------+
1 row in set (0.00 sec)MariaDB [weewx]> SELECT * FROM `archive_day_windrun` ORDER BY `archive_day_windrun`.`sum` DESC LIMIT 1;
+------------+------------------+------------+---------------+------------+------------------+-------+------------------+---------+
| dateTime | min | mintime | max | maxtime | sum | count | wsum | sumtime |
+------------+------------------+------------+---------------+------------+------------------+-------+------------------+---------+
| 1452488400 | 0.00133333333333 | 1452488460 | 59.8506111111 | 1452565800 | 42664.0181666637 | 1286 | 42664.0181666637 | 1286 |
+------------+------------------+------------+---------------+------------+------------------+-------+------------------+---------+
1 row in set (0.00 sec)MariaDB [weewx]> UPDATE weewx.archive SET windrun = (windSpeed * `interval` / 60.0) where windSpeed is not null;
Query OK, 347565 rows affected (2.81 sec)
Rows matched: 395690 Changed: 347565 Warnings: 0root@windrunfix:/etc/weewx# wee_database --drop
Using configuration file /etc/weewx/weewx.conf
Using database binding 'wx_binding', which is bound to database 'archive_mysql'
Proceeding will delete all your daily summaries from database 'weewx'
Are you sure you want to proceed (y/n)? y
Dropping daily summary tables from 'weewx' ...
Daily summary tables dropped from database 'weewx' in 1.30 secondsroot@windrunfix:/etc/weewx# wee_database --rebuild
Using configuration file /etc/weewx/weewx.conf
Using database binding 'wx_binding', which is bound to database 'archive_mysql'
All daily summaries will be rebuilt.
Proceed (y/n)? y
Rebuilding daily summaries in database 'weewx' ...
Records processed: 396000; Last date: 2019-10-15 17:15:00 UTC (1571159700)
Processed 396100 records to rebuild 1380 day summaries in 125.75 seconds
Rebuild of daily summaries in database 'weewx' completeMariaDB [weewx]> SELECT * FROM `archive_day_windrun` WHERE year( FROM_UNIXTIME( dateTime ) ) = "2019" ORDER BY `archive_day_windrun`.`sum` DESC LIMIT 1;
+------------+-------------------+------------+------------------+------------+------------------+-------+------------------+---------+
| dateTime | min | mintime | max | maxtime | sum | count | wsum | sumtime |
+------------+-------------------+------------+------------------+------------+------------------+-------+------------------+---------+
| 1549670400 | 0.116379310344827 | 1549750800 | 1.06481481481482 | 1549719600 | 152.540419966586 | 287 | 45762.1259899758 | 86100 |
+------------+-------------------+------------+------------------+------------+------------------+-------+------------------+---------+
1 row in set (0.00 sec)
MariaDB [weewx]> SELECT * FROM `archive_day_windrun` ORDER BY `archive_day_windrun`.`sum` DESC LIMIT 1;
+------------+--------------------+------------+------------------+------------+-----------------+-------+-----------------+---------+
| dateTime | min | mintime | max | maxtime | sum | count | wsum | sumtime |
+------------+--------------------+------------+------------------+------------+-----------------+-------+-----------------+---------+
| 1489190400 | 0.0899019607843134 | 1489276200 | 1.37694444444444 | 1489256100 | 164.76581710823 | 287 | 49429.745132469 | 86100 |
+------------+--------------------+------------+------------------+------------+-----------------+-------+-----------------+---------+
1 row in set (0.00 sec)
--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/4dba4643-631f-48d4-beaf-52fa6a51a33c%40googlegroups.com.