Averaging the scalar wind direction data gives inaccurate values due to compass headers in the range from 0 to 360 degrees, so I already converted my list to u and v components from direction and tilt angles.
In order to discard the correct wind direction, for averaging I need to develop some ifelse function applicable for the following three scenarios:
V > 0...((180 / pi) * atan((Ucomp/Vcomp)) + 180) U and V < 0...((180 / pi) * atan((Ucomp/Vcomp)) + 0) U > 0 and V < 0...((180 / pi) * atan((Ucomp/Vcomp)) + 360)
In the dataset I'm looking for analysis, Ucomp is greater than 0 and Vcomp is less than zero, but there will undoubtedly be scenarios in which all three will be deployed, so I need a function for parsing and calculating iteratively and applying the correct formula for each time step. I have not used functions or functions before, so I played with them, did not work.
I provide sample data below ...
DateTime Wind.Spd Wind.Direction Air.Density Temp.C GEP.GE16XLE GCF.GE16XLE Ucomp Vcomp 1 1981 7.662370 248.3395 0.9148207 11.28967 597.7513 37.35946 5.253453 -0.7404972 2 1982 8.199412 251.6763 0.9172176 10.12751 678.8595 42.42872 5.867979 -0.6191475 3 1983 8.188782 251.7889 0.9162767 10.30619 667.9461 41.74663 5.777208 -1.0473982 4 1984 7.942632 246.7908 0.9174074 10.05093 642.6374 40.16484 5.415773 -0.6796723 5 1985 8.016558 252.7305 0.9171721 10.38414 654.2588 40.89117 5.649406 -0.9999082 6 1986 7.739984 249.6431 0.9158740 10.99859 607.0542 37.94089 5.305971 -0.9118965
r
Rwj
source share