I have hourly u and v wind components, and I’m having trouble to aggregate it to the daily level.
In principle, I thought that I could just take the mean of U and V wind components and find the direction of these means, but the result I get using this algorithm is different from when I use specialized package CircStat. In the code that follows, variable dir_rwind is the direction calculated from the mean U and V components, while dir_CircStat is the mean direction calculated with CircStat.
set.seed(123)
uc <- rnorm(300,0,2)
vc <- rnorm(300,0,2)
df <- data.frame(uc=uc, vc=vc,id=1:10)
df <- cbind(df,as.data.frame(rWind::uv2ds(df$uc,df$vc)))
agg <- df %>%
group_by(id)%>%
summarise(mean_u10 = mean(uc),
mean_v10 = mean(vc),
dir_rwind = rWind::uv2ds(mean_u10, mean_v10)[1],
dir_CircStat = (180/pi)*CircStats::circ.mean(dir*pi/180))
agg
Why do I get different mean wind directions? Should I ever use the first algorithm I tried (taking the mean of each component: like variable dir_rwind)? If yes, when should I use each calculation algorithm?
Thanks a lot