plotting windrose using Matlab

76 次查看(过去 30 天)
Hi , can someone please help me with windrose plotting . I have directions and windspeed as my first and second column, and using wind_rose.m which I got from Matlab fileexchange Thanks S

采纳的回答

Geoff Hayes
Geoff Hayes 2014-8-19
Shital - there are two options for specifying wind direction using wind_rose from the File Exchange: standard (which is the default) and meteo. Using examples such as
v = 30*rand(10000,1);
d = rand(10000,1);
wind_rose(d,v)
shows the wind at the east, when I expect it to be at the north. Changing the wind directions to
d = 60 + rand(10000,1);
wind_rose(d,v)
shows the wind at roughly 30 degrees from north. This suggests that the author of the code is using a counter-clockwise from east system, where 0 degrees is at east (along the x-axis), ninety degrees is at north, etc.
You are probably expecting a clockwise from north system where 0 degrees is at north, 90 degrees is at east, etc. To get around this you can just subtract your direction vector from ninety degrees like
d = 90 - d;
If you re-use the examples from above, then winds appear correctly relative to north (y-axis).
If you decide to change the direction type from the default of standard to meteo, then this appears more of a meteorological wind direction convention. If the wind direction vector is primarily northern wind directions, then the wind is blowing to the north and so coming from the south. So you using
v = 30*rand(10000,1);
d = rand(10000,1);
wind_rose(d,v,'dtype','meteo')
will show winds in the south of the figure, since they are blowing to the north and so coming from the south. Likewise
d = 60 + rand(10000,1);
wind_rose(d,v,'dtype','meteo')
would show the winds coming from the south-west as they are blowing to 60 degrees from north
  3 个评论
Geoff Hayes
Geoff Hayes 2014-8-19
Shital - glad to have been able to help. But do you really need to do 'dtype','meteo' as well? Are you sure that you get the desired results from that? I think that the 90-D is sufficient.
José Perona
José Perona 2017-5-13
Hi, I have a similar problem. The directions are wrong but if I use d-90 the wind rose is correct. I don't understand it because 0 degrees is north and 90 degrees is east according to the author. ¿Can you explain better please?

请先登录,再进行评论。

更多回答(1 个)

Al Mac
Al Mac 2017-11-24
编辑:Al Mac 2017-11-24
Hello,
If you use the polarhistgram function you can index on wind speed and overlay to your hearts content -
figure
pax = polaraxes;
polarhistogram(deg2rad(wind_direction(wind_speed<25)),deg2rad(0:10:360),'displayname','20 - 25 m/s')
hold on
polarhistogram(deg2rad(wind_direction(wind_speed<20)),deg2rad(0:10:360),'FaceColor','red','displayname','15 - 20 m/s')
polarhistogram(deg2rad(wind_direction(wind_speed<15)),deg2rad(0:10:360),'FaceColor','yellow','displayname','10 - 15 m/s')
polarhistogram(deg2rad(wind_direction(wind_speed<10)),deg2rad(0:10:360),'FaceColor','green','displayname','5 - 10 m/s')
polarhistogram(deg2rad(wind_direction(wind_speed<5)),deg2rad(0:10:360),'FaceColor','blue','displayname','0 - 5 m/s')
pax.ThetaDir = 'clockwise';
pax.ThetaZeroLocation = 'top';
legend('Show')
title('Wind Rose')
Note, my data was in degrees. Remove deg2rad if yours is in radians.

类别

Help CenterFile Exchange 中查找有关 Polar Plots 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by