Hi, I am trying to calculate the wind direction from the raw data of a CSAT3. I am comparing my values with a already calculated value from a flux table. In the CRBasic program the wind direction is calculated as follow:
WindVector(1, Uy, Ux, IEEE4, sonic_sidable_F, 0, 1, 2)
This computes the scalar mean wind speed, the vector mean wind speed the wind direction of the sonic and the standard deviation of the wind direction.
Now i am trying to calculate these values from the raw data. For this I was reading in the CR3000 Manual on page 269:
wnd_dir_sonic = arctan(Ux / Uy)
where
Ux = sum(Uei / Ui) / N
Uy = sum(Uni / Ui) / N
where
Ui = (Uei^2 + Uni^2)^(1/2)
My question is now. How do you define Ue and Un. I suppose Ue is Uy and Un is Ux. But with this assumption the calculated values have sometimes an offset of 180 degrees. Do you make any conversion of Ux and Uy before calculating? I mean if you follow the instructions it should be possible to recalculate the values?
Thank you in before for your answer.
Ux = sum(UEi / Ui) / N
Uy = sum(UNi / Ui) / N
Hi, thanks for your answer, but i still dont get it.
My code looks like:
UNi = Ux
UEi = Uy
Because from the raw data i get Ux and Uy..
Ui = sqrt(UNi^2 + UEi^2)
Ux = sum(UEi / Ui) / N
Uy = sum(UNi / Ui) / N
wnd_dir = atan(Ux / Uy) * (180 / PI)
When i compute the wnd_dir like this my result have a sometimes a offset of 180 degrees sometimes 0 degrees and sometimes -180 degrees. The pattern of the offset seems randomly.
Try this, it was given to me by CSI.
Const PI = 4*ATN(1)
wnd_dir = (ATN2(Ux,Uy)*180/PI+360) MOD 360
Your Ux. Is that a scalar mean or the raw_data? same for Uy..
And what is atan2()??
I'm not an expert on the CSAT3 but, I'm assuming you have raw data from the CSAT3 and want to calculate the instantaneous data on the fly. If you use the program example in the CSAT3 manual, you have wind_east and wind_north variables.
hor_wnd_dir = (ATN2(wind_east,wind_north)*180/PI+360) MOD 360
IslandMan is correct.
Thanks a lot IslandMan.
With your equation i can calculate the correct wind direction. I wanted to calculate the wnd_dir for an half hour. So i had first to calculate the mean for the wind_east and wind_north. Then i get the correct wnd_dir for an half hour..
Thanks you again.. Great help
You're welcome. I'm glad you got it working.
This post is under review.