Hi Simon,

I tried setting the debug level to 1 and viewed the syslog.  The units 
> displayed in the log are usunits=16 (which I assume is meters per second?). 
>

The usUnits decodes are 1 (or 0x01) is US (aka US customary) and uses miles 
per hour for wind speeds, 16 (or 0x10) is Metric with wind speeds in km per 
hour and 17 (or 0x11) is known as MetricWX with wind speeds in metres per 
second.
 

> I could not understand how these values were used to be stored in the 
> archive database.  
>

A little background on how units are used within WeeWX. First up the 
database, in weewx.conf under [StdConvert] you have a setting target_unit 
that will either be US, METRIC or METRICWX. This sets the database unit 
system used throughout the database. The default is US. Some folks insist 
on having target_unit set to the units they use natively, there really is 
little value in doing this unless you have specific requirements as WeeWX 
automatically converts to/from the units required (in fact I have seen it 
cause issues variously where database units are used (for example 
specifying QC limits without units), folks forget their database units are 
different to the normal and they can get unexpected results). Data coming 
from drivers, whether they be loop packets or archive records can be in any 
of the three unit systems, WeeWX automatically converts any data being 
saved to database to the target_unit unit system. Likewise any archive 
records or loop packets being processed elsewhere by WeeWX could be in any 
of the three unit systems. Data being output in a Cheetah report or plotted 
by the image generator is automatically converted to the units specified by 
the tag, skin.conf or weewx.conf or the defaults as applicable. Bottom line 
is when analysing WeeWX data never assume any units, always check the 
usUnits value.
 

> See the table below,  for example 1.1 mps  becomes 1.36 mph.  it should be 
> 2.46 mph using my calculations.  Do you have any ideas why the archive DB 
> has this value?
>
>  
>
>  
>
> *time*
>
> *debug data wind gust (mps)*
>
> *debug data usunits*
>
> *console minutes*
>
> *console wind gust km/h*
>
> *DB (mph)*
>
> Mar
>
> 8
>
> 22:40:57
>
> 1.1,
>
> 16
>
> 40
>
> 4
>
> 1.36702
>
> Mar
>
> 8
>
> 22:42:49
>
> 0.0,
>
> 16
>
> 42
>
> 0
>
> 0.68351
>
> Mar
>
> 8
>
> 22:44:57
>
> 1.1,
>
> 16
>
> 44
>
> 4
>
> 2.05053
>
> As mentioned above you usUnits=16 data will be km/hr rather than m/s. 
That still doesn't help things tally. So what is 'DB', is that windSpeed or 
windGust?

Appreciate the table may make things easy to read but perhaps it might help 
more if you provide the actual loop/archive record output when WeeWX is run 
directly, a copy of the log (with debug set) over the same period and a 
query from the database again covering the same period and your recorded 
observations of the console gain over the same period.

So when there is some wind around let's run WeeWX directly for about 5 
minutes. At the same time WeeWX is running directly note your wind speed 
values on the station display. Capture the console output (LOOP: and REC: 
data) for the entire period. Take a log extract that covers the entire 
period that WeeWX was run directly.

Now query the database after finishing the direct WeeWX run. Am assuming 
you are using SQLite as your DBMS. Note you may need to install the sqlite3 
application using sudo apt-get install sqlite3 if not already installed. 
Also assuming your database is named weewx.sdb and it is located in 
/home/weewx/archive (it may be located in /var/lib/weewx depending on your 
WeeWX install method - adjust following command as necessary):

$ sqlite3 /home/weewx/archive/weewx.sdb
sqlite> .headers on
sqlite> SELECT datetime,datetime(dateTime,'unixepoch','localtime'),usUnits,
windSpeed,windGust FROM archive ORDER BY dateTime DESC LIMIT 20;

that will display the timestamp, human readable date-time, usUnits, 
windSpeed and windGust values for the last 20 minutes (use .quit to exit 
sqlite3). If run within 15 minutes of completing your direct run we should 
have some overlapping data to compare from (1) the loop packets and archive 
records seen by WeeWX (2) the raw data seen by the SDR driver (3) your 
visual observations of the station display and (4) the database. Post these 
four pieces of data.

One final question, is your loop_hilo setting under [StdArchive] in 
weewx.conf set to True or something else?
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/2ea96c2c-ab5b-4f2c-82b0-6a65019d8914%40googlegroups.com.

Reply via email to