How would one compute the standard deviation of wind direction that can assume values between 0 and 360°? I have the wind information in u and v components and corresponding angle. Getting the average is possible to take the average of u and v and then compute the angle, while just averaging the angular information could result in averages of 180° when wind directions strays around 0°. If I took standard deviations of u and v, how would I have to compute them to get the standard deviation of the angle?
I had a similar problem and used Yamartino method: https://en.wikipedia.org/wiki/Yamartino_method which is one pass approximation for wind direction variation. in python it something like (the code is not optimised though):
from math import * def yamartino(thetalist): s=0 c=0 n=0.0 for theta in thetalist: s=s+sin(radians(theta)) c=c+cos(radians(theta)) n+=1 s=s/n c=c/n eps=(1-(s**2+c**2))**0.5 sigma=asin(eps)*(1+(2.0/3.0**0.5-1)*eps**3) return degrees(sigma)