Wind bearing errors?
Posted: Sat 07 Nov 2015 10:19 pm
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
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