I think there is a flaw in the calculation of meanwdird with respect to historical data. What I am seeing is that if the wind is out of the north for most of the day it is not returning a proper value because north represents 0 degrees with respect to wind direction. For example, I was looking at the historical weather for a location and 9 of the 12 observations for that day read as the wind coming out of the north. The other three were out of the south. Clearly the wind was out of the north for almost the entire day yet the meanwdird said it was 180 degrees which is out of the south. What this means is that you will never have an instance where the mean wind direction is out of the north unless it blows from there for the full 12 hour observation of the day.