[wxqc] Average wind direction?
steveh at softwx.com
steveh at softwx.com
Fri Aug 11 00:10:09 EDT 2006
I don't know (but would like to know) what the "official" NWS standard is for calculating wind direction observations. When I was writing VPLive, I hunted around and found references for both weighted vector avg and unit vector avg. Here are some examples for unit vector avg:
http://www.ndbc.noaa.gov/wndav.shtml
http://www.glerl.noaa.gov/metdata/chi/archive/
The diffence between the unit vector avg formula I gave vs. the weighted vector avg is not a big deal. I'd be happy to implement it whichever way jives with the NWS preference.
As for which is better, I don't know. Similar to the example you gave, what if a north wind blew 20 mph for an hour and then blew from the east at 1 mph for the next 9 hours. Would you say the wind over the 10 hours was from the NNE or ENE? Practically though, since the period of time we're talking about for CWOP is only 2 minutes, I don't think there will be much difference between either of the methods.
Steve
Why wouldn't you weight it by speed? Suppose you had a northerly wind at 20 mph all morning and an easterly wind at 1 mph all afternoon. Would you really want the average wind direction to be NE?
Another idea would be to simply add vectors as if you were following a particle of air around. After the time over which you want to average, the average direction would simply be the direction of the particle. I guess this is essentially the same as my original proposal but simply summing instead of averaging. The only difference between the sum and the average is the scalar portion of the resultant vector, which you don't care about for direction.
On 8/10/06, steveh at softwx.com <steveh at softwx.com> wrote:
Hi,
For wind direction, you could use a unit vector average (not weighted by speed).
Steps:
1. Convert wind dir degrees to radians
2. x = sin(winddir in radians)
3. y = cos(winddir in radians)
4. Vx = avg(x) //i.e. sum(x) / number of samples
5. Vy = avg(y)
6. avg wind dir in radians = arcTan(Vx / Vy)
7. convert avg wind dir to degrees
Note that you have to include code to fixup the resultant quadrant. In Object Pascal (Delphi) there is an function that simplifies this; in step 6 you would use
avgWindDirRad := ArcTan2(Vx, Vy);
and after converting to degrees...
if (avgWindDirDeg < 0) then avgWindDirDeg := avgWindDirDeg + 180;
Here is a source for some detailed info on the topic:
http://www.bom.gov.au/bmrc/csr/prc/usepa-met-obs,4.5.99.rtf
Steve
======= At 2006-08-10, 10:46:20 you wrote: =======
>So, as I'm slowly making progress on this Perl script in the bits of
>time I get here and there, I'm stumped on how to come up with a wind
>direction average. Maybe I'm putting too much thought into this? I
>have several documents that describe the data fields, but no one
>document is clear on all of the elements (i.e., one document says the
>avg wind speed is an average over 5 minutes, another one says it's a
>10 minute sustained (minimum?) wind).
>
>Anyway I Google'd for info on average the wind direction and appears
>some of them try to take into account hte wind speed as well as part
>of that calculation. I assumed it was just a an average sample based
>on direction alone. Am I overanalyzing this?
>
>What formulas are people using to calculate the average wind direction
>in their own programming?
>
>--
>Joe Morris
>_______________________________________________
>wxqc mailing list
>Post messages to wxqc at lists.gladstonefamily.net
>To unsubcribe or change delivery options, please go to:
>http://pond1.gladstonefamily.net:8080/mailman/listinfo/wxqc
>
>The contents of this message are the responsibility of the author.
_______________________________________________
wxqc mailing list
Post messages to wxqc at lists.gladstonefamily.net
To unsubcribe or change delivery options, please go to:
http://pond1.gladstonefamily.net:8080/mailman/listinfo/wxqc
The contents of this message are the responsibility of the author.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pond1.gladstonefamily.net:8080/pipermail/wxqc/attachments/20060810/6520cff4/attachment.html
More information about the wxqc
mailing list