Page 1 of 1

Wind bearing errors?

Posted: Sat 07 Nov 2015 10:19 pm
by robin55
Not sure if this is the right place to post this, there doesn't seem to be anywhere I can find to report suspected bugs or user feedback.

I'm not a direct user of cumulus, but indirect as in a frequent client of a website that does use it.

I also have over 40 years of professional experience writing similar software. Yes, we *did* use computers that long ago, though the displays were a teensy wee bit less slick! Think ASR33 Teletype machines, unbelievably expensive and crude by today's standards.

My concern is the reporting and display of wind bearing, which are obviously averaged. Are you sure the correct algorithm to compute this is being used? Observations of the particular site suggests not - 180 degree flips are common, even in stable met conditions, backed up by other local(-ish) reports and Met Office baratic (pressure) charts. (And yes, in my yoof I could read and plot baratic charts transmitted at up to 35wpm (~3 digits/second) Morse code!)

Wind bearings *cannot* be averaged by the simple algorithm sum(1...N)/N, which is what appears to be happening. Eg., consider the result of averaging 45 and 315 degrees!

The correct algorithm is of course:
x = y = 0
foreach angle {
x += cos(angle)
y += sin(angle)
}
average_angle = atan2(y, x)

Remembering of course to use to use the appropriate units - radians or degrees!

Comments please.

Regards
Robin K

Re: Wind bearing errors?

Posted: Sun 08 Nov 2015 9:02 am
by steve
robin55 wrote:Not sure if this is the right place to post this, there doesn't seem to be anywhere I can find to report suspected bugs or user feedback.
That's what the entire forum is for - or at least the Cumulus section and its sub-sections.
My concern is the reporting and display of wind bearing, which are obviously averaged
The average bearings are averaged, obviously, but the site may also be reporting the 'instaneous' reading from the weather station. Exactly what that represents is dependent of the type of weather station.
Wind bearings *cannot* be averaged by the simple algorithm sum(1...N)/N
I am aware of this. Cumulus doesn't do this, it averages vectors (taking the wind speed into account).

If you are seeing a site with large swings in the calculated average bearing, it is likely that (a) they are using one of the cheaper weather stations, where the anemometer tends to swing around pseudo-randomly, and (b) they do not have Cumulus running all the time, so for some periods (where 'live' data is not available) there are very few data points available for the calculation - Cumulus uses a period of 10 minutes by default (this can be changed by the user), and typically someone might have their station logger set to an interval of 5 or 10 minutes at best. Some people use a logger interval of 30 minutes, so of course in that situation, the average only uses one data point, and it will hence follow the large variations in the recorded values.