Jump to content
Snow?
Local
Radar
Cold?
IGNORED

wind direction


Recommended Posts

Posted
  • Location: Ipswich, Suffolk
  • Location: Ipswich, Suffolk

Hello,

I am not to sure weather i have posted this in the right section of this forum.

I need help caculating wind direction from the U and V components of wind.

I can caculate the angle and degree, but having trouble detrerming the quadrent.

After spending many weeks on this i think i have come up with a function that returns the inverse tangent of (y/x) in the range -π ≤ return_val ≤ π, using the signs of both arguments to determine the quadrant of the return value

The formula:

r2d = 45.0/atan(1.0) (radians to degrees) or 57.2957795

dir = atan2(u, v) * r2d + 180

If some one here is able to check this formula, or knows another way please post.

I would be most greatful.

Ian Gooch

Link to comment
Share on other sites

Posted
  • Location: just south of Doncaster, Sth Yorks
  • Location: just south of Doncaster, Sth Yorks

you've lost me mate.

Why do you need u and v components?

post-847-1178748766_thumb.jpg

can't really help beyond that very simple idea, certainly not at this time of night!

Edited by johnholmes
Link to comment
Share on other sites

Posted
  • Location: Ipswich, Suffolk
  • Location: Ipswich, Suffolk

Hello John,

Why do you need u and v components?

I am procducing my own forecasts based on the GFS 0.05deg NWP model. Unlike others who use this data I use a program that converts GRIB data into its raw state.

and does not do the caculations for me.

The reason for this is: I can then add my own caculations based on the topography of the area i am forecasting. Plus I can change the data, if some of the values are missing - quite comman with data set as large as the GFS.

This should allow me to produce a more realistic forecast - Well thats the plan away

Now wind is packed in a GRIB message as U m/s and V m/s at the required height

Example: A wind @10 meters would return as 10 HGTL V=2.3 m/s U=2.6 m/s

Now to caculate the direction you need for find the angle

V = North to South if V<0

V= South to North if V>0

U= West to East if U>0

U= East to West if U<0

Next you need to find the Quadrent, and this is where my trouble lies.

Now

N 360

|

|

W 270-----------90 E

|

|

S 180

Now based on the example above U=2.6 and V=2.3, this to me would put it in the quadrent SW (between S and W)

As U>0 and V>0.

I caculated the angle and ask if a met office forecaster would check the anwser and my formula, before i placed it in to my math model.

The relpy was that it should be in the SE quadrant, but i can't see how.

I contacted NOAA who gave me the formula in my earlier message, with should caculate the Quadrent for me, as well as the angle.

I just need some further advice weather this formula is correct, so it can be placed in my model, and carry on with my work.

Ian

Link to comment
Share on other sites

Posted
  • Location: just south of Doncaster, Sth Yorks
  • Location: just south of Doncaster, Sth Yorks

Are you sure this is the correct way

V = North to South if V<0

V= South to North if V>0

U= West to East if U>0

U= East to West if U<0

It seems logical to me but I'm no expert. Did the answer from NOAA and the Met O agree or not?

Link to comment
Share on other sites

Posted
  • Location: Lincoln, Lincolnshire
  • Weather Preferences: Sunshine, convective precipitation, snow, thunderstorms, "episodic" months.
  • Location: Lincoln, Lincolnshire

I did something very similar in my MRes project at Leeds.

My understanding is that U (+ve) = west-east, and V (+ve) = south-north, corresponding to the x and y axis respectively.

Thus, I'd have thought that if U and V were positive the wind would be coming from the SW quadrant, i.e. from west-east and from south-north.

Link to comment
Share on other sites

Posted
  • Location: Rochester, Kent
  • Location: Rochester, Kent

Here you go . . .

'a=(u,v) 'b=(0,1)

Dim ma As Single ' |a|

Dim m As Single

Dim d As Single

' Get wind speed (magnitude) and convert it to mph

ma = Sqr(u * u + v * v)

m = ma * 2.24

' Get angle(d) difference between a, and b

' because cos(d) = a.b/|a||b|, therefore d = arccos(a.b/|a||b|)

' simplified d = arccos(v/|a|)

d = 360 - (ArcCos(v / ma) * 57.295780490443)

d will give you the angle (from 0..360) so you should be able to determine what you need from that.

Edited by VillagePlank
Link to comment
Share on other sites

Posted
  • Location: just south of Doncaster, Sth Yorks
  • Location: just south of Doncaster, Sth Yorks

I wish my brain still worked!

Link to comment
Share on other sites

Posted
  • Location: Ipswich, Suffolk
  • Location: Ipswich, Suffolk
I did something very similar in my MRes project at Leeds.

My understanding is that U (+ve) = west-east, and V (+ve) = south-north, corresponding to the x and y axis respectively.

Thus, I'd have thought that if U and V were positive the wind would be coming from the SW quadrant, i.e. from west-east and from south-north.

My thoughts exactly.

John - The replys I get from NOAA are very hard to understand, they do not make things clear to me. I think that because they are all hold Phd's they are unable to explain in simple terms to the likes of which i can understand.

While the Met Office forecast did make to clear, but i believe they got it wrong. I reply i got from the UKMO was infact relayed though their customer enquires, so perhaps thats where the mistake was made.

Mind you they did get the 1987 storm wrong - perhaps if they new which way the wind was blowing, they would of got it right LOL.

Ian

Link to comment
Share on other sites

Posted
  • Location: Rochester, Kent
  • Location: Rochester, Kent

Did my post give you what you needed? Do you want me to explain it in further detail? (might take a while to construct the post - so I didn't bother)

Edited by VillagePlank
Link to comment
Share on other sites

Posted
  • Location: Ipswich, Suffolk
  • Location: Ipswich, Suffolk
Here you go . . .

'a=(u,v) 'b=(0,1)

Dim ma As Single ' |a|

Dim m As Single

Dim d As Single

' Get wind speed (magnitude) and convert it to mph

ma = Sqr(u * u + v * v)

m = ma * 2.24

' Get angle(d) difference between a, and b

' because cos(d) = a.b/|a||b|, therefore d = arccos(a.b/|a||b|)

' simplified d = arccos(v/|a|)

d = 360 - (ArcCos(v / ma) * 57.295780490443)

d will give you the angle (from 0..360) so you should be able to determine what you need from that.

That is the same as my first formula 57.2957*ATAN2(u,v)+180

That, as well as yours, should determing the quadrant in the sum.

Ian

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...