quiverm creates wrong vectors?

Hello,
I am trying to plot wind vectors with quiverm. For some reason, and I would really like to know why, the vectors I get point in the wrong direction, distorted in the x and y direction, compared to when I just plot them with quiver.
This is what I have and use:
ywindlat meshgrid (17x69) (latitude increasing by rows)
xwindlon meshgrid (17x69) (longitude increasing by columns)
u wind (17x69)
v wind (17x69)
then I use the following commands:
load coast
axesm('mercator', 'MapLatLimit' ,[-20 20], 'MapLonLimit' ,[120 -70],...
'ParallelLabel', 'on', 'MeridianLabel', 'on', 'MLabelParallel', 'south', 'Grid', 'on', ...
'PLabelLocation', 10, 'MLabelLocation', 20, 'MLineLocation', 20,'PLineLocation', 10)
plotm(lat,long, 'Color',grey,'linewidth',1)
quiverm(ywindlat,xwindlon, wind_u, wind_v,'black',0.2 )
that gives me different vectors than if I just plotted:
quiver(flipud(wind_u), flipud(wind_v))
What am I missing?
Any help is appreciated a lot
Sandra

5 comentarios

Walter Roberson
Walter Roberson el 22 de Jun. de 2012
"longitude increasing by columns" -- but is that East or West longitude?
Could you describe the distortion, or post examples?
http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
Sandra
Sandra el 23 de Jun. de 2012
Both, it spans over the dateline, so west is negative and east is positive.
The thing is I can't figure out how it is distorted. First I thought the vectors are filliped but that is not the case, some of them are deflected 90degrees some of them 180..its all over the place, there is not even a logic behind :-((((
Walter Roberson
Walter Roberson el 23 de Jun. de 2012
Could you post an image of the plot with the distortion, and an image of the plot without ? tinypic is a relatively good site for such things.
Sandra
Sandra el 25 de Jun. de 2012
Hi Walter,
I think I have a slight idea why it is distorting them. And it's somewhat embarrassing :-) My U and V input vectors are wind speeds in m/s and not in in lat/long degree units as requested by the quiverm function. Obviously this is not going to work out...(ahhh). Do you know of a way that I can use the quiverm but with actual wind values?
Have a great day
Sandra
Walter Roberson
Walter Roberson el 26 de Jun. de 2012
I have not worked with the Mapping toolkit. Looking around the documentation, I'm thinking that perhaps you need to convert your velocity vectors using reckon() as discussed near the bottom of http://www.mathworks.com/help/toolbox/map/bragdwh.html . Divide your meters/s by 1000 to get the values in kilometers. But to get the arclen parameter for the distance I'm thinking you probably have to find the magnitude of your wind-speed vector... I guess that would be sqrt(u.^2 + v.^2). And I guess the az would be atan2(u,v). Might be easier to do a cart2pol() to calculate the magnitudes and angles.

Iniciar sesión para comentar.

Respuestas (1)

Chad Greene
Chad Greene el 22 de Mayo de 2014

0 votos

I recently ran into the same problem. The ncquiverref function scales the vectors correctly, and correctly identifies u as a zonal component of wind and v as the meridional component.

1 comentario

Chad Greene
Chad Greene el 28 de Jul. de 2014
The quivermc function is another option. It is an adaption of ncquiverref.

Iniciar sesión para comentar.

Categorías

Productos

Etiquetas

Preguntada:

el 22 de Jun. de 2012

Comentada:

el 28 de Jul. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by