A little clarification on the use of the special observation 'wind' may be 
warranted.

As per the Wind section <http://weewx.com/docs/customizing.htm#Wind> in the 
Customization Guide WeeWX stores wind data in two distanct forms. Firstly 
windSpeed, windDir, windGust and windGustDir are stored as scalar values in 
the archive (provided your station emits them) just as any other 
observation. There are also corresponding daily summary tables that are 
used as an optimisation for long period stats such as $month, $year or 
$alltime if implemented. Again these function as per any other observation. 
Wind data is also stored in vector form but only in the 'wind' daily 
summary (ie not in the archive). This allows stats such 'what was the 
direction of the highest speed wind observed today' or this week, or month 
or year etc using a single tag. If this special vector form was not used 
then when you use something like $month.windDir.max (or 
$month.windGustDir.max) you will likely get 359 or 360 degrees, certainly 
not the direction of the wind during the 50km/hr gust that occurred 
yesterday.

The upshot of this is that the special observation wind can only be used 
with the daily summaries. Many are not aware, but the daily summaries can 
only return data for a midnight-to-midnight, first ever record-to-midnight, 
midnight-to-last record or first record-to-last record periods. That is the 
daily summaries only store data as a summary for the day, they can't use 
part days unless it is the first day or last day of data stored in the 
database. $month.xxx, $year.xxx almost always use a midnight-to-mdnight 
boundary or first record or last record boundary. However, other tags such 
as $span and $trend aggregate over a period that does not fall on the 
boundaries supported by the daily summaries (well a $span over a delta that 
is a multiple of 24 hours would at midnight each day but that is not really 
usable) and in such cases the archive is used. But we don't have the 
special observation wind in the archive so hence 
$span($year_delta=5).wind.max will fail everytime except at midnight.

So that is why $span.wind fails but $year.wind does not. Likewise as outTemp 
exists in the archive and the daily summaries, when you try to obtain an 
outTemp 
aggregate that does not sit on the boundaries supported by the daily 
summaries, WeeWX automatically drops back to the archive because outTemp is 
in the archive (try doing a $span on outTemp over a very long period that 
is not on a midnight boundary - the query will take some time as the 
archive is being used not the daily summary). The solution to the $span.wind 
issue is to use windSpeed, windDir etc or use $alltime. This means that it 
is not possible to display 'the direction of the highest wind speed seen in 
the last 36 hours' using a single tag, it will require some messy querying 
of the archive to find the highest wind speed seen in the last 36 hours and 
then finding the corresponding wind direction (again from the archive) at 
that time. Easily doable in a search list extension and could probably be 
done with some in-line template code but likely more than would be expected 
of a novice.

Hope this goes some way to explaining why things did not work as expected.

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

Reply via email to