Re: [weewx-user] Re: Possible calculation error?

2017-01-13 Thread Andrew Milner
Tom
Mine seems to be correct - data from wh2800 via fineoffsetusb

Showing rows 0 - 19 (20 total, Query took 0.0017 seconds.) [dt: *1484258400 
- 1482616800*]

SELECT archive_day_windSpeed.dateTime as dt, 
date(archive_day_windSpeed.dateTime), archive_day_windSpeed.max, 
archive_day_windGust.max
FROM archive_day_windSpeed
INNER JOIN archive_day_windGust
ON archive_day_windSpeed.dateTime=archive_day_windGust.dateTime order by dt 
desc limit 20

*SELECT* 

 
archive_day_windSpeed.dateTime as dt, *date* 

(archive_day_windSpeed.dateTime), archive_day_windSpeed.max, 
archive_day_windGust.max FROM archive_day_windSpeed INNER JOIN 
archive_day_windGust ON archive_day_windSpeed.dateTime=archive_day_windGust
.dateTime order by dt desc limit 20 
Profiling [ *Inline*  ] [ *Edit* 

 
] [ *Explain SQL* 

 
] [ *Create PHP Code* 

 
] [ *Refresh* 

 
]



Partial texts
Full texts
Relational key
Relational display column
Show binary contents
Show BLOB contents
Show binary contents as HEX
Hide browser transformation
Geometry
Well Known Text
Well Known Binary

*dt [image: Descending] [image: Ascending] **1* 

 
*date(archive_day_windSpeed.dateTime)* 

 
*max* 

 
*max* 


Re: [weewx-user] Re: Possible calculation error?

2017-01-13 Thread Andrew Milner
Tom
Mine seems to be correct:


*+ Options* 
Partial texts
Full texts
Relational key
Relational display column
Show binary contents
Show BLOB contents
Show binary contents as HEX
Hide browser transformation
Geometry
Well Known Text
Well Known Binary
*dt [image: Descending] [image: Ascending] **1* 

 
*date(archive_day_windSpeed.dateTime)* 

 
*max* 

 
*max* 

 
1484258400 *NULL* 23.4000581604882  27.0001342166779
1484172000 *NULL* 29.5200733716927  33.1201646391249
1484085600 *NULL* 19.440048317944  24.480121689788
1483999200 *NULL* 58.6801458486088  68.4003400155841
1483912800 *NULL* 34.2000850037904  42.840212957129
1483826400 *NULL* 34.2000850037904  41.7602075884619
148374 *NULL* 41.7601037941019  51.4802559064659
1483653600 *NULL* 21.9600545813812  25.5601270584551
1483567200 *NULL* 31.6800787403532  37.8001879033491
1483480800 *NULL* 17.2800429492836  20.8801037942309
1483394400 *NULL* 27.671082556  33.1201646391249
1483308000 *NULL* 36.7200912672276  47.8802380109088
1483221600 *NULL* 17.2800429492836  20.8801037942309
1483135200 *NULL* 37.8000939515578  46.440230852686
1483048800 *NULL* 35.6400885828973  43.9202183257961
1482962400 *NULL* 51.4801279530739  70.920352542474
1482876000 *NULL* 36.7200912672276  42.840212957129
1482789600 *NULL* 41.7601037941019  60.1202988558028
1482703200 *NULL* 36.7200912672276  45.3602254840189
1482616800 *NULL* 18.3600456336138  20.8801037942309

hard to see the columns, but they are different.  I have a fineoffset, 
using fousb - but weewx seems to have handled things correctly.  I messed 
up getting the date correct in MySQL though from your sql statement!!!





On Friday, 13 January 2017 16:53:55 UTC+2, Tom Keffer wrote:

> Marked as issue #195 .
>
> -tk
>
> On Fri, Jan 13, 2017 at 6:49 AM, Thomas Keffer  > wrote:
>
>> "dwhile" I have been able to replicate the problem where 
>> archive_day_windSpeed.max is always equal to archive_day_windGust.max. Let 
>> me dig into it deeper.
>>
>> -tk
>>
>> On Fri, Jan 13, 2017 at 6:48 AM, dwhile839 via weewx-user <
>> weewx...@googlegroups.com > wrote:
>>
>>> Ok Added that code and turned debug on. Will monitor to see if it occurs.
>>>
>>> Interestingly the following appears:
>>>
>>> Jan 13 14:46:50 weather weewx[8513]: wmr100: Bad USB report received.
>>> Jan 13 14:46:50 weather weewx[8513]: * could not detach kernel 
>>> driver from interface 0: No data available
>>> Jan 13 14:46:55 weather weewx[8513]: wmr100: Bad USB report received.
>>> Jan 13 14:46:55 weather weewx[8513]: * tuple index out of range
>>> Jan 13 14:47:00 weather weewx[8513]: wmr100: Bad USB report received.
>>> Jan 13 14:47:00 weather weewx[8513]: * tuple index out of range
>>> Jan 13 14:47:05 weather weewx[8513]: wmr100: Bad checksum on buffer of 
>>> length 26
>>> Jan 13 14:47:05 weather weewx[8513]: wmr100: Bad checksum on buffer of 
>>> length 7
>>>
>>> Although everything seems to work OK. Note that the hardware is actually 
>>> a WMR180 not a 100.
>>>
>>> -- 
>>> You received this message because you are subscribe

[weewx-user] Re: Possible calculation error?

2017-01-13 Thread dwhile839 via weewx-user
Ok Added that code and turned debug on. Will monitor to see if it occurs.

Interestingly the following appears:

Jan 13 14:46:50 weather weewx[8513]: wmr100: Bad USB report received.
Jan 13 14:46:50 weather weewx[8513]: * could not detach kernel driver 
from interface 0: No data available
Jan 13 14:46:55 weather weewx[8513]: wmr100: Bad USB report received.
Jan 13 14:46:55 weather weewx[8513]: * tuple index out of range
Jan 13 14:47:00 weather weewx[8513]: wmr100: Bad USB report received.
Jan 13 14:47:00 weather weewx[8513]: * tuple index out of range
Jan 13 14:47:05 weather weewx[8513]: wmr100: Bad checksum on buffer of 
length 26
Jan 13 14:47:05 weather weewx[8513]: wmr100: Bad checksum on buffer of 
length 7

Although everything seems to work OK. Note that the hardware is actually a 
WMR180 not a 100.

-- 
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] Re: Possible calculation error?

2017-01-13 Thread Thomas Keffer
Marked as issue #195 .

-tk

On Fri, Jan 13, 2017 at 6:49 AM, Thomas Keffer  wrote:

> "dwhile" I have been able to replicate the problem where
> archive_day_windSpeed.max is always equal to archive_day_windGust.max. Let
> me dig into it deeper.
>
> -tk
>
> On Fri, Jan 13, 2017 at 6:48 AM, dwhile839 via weewx-user <
> weewx-user@googlegroups.com> wrote:
>
>> Ok Added that code and turned debug on. Will monitor to see if it occurs.
>>
>> Interestingly the following appears:
>>
>> Jan 13 14:46:50 weather weewx[8513]: wmr100: Bad USB report received.
>> Jan 13 14:46:50 weather weewx[8513]: * could not detach kernel driver
>> from interface 0: No data available
>> Jan 13 14:46:55 weather weewx[8513]: wmr100: Bad USB report received.
>> Jan 13 14:46:55 weather weewx[8513]: * tuple index out of range
>> Jan 13 14:47:00 weather weewx[8513]: wmr100: Bad USB report received.
>> Jan 13 14:47:00 weather weewx[8513]: * tuple index out of range
>> Jan 13 14:47:05 weather weewx[8513]: wmr100: Bad checksum on buffer of
>> length 26
>> Jan 13 14:47:05 weather weewx[8513]: wmr100: Bad checksum on buffer of
>> length 7
>>
>> Although everything seems to work OK. Note that the hardware is actually
>> a WMR180 not a 100.
>>
>> --
>> 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.


Re: [weewx-user] Re: Possible calculation error?

2017-01-13 Thread Thomas Keffer
"dwhile" I have been able to replicate the problem where
archive_day_windSpeed.max is always equal to archive_day_windGust.max. Let
me dig into it deeper.

-tk

On Fri, Jan 13, 2017 at 6:48 AM, dwhile839 via weewx-user <
weewx-user@googlegroups.com> wrote:

> Ok Added that code and turned debug on. Will monitor to see if it occurs.
>
> Interestingly the following appears:
>
> Jan 13 14:46:50 weather weewx[8513]: wmr100: Bad USB report received.
> Jan 13 14:46:50 weather weewx[8513]: * could not detach kernel driver
> from interface 0: No data available
> Jan 13 14:46:55 weather weewx[8513]: wmr100: Bad USB report received.
> Jan 13 14:46:55 weather weewx[8513]: * tuple index out of range
> Jan 13 14:47:00 weather weewx[8513]: wmr100: Bad USB report received.
> Jan 13 14:47:00 weather weewx[8513]: * tuple index out of range
> Jan 13 14:47:05 weather weewx[8513]: wmr100: Bad checksum on buffer of
> length 26
> Jan 13 14:47:05 weather weewx[8513]: wmr100: Bad checksum on buffer of
> length 7
>
> Although everything seems to work OK. Note that the hardware is actually a
> WMR180 not a 100.
>
> --
> 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] Re: Possible calculation error?

2017-01-13 Thread Andrew Milner
well my windspeed max and windgust max are different.



On Friday, 13 January 2017 16:26:27 UTC+2, gjr80 wrote:

> Doubt it is a station issue, I have a VP2 and get the same results. I 
> think this is more likely and issue of how the accumualtors work and 
> process the various wind obs.
>
> On Saturday, 14 January 2017 00:21:09 UTC+10, Andrew Milner wrote:
>>
>> That is correct - we are in agreement.  They are different in the 
>> archive, but are both the same value and time in the archive_day tables.  
>> Looks to me as though either the station or the driver could be the source 
>> of the problem and running with debug set may shed some more light.
>>
>>
>> On Friday, 13 January 2017 16:17:12 UTC+2, gjr80 wrote:
>>
>>> No problems Andrew.
>>>
>>> As I see it the issue is (put succinctly):
>>>
>>> why does $day.windSpeed.max == $day.windGust.max ?
>>>
>>> I do not believe they should.
>>>
>>> Gary
>>>
>>

-- 
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] Re: Possible calculation error?

2017-01-13 Thread mwall
the wmr100 and wmr200 drivers have abit of code to check gust speed.  if 
the hardware reports a gust speed greater than the wind speed, the driver 
sets gust speed to None.

perhaps that affects how the accumulators do their calculations?

@dwhile839, could you add some debug logging?

change this:

if _record['wind_gust'] < _record['wind_speed']:
_record['wind_gust'] = None

to this:

if _record['wind_gust'] < _record['wind_speed']:
logdbg("clearing gust speed: gust=%s speed=%s" % 
(_record['wind_gust'], _record['wind_speed']))
_record['wind_gust'] = None

then restart weewx with debug=1

m

-- 
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] Re: Possible calculation error?

2017-01-13 Thread dwhile839 via weewx-user
I have been monitoring the loop packets and the data appears to be correct. 
It is providing windGust and windSpeed and these are being correctly 
reported for the archive interval.

I believe Gary has the same results with a different station type so it is 
unlikely to be a station problem.

-- 
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] Re: Possible calculation error?

2017-01-13 Thread gjr80
Doubt it is a station issue, I have a VP2 and get the same results. I think 
this is more likely and issue of how the accumualtors work and process the 
various wind obs.

On Saturday, 14 January 2017 00:21:09 UTC+10, Andrew Milner wrote:
>
> That is correct - we are in agreement.  They are different in the archive, 
> but are both the same value and time in the archive_day tables.  Looks to 
> me as though either the station or the driver could be the source of the 
> problem and running with debug set may shed some more light.
>
>
> On Friday, 13 January 2017 16:17:12 UTC+2, gjr80 wrote:
>
>> No problems Andrew.
>>
>> As I see it the issue is (put succinctly):
>>
>> why does $day.windSpeed.max == $day.windGust.max ?
>>
>> I do not believe they should.
>>
>> Gary
>>
>

-- 
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] Re: Possible calculation error?

2017-01-13 Thread Andrew Milner
That is correct - we are in agreement.  They are different in the archive, 
but are both the same value and time in the archive_day tables.  Looks to 
me as though either the station or the driver could be the source of the 
problem and running with debug set may shed some more light.


On Friday, 13 January 2017 16:17:12 UTC+2, gjr80 wrote:

> No problems Andrew.
>
> As I see it the issue is (put succinctly):
>
> why does $day.windSpeed.max == $day.windGust.max ?
>
> I do not believe they should.
>
> Gary
>

-- 
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] Re: Possible calculation error?

2017-01-13 Thread Andrew Milner
Gary - my humble apologies indeed

I just saw that there was another page to archive on my phpmyadmin screen - 
which had two more tables - archive_day_windSpeed and 
archive_day__metadata!!!
had never noticed the additional page prompt before!!!

I really am grovelling now and apologising most profusely

substitute archive_day_windSpeed wherever I said archive_day_wind before, 
because I never meant archive_day_wind.





On Friday, 13 January 2017 16:00:06 UTC+2, Andrew Milner wrote:

> Gary - the daily table for windSpeed is called archive_day_wind not 
> archive_day_windSpeed
>
>
>
> On Friday, 13 January 2017 15:52:55 UTC+2, gjr80 wrote:
>
>> Andrew,
>>
>> The issue here is windSpeed and windGust being identical. 
>> $day.windSpeed.max and $day.windGust.max come from archive_day_windSpeed 
>> and archive_day_windGust respectively, archive_day_wind shoudl have nothing 
>> to do with either. At a guess I would say that somehow windGust is 
>> polluting archive_day_windSpeed. How that is happening is the question. The 
>> handling of wind by weewx is complex. I have just spent the last hour 
>> trying to get my head around it and I am still not there. Something I will 
>> ask Tom about.
>>
>> Gary
>>
>> On Friday, 13 January 2017 23:38:12 UTC+10, Andrew Milner wrote:
>>>
>>> Gary - as far as I can see from the results from the queries I asked for 
>>> the issue seems to be resolving why day_archive_wind has the same value AND 
>>> time as day_archive_windGust when in the archive the max for windSpeed and 
>>> windGust are different values.
>>>
>>>
>>> On Friday, 13 January 2017 15:30:36 UTC+2, gjr80 wrote:
>>>
 The SteelSeries Gauges template fields are correct (well the 10 min 
 average actually uses a 1 hour average but that is either here nor there). 

 The fact the maximum windSpeed recorded in the archive is lower than 
 the what you get with $day.windSpeed.max is not surprising. The windSpeed 
 values in your archive are the average of the loop windSpeed values seen 
 over that archive period. So if over the first 5 minute archive period of 
 the day your station saw (loop) windSpeed values of 6,8,8,10,12 the value 
 8.8 (44/5) would be recorded in the archive as windSpeed for that archive 
 period. The daily summaries keep track of the Highs and Lows. So the 
 windSpeed daily summary would record 12 as the max. As subsequent archive 
 periods roll over and loop packets come in additional records are added to 
 the archive (ie windSpeed will contain the average of the loop windSpeed 
 values over the archive period) and the Highs and Lows in the daily 
 summaries will be updated *if a new* High or Low was seen during that 
 archive period. So it is quite possible that the maximum windSpeed value 
 seen in all of the day's archive records is lower than that returned by 
 $day.windSpeed.max ($day.windSpeed.max pulls the max windSpeed value from 
 the daily summaries). In fact for windSpeed i woudl almost guarantee that 
 the max value in the archive will be less than $day.windSpeed.max. The 
 exception is when the daily summaries are rebuilt all of the accumulated 
 detail of highs and lows and their times are lost (ie the detail of the 
 loop data is lost) and the daily summaries are rebuilt frome the (largely) 
 'averaged' archive data.

 The real tell will be a query of both the windSpeed and windGust daily 
 summaries. If you do:

 SELECT * FROM archive_day_windSpeed ORDER BY dateTime DESC LIMIT 1;

 and then 

 SELECT * FROM archive_day_windGust ORDER BY dateTime DESC LIMIT 1;

 I'll bet the values in both of the max columns are the same (the 
 maxtimes will likely be different). That is not right and that is why 
 $day.windSpeed.max and $day.windGust.max are returning the same values. 
 (coincidentally, I get the exact same results on my system with a 
 different 
 station so it is not an issue with the station). How weewx handles wind 
 obs 
 is complex, and whilst the issue has been identified I think a bit more 
 analysis will be required to work any possible fix.

 Gary

>>>

-- 
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] Re: Possible calculation error?

2017-01-13 Thread gjr80
No problems Andrew.

As I see it the issue is (put succinctly):

why does $day.windSpeed.max == $day.windGust.max ?

I do not believe they should.

Gary

-- 
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] Re: Possible calculation error?

2017-01-13 Thread gjr80


On Saturday, 14 January 2017 00:00:06 UTC+10, Andrew Milner wrote:
>
> Gary - the daily table for windSpeed is called archive_day_wind not 
> archive_day_windSpeed
>

Um, actually it is called archive_day_windSpeed. archive_day_wind is the 
daily sumamry for the vector wind.

mysql> SELECT * FROM archive_day_windSpeed ORDER BY dateTime DESC LIMIT 1;
++--++--++--+---+--+-+
| dateTime   | min  | mintime| max  | maxtime| sum 
 | count | wsum | sumtime |
++--++--++--+---+--+-+
| 1484229600 |0 | 1484229602 | 20.9215240001292 | 1484274119 | 
975.264888006056 |   288 | 975.264888006056 | 288 |
++--++--++--+---+--+-+
1 row in set (0.00 sec)

mysql> SELECT * FROM archive_day_windGust ORDER BY dateTime DESC LIMIT 1;
++--++--++--+---+--+-+
| dateTime   | min  | mintime| max  | maxtime| sum 
 | count | wsum | sumtime |
++--++--++--+---+--+-+
| 1484229600 |0 | 1484229604 | 20.9215240001292 | 1484274301 | 
2335.16394801449 |   288 | 2335.16394801449 | 288 |
++--++--++--+---+--+-+
1 row in set (0.01 sec)

mysql> show tables;
+--+
| Tables_in_weewx  |
+--+
| archive  |
| archive_day_ET   |
| archive_day_UV   |
| archive_day__metadata|
| archive_day_altimeter|
| archive_day_barometer|
| archive_day_consBatteryVoltage   |
| archive_day_dewpoint |
| archive_day_extraHumid1  |
| archive_day_extraHumid2  |
| archive_day_extraTemp1   |
| archive_day_extraTemp2   |
| archive_day_extraTemp3   |
| archive_day_hail |
| archive_day_hailRate |
| archive_day_heatindex|
| archive_day_heatingTemp  |
| archive_day_heatingVoltage   |
| archive_day_inHumidity   |
| archive_day_inTemp   |
| archive_day_inTempBatteryStatus  |
| archive_day_leafTemp1|
| archive_day_leafTemp2|
| archive_day_leafWet1 |
| archive_day_leafWet2 |
| archive_day_outHumidity  |
| archive_day_outTemp  |
| archive_day_outTempBatteryStatus |
| archive_day_pressure |
| archive_day_radiation|
| archive_day_rain |
| archive_day_rainBatteryStatus|
| archive_day_rainRate |
| archive_day_referenceVoltage |
| archive_day_rxCheckPercent   |
| archive_day_soilMoist1   |
| archive_day_soilMoist2   |
| archive_day_soilMoist3   |
| archive_day_soilMoist4   |
| archive_day_soilTemp1|
| archive_day_soilTemp2|
| archive_day_soilTemp3|
| archive_day_soilTemp4|
| archive_day_supplyVoltage|
| archive_day_txBatteryStatus  |
| archive_day_wind |
| archive_day_windBatteryStatus|
| archive_day_windDir  |
| archive_day_windGust |
| archive_day_windGustDir  |
| archive_day_windSpeed|
| archive_day_windchill|
+--+
52 rows in set (0.00 sec)

mysql>



-- 
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] Re: Possible calculation error?

2017-01-13 Thread Andrew Milner
Gary - the daily table for windSpeed is called archive_day_wind not 
archive_day_windSpeed



On Friday, 13 January 2017 15:52:55 UTC+2, gjr80 wrote:

> Andrew,
>
> The issue here is windSpeed and windGust being identical. 
> $day.windSpeed.max and $day.windGust.max come from archive_day_windSpeed 
> and archive_day_windGust respectively, archive_day_wind shoudl have nothing 
> to do with either. At a guess I would say that somehow windGust is 
> polluting archive_day_windSpeed. How that is happening is the question. The 
> handling of wind by weewx is complex. I have just spent the last hour 
> trying to get my head around it and I am still not there. Something I will 
> ask Tom about.
>
> Gary
>
> On Friday, 13 January 2017 23:38:12 UTC+10, Andrew Milner wrote:
>>
>> Gary - as far as I can see from the results from the queries I asked for 
>> the issue seems to be resolving why day_archive_wind has the same value AND 
>> time as day_archive_windGust when in the archive the max for windSpeed and 
>> windGust are different values.
>>
>>
>> On Friday, 13 January 2017 15:30:36 UTC+2, gjr80 wrote:
>>
>>> The SteelSeries Gauges template fields are correct (well the 10 min 
>>> average actually uses a 1 hour average but that is either here nor there). 
>>>
>>> The fact the maximum windSpeed recorded in the archive is lower than the 
>>> what you get with $day.windSpeed.max is not surprising. The windSpeed 
>>> values in your archive are the average of the loop windSpeed values seen 
>>> over that archive period. So if over the first 5 minute archive period of 
>>> the day your station saw (loop) windSpeed values of 6,8,8,10,12 the value 
>>> 8.8 (44/5) would be recorded in the archive as windSpeed for that archive 
>>> period. The daily summaries keep track of the Highs and Lows. So the 
>>> windSpeed daily summary would record 12 as the max. As subsequent archive 
>>> periods roll over and loop packets come in additional records are added to 
>>> the archive (ie windSpeed will contain the average of the loop windSpeed 
>>> values over the archive period) and the Highs and Lows in the daily 
>>> summaries will be updated *if a new* High or Low was seen during that 
>>> archive period. So it is quite possible that the maximum windSpeed value 
>>> seen in all of the day's archive records is lower than that returned by 
>>> $day.windSpeed.max ($day.windSpeed.max pulls the max windSpeed value from 
>>> the daily summaries). In fact for windSpeed i woudl almost guarantee that 
>>> the max value in the archive will be less than $day.windSpeed.max. The 
>>> exception is when the daily summaries are rebuilt all of the accumulated 
>>> detail of highs and lows and their times are lost (ie the detail of the 
>>> loop data is lost) and the daily summaries are rebuilt frome the (largely) 
>>> 'averaged' archive data.
>>>
>>> The real tell will be a query of both the windSpeed and windGust daily 
>>> summaries. If you do:
>>>
>>> SELECT * FROM archive_day_windSpeed ORDER BY dateTime DESC LIMIT 1;
>>>
>>> and then 
>>>
>>> SELECT * FROM archive_day_windGust ORDER BY dateTime DESC LIMIT 1;
>>>
>>> I'll bet the values in both of the max columns are the same (the 
>>> maxtimes will likely be different). That is not right and that is why 
>>> $day.windSpeed.max and $day.windGust.max are returning the same values. 
>>> (coincidentally, I get the exact same results on my system with a different 
>>> station so it is not an issue with the station). How weewx handles wind obs 
>>> is complex, and whilst the issue has been identified I think a bit more 
>>> analysis will be required to work any possible fix.
>>>
>>> Gary
>>>
>>

-- 
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] Re: Possible calculation error?

2017-01-13 Thread dwhile839 via weewx-user
The first - I think Andrew has succinctly stated the problem above:

"Gary - as far as I can see from the results from the queries I asked for 
the issue seems to be resolving why day_archive_wind has the same value AND 
time as day_archive_windGust when in the archive the max for windSpeed and 
windGust are different values."

I believe there is a calculation/programming error somewhere. 

-- 
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] Re: Possible calculation error?

2017-01-13 Thread Andrew Milner
When you say setting loop_hilo has had no effect - what happened?

You need to restart weewx after changing weewx.conf, and it will only 
affect new values processed after the change, and would only be seen if you 
have a higher average wind in an archive period than the already recorded 
high or did you delete or zeroise todays data already in the daily tables 
to make the new values become visible?


On Friday, 13 January 2017 15:43:44 UTC+2, dwhi...@googlemail.com wrote:

> Just to confirm setting loop_hilo to false has had no effect.
>
> If you want me to try anything please let me know - I was until recently 
> an Associate Professor in Computer Science so programming isn't a problem 
> for me!!
>

-- 
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] Re: Possible calculation error?

2017-01-13 Thread gjr80
Andrew,

The issue here is windSpeed and windGust being identical. 
$day.windSpeed.max and $day.windGust.max come from archive_day_windSpeed 
and archive_day_windGust respectively, archive_day_wind shoudl have nothing 
to do with either. At a guess I would say that somehow windGust is 
polluting archive_day_windSpeed. How that is happening is the question. The 
handling of wind by weewx is complex. I have just spent the last hour 
trying to get my head around it and I am still not there. Something I will 
ask Tom about.

Gary

On Friday, 13 January 2017 23:38:12 UTC+10, Andrew Milner wrote:
>
> Gary - as far as I can see from the results from the queries I asked for 
> the issue seems to be resolving why day_archive_wind has the same value AND 
> time as day_archive_windGust when in the archive the max for windSpeed and 
> windGust are different values.
>
>
> On Friday, 13 January 2017 15:30:36 UTC+2, gjr80 wrote:
>
>> The SteelSeries Gauges template fields are correct (well the 10 min 
>> average actually uses a 1 hour average but that is either here nor there). 
>>
>> The fact the maximum windSpeed recorded in the archive is lower than the 
>> what you get with $day.windSpeed.max is not surprising. The windSpeed 
>> values in your archive are the average of the loop windSpeed values seen 
>> over that archive period. So if over the first 5 minute archive period of 
>> the day your station saw (loop) windSpeed values of 6,8,8,10,12 the value 
>> 8.8 (44/5) would be recorded in the archive as windSpeed for that archive 
>> period. The daily summaries keep track of the Highs and Lows. So the 
>> windSpeed daily summary would record 12 as the max. As subsequent archive 
>> periods roll over and loop packets come in additional records are added to 
>> the archive (ie windSpeed will contain the average of the loop windSpeed 
>> values over the archive period) and the Highs and Lows in the daily 
>> summaries will be updated *if a new* High or Low was seen during that 
>> archive period. So it is quite possible that the maximum windSpeed value 
>> seen in all of the day's archive records is lower than that returned by 
>> $day.windSpeed.max ($day.windSpeed.max pulls the max windSpeed value from 
>> the daily summaries). In fact for windSpeed i woudl almost guarantee that 
>> the max value in the archive will be less than $day.windSpeed.max. The 
>> exception is when the daily summaries are rebuilt all of the accumulated 
>> detail of highs and lows and their times are lost (ie the detail of the 
>> loop data is lost) and the daily summaries are rebuilt frome the (largely) 
>> 'averaged' archive data.
>>
>> The real tell will be a query of both the windSpeed and windGust daily 
>> summaries. If you do:
>>
>> SELECT * FROM archive_day_windSpeed ORDER BY dateTime DESC LIMIT 1;
>>
>> and then 
>>
>> SELECT * FROM archive_day_windGust ORDER BY dateTime DESC LIMIT 1;
>>
>> I'll bet the values in both of the max columns are the same (the maxtimes 
>> will likely be different). That is not right and that is why 
>> $day.windSpeed.max and $day.windGust.max are returning the same values. 
>> (coincidentally, I get the exact same results on my system with a different 
>> station so it is not an issue with the station). How weewx handles wind obs 
>> is complex, and whilst the issue has been identified I think a bit more 
>> analysis will be required to work any possible fix.
>>
>> Gary
>>
>

-- 
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] Re: Possible calculation error?

2017-01-13 Thread Thomas Keffer
The documentation for $day.windSpeed.max is wrong. It should read:

The max average wind speed. The wind is averaged over each of
the archive intervals. Then the maximum of these values is taken.

It has been changed in commit 35ad31

.

"dwhile", I am no longer sure what problem we are chasing. Is it:

   - You think there is a problem in the aggregation calculations in weewx;
   or
   - You're having troubles coming up with the right template to display
   those calculations.

I get the feeling you feel it's the first. If so, could you distill down
what you think the error is, without using your templates? It's very hard
to see through the thicket of your templates, with all its novel naming
conventions, and see what you're doing.

-tk


On Fri, Jan 13, 2017 at 5:43 AM, dwhile839 via weewx-user <
weewx-user@googlegroups.com> wrote:

> Just to confirm setting loop_hilo to false has had no effect.
>
> If you want me to try anything please let me know - I was until recently
> an Associate Professor in Computer Science so programming isn't a problem
> for me!!
>
> --
> 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] Re: Possible calculation error?

2017-01-13 Thread dwhile839 via weewx-user
Just to confirm setting loop_hilo to false has had no effect.

If you want me to try anything please let me know - I was until recently an 
Associate Professor in Computer Science so programming isn't a problem for 
me!!

-- 
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] Re: Possible calculation error?

2017-01-13 Thread Andrew Milner
Gary - as far as I can see from the results from the queries I asked for 
the issue seems to be resolving why day_archive_wind has the same value AND 
time as day_archive_windGust when in the archive the max for windSpeed and 
windGust are different values.


On Friday, 13 January 2017 15:30:36 UTC+2, gjr80 wrote:

> The SteelSeries Gauges template fields are correct (well the 10 min 
> average actually uses a 1 hour average but that is either here nor there). 
>
> The fact the maximum windSpeed recorded in the archive is lower than the 
> what you get with $day.windSpeed.max is not surprising. The windSpeed 
> values in your archive are the average of the loop windSpeed values seen 
> over that archive period. So if over the first 5 minute archive period of 
> the day your station saw (loop) windSpeed values of 6,8,8,10,12 the value 
> 8.8 (44/5) would be recorded in the archive as windSpeed for that archive 
> period. The daily summaries keep track of the Highs and Lows. So the 
> windSpeed daily summary would record 12 as the max. As subsequent archive 
> periods roll over and loop packets come in additional records are added to 
> the archive (ie windSpeed will contain the average of the loop windSpeed 
> values over the archive period) and the Highs and Lows in the daily 
> summaries will be updated *if a new* High or Low was seen during that 
> archive period. So it is quite possible that the maximum windSpeed value 
> seen in all of the day's archive records is lower than that returned by 
> $day.windSpeed.max ($day.windSpeed.max pulls the max windSpeed value from 
> the daily summaries). In fact for windSpeed i woudl almost guarantee that 
> the max value in the archive will be less than $day.windSpeed.max. The 
> exception is when the daily summaries are rebuilt all of the accumulated 
> detail of highs and lows and their times are lost (ie the detail of the 
> loop data is lost) and the daily summaries are rebuilt frome the (largely) 
> 'averaged' archive data.
>
> The real tell will be a query of both the windSpeed and windGust daily 
> summaries. If you do:
>
> SELECT * FROM archive_day_windSpeed ORDER BY dateTime DESC LIMIT 1;
>
> and then 
>
> SELECT * FROM archive_day_windGust ORDER BY dateTime DESC LIMIT 1;
>
> I'll bet the values in both of the max columns are the same (the maxtimes 
> will likely be different). That is not right and that is why 
> $day.windSpeed.max and $day.windGust.max are returning the same values. 
> (coincidentally, I get the exact same results on my system with a different 
> station so it is not an issue with the station). How weewx handles wind obs 
> is complex, and whilst the issue has been identified I think a bit more 
> analysis will be required to work any possible fix.
>
> Gary
>

-- 
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] Re: Possible calculation error?

2017-01-13 Thread dwhile839 via weewx-user
Hi you are correct both return the same value and the same dateTime stamp.

-- 
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] Re: Possible calculation error?

2017-01-13 Thread gjr80
The SteelSeries Gauges template fields are correct (well the 10 min average 
actually uses a 1 hour average but that is either here nor there). 

The fact the maximum windSpeed recorded in the archive is lower than the 
what you get with $day.windSpeed.max is not surprising. The windSpeed 
values in your archive are the average of the loop windSpeed values seen 
over that archive period. So if over the first 5 minute archive period of 
the day your station saw (loop) windSpeed values of 6,8,8,10,12 the value 
8.8 (44/5) would be recorded in the archive as windSpeed for that archive 
period. The daily summaries keep track of the Highs and Lows. So the 
windSpeed daily summary would record 12 as the max. As subsequent archive 
periods roll over and loop packets come in additional records are added to 
the archive (ie windSpeed will contain the average of the loop windSpeed 
values over the archive period) and the Highs and Lows in the daily 
summaries will be updated *if a new* High or Low was seen during that 
archive period. So it is quite possible that the maximum windSpeed value 
seen in all of the day's archive records is lower than that returned by 
$day.windSpeed.max ($day.windSpeed.max pulls the max windSpeed value from 
the daily summaries). In fact for windSpeed i woudl almost guarantee that 
the max value in the archive will be less than $day.windSpeed.max. The 
exception is when the daily summaries are rebuilt all of the accumulated 
detail of highs and lows and their times are lost (ie the detail of the 
loop data is lost) and the daily summaries are rebuilt frome the (largely) 
'averaged' archive data.

The real tell will be a query of both the windSpeed and windGust daily 
summaries. If you do:

SELECT * FROM archive_day_windSpeed ORDER BY dateTime DESC LIMIT 1;

and then 

SELECT * FROM archive_day_windGust ORDER BY dateTime DESC LIMIT 1;

I'll bet the values in both of the max columns are the same (the maxtimes 
will likely be different). That is not right and that is why 
$day.windSpeed.max and $day.windGust.max are returning the same values. 
(coincidentally, I get the exact same results on my system with a different 
station so it is not an issue with the station). How weewx handles wind obs 
is complex, and whilst the issue has been identified I think a bit more 
analysis will be required to work any possible fix.

Gary

-- 
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] Re: Possible calculation error?

2017-01-13 Thread Andrew Milner
If you set loop_hilo in std archive section of weewx.conf then only the 
archive data will be used for the daily high/low figures.  If loop_hilo is 
set true then both loop and archive data can affect the stats.  It looks as 
though you have it set to true, and the loop data from a gust is managing 
to set the windspeed.  I do not know what kind of station you have got and 
how it is supplying the wind data - maybe you need to run with debug=1 set 
and monitor your wind speed and wind gust readings as supplied by the 
station.



On Friday, 13 January 2017 14:51:38 UTC+2, dwhi...@googlemail.com wrote:

> select max(windSpeed) from archive where dataTime > x; (for 
> today)13.8690394820237
>
> select max(windGust) from archive where dateTime > xx;(for 
> today)   15.4348987783812
>
> select max, maxtime from archive_day_wind where dateTime = xx;
>  (for today)  15.4348987783812 | 1484308500
>
> select max, maxtime from archive_day_windGust where dateTime = 
> x; (for today)  15.4348987783812 | 1484308500
>
> a) miles_per_hour is %.0f
>
> b) I looked in both tables
>
> c) archive interval is 5 minutes
>

-- 
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] Re: Possible calculation error?

2017-01-13 Thread dwhile839 via weewx-user
select max(windSpeed) from archive where dataTime > x; (for 
today)13.8690394820237

select max(windGust) from archive where dateTime > xx;(for 
today)   15.4348987783812

select max, maxtime from archive_day_wind where dateTime = xx;
 (for today)  15.4348987783812 | 1484308500

select max, maxtime from archive_day_windGust where dateTime = 
x; (for today)  15.4348987783812 | 1484308500

a) miles_per_hour is %.0f

b) I looked in both tables

c) archive interval is 5 minutes

-- 
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] Re: Possible calculation error?

2017-01-13 Thread Andrew Milner
a) What formatting is specified in skin.conf - for use by .formatted? 

b) when you say "as recorded in the database" - are you referring to the 
archive table or the archive_day_windspeed table?

c) what is your archive interval?

d) what is the result of the following sql commands:
select max(windSpeed) from archive where dataTime > x; (for 
today)
and
select max(windGust) from archive where dateTime > xx;(for 
today)
and
select max, maxtime from archive_day_wind where dateTime = xx;
 (for today)
and
select max, maxtime from archive_day_windGust where dateTime = 
x; (for today)


On Friday, 13 January 2017 13:25:44 UTC+2, dwhi...@googlemail.com wrote:

> Ok Assuming that weewx does rounding in the normal way (anything below .5 
> rounded down and .5 and above rounded up) then there is definitely a 
> calculation error. 
>
> I have looked at the source data in the database and for today the maximum 
> wind speed recorded (up to now) is 13.421656358 (as recorded in the 
> database). This is correctly shown in the text above the graph as a maximum 
> gust of 13mph. The maximum average speed over an interval for today 
> is 12.3031801856662 which when rounded should be 12mph but is showing 
> (using $day.windSpeed.max) as 13mph.
>

-- 
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] Re: Possible calculation error?

2017-01-13 Thread dwhile839 via weewx-user
Ok Assuming that weewx does rounding in the normal way (anything below .5 
rounded down and .5 and above rounded up) then there is definitely a 
calculation error. 

I have looked at the source data in the database and for today the maximum 
wind speed recorded (up to now) is 13.421656358 (as recorded in the 
database). This is correctly shown in the text above the graph as a maximum 
gust of 13mph. The maximum average speed over an interval for today 
is 12.3031801856662 which when rounded should be 12mph but is showing 
(using $day.windSpeed.max) as 13mph.

-- 
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] Re: Possible calculation error?

2017-01-13 Thread dwhile839 via weewx-user
Here is the relevant bit from the template (the template is large!)

"wlatest":"$current.windSpeed.formatted",
   "lastestmax": "$current.windSpeed.max.formatted",
"wspeed":"$hour.windSpeed.avg.formatted",
  "test":"$hour.windSpeed.max.formatted",
"dayavg": "$day.windSpeed.avg.formatted",
"windTM":"$day.windSpeed.max.formatted",
 "wgust":"$current.windGust.formatted",
   "wgustTM":"$day.windGust.max.formatted",
  "TwgustTM":"$day.windGust.maxtime",

I have added a few others in to do some testing e.g. test, latestmax, dayavg

-- 
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] Re: Possible calculation error?

2017-01-13 Thread gjr80
If you are referring to this text:

"The max average wind speed. The wind is averaged over each of the archive 
intervals. Then these numbers are averaged. Note that this is *not* the 
same as the maximum observed wind speed."

in the table under wind  in the 
Customization Guide, then yes you are correct, it is not the average of an 
average it is the max of the average. The error is in the description not 
in the calculation.

Clearly from your wind graph windSpeed and windGust are different.So until 
we see the template I suspect the issue will remain.

Gary

On Friday, 13 January 2017 19:49:35 UTC+10, dwhi...@googlemail.com wrote:
>
> I wouldn't expect the lines to be the same as that is not the problem. The 
> gust figure will normally be higher than the average.
>
> The problem lies with $day.windSpeed.max - this is a single figure so not 
> plotted on the graph. The docs say that this is calculated by averaging the 
> windspeed over the interval and then averaging all the intervals. This is 
> wrong. It should be averaging over the interval and then selecting the 
> highest figure (hence max). 
>
> I don't know whether the error is in the documentation or in the coding 
> but the value produced is wrong. It appears that the value produced is 
> always the same as the maximum gust speed ($day.windGust.max)
>
>
>

-- 
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] Re: Possible calculation error?

2017-01-13 Thread dwhile839 via weewx-user
I wouldn't expect the lines to be the same as that is not the problem. The 
gust figure will normally be higher than the average.

The problem lies with $day.windSpeed.max - this is a single figure so not 
plotted on the graph. The docs say that this is calculated by averaging the 
windspeed over the interval and then averaging all the intervals. This is 
wrong. It should be averaging over the interval and then selecting the 
highest figure (hence max). 

I don't know whether the error is in the documentation or in the coding but 
the value produced is wrong. It appears that the value produced is always 
the same as the maximum gust speed ($day.windGust.max)


-- 
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] Re: Possible calculation error?

2017-01-12 Thread dwhile839 via weewx-user
Actually having thought about it a bit more surely $day.windSpeed.max 
should average over the interval and then return the highest value of those 
averaged intervals? This is not what the documentation says it does - it 
says it averages over the interval and then averages those values.

What $day.windSpeed.max should return is the maximum value of the average 
wind speeds recorded not the average of the averages which surely would be 
$day.windSpeed.avg i.e. the average windSpeed for the day.

-- 
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] Re: Possible calculation error?

2017-01-12 Thread mwall
On Thursday, January 12, 2017 at 5:30:50 AM UTC-5, dwhile839 wrote:
>
> I am using weewx version 3.6.2 with an Oregon WMR180 weather station.
>
> Looking at the wind data it appears that the maximum gust and the maximum 
> average wind speed are the same. 
>

please note that for pretty much every personal weather station, 'wind 
gust' is actually 'maximum wind speed':

https://github.com/weewx/weewx/wiki/windgust

m

-- 
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.