Quiver plot for Wind data of reanalysis
조회 수: 3 (최근 30일)
이전 댓글 표시
I plan to use Matlab to plot wind of reanalysis that I downloaded from this website: https://psl.noaa.gov/data/gridded/data.ncep.reanalysis2.pressure.html
However, the result is not as expected. I send the sample of data in this posting.
I hope the result is like the image below (run by other software).

I use the following Matlab script:
lon1=load('lon.txt');
lat1=load('lat.txt');
u=load('u.txt');
v=load('v.txt');
coast=load('world_coastline.txt');
lon1q=repmat(lon1',73,1);
lat1q=repmat(lat1,1,144);
quiver(lon1q, lat1q,u',v',1,'k','LineWidth',1)
hold on
plot(coast(:,1), coast(:,2),'k','LineWidth',1.0)
xlim([90 110]);
ylim([-8 8]);
hold off
set(gca,'TickDir','out','FontName','Times New Roman','LineWidth',1);
Hoewever, the result is strange, as given below:

I tried several combinations, and found the quiver below to give somewhat similar results (still different).
quiver(lon1q, flipud(lat1q),flipud(u'),(v')*-1,1,'k','LineWidth',1)
Result

Perhaps some of you have used quiver plots for data reanalysis, and please share your experiences. Thank you very much.
댓글 수: 0
채택된 답변
Cris LaPierre
2021년 11월 11일
편집: Cris LaPierre
2021년 11월 11일
Part of the issue is a mismatch between your coastline data and your quiver data. If you zoom all the way out, you will see what I mean.
load windData
[lat1q,lon1q]=meshgrid(lat1,lon1);
quiver(lon1q, lat1q,u,v,1,'k','LineWidth',1)
hold on
plot(coast(:,1), coast(:,2),'k','LineWidth',1.0)
hold off
set(gca,'TickDir','out','FontName','Times New Roman','LineWidth',1);
figure
quiver(wrapTo180(lon1q), lat1q,u,v,1,'k','LineWidth',1)
hold on
plot(coast(:,1), coast(:,2),'k','LineWidth',1.0)
hold off
set(gca,'TickDir','out','FontName','Times New Roman','LineWidth',1);
If you have the Mapping Toolbox, you could do the following. To me, the coastlines look a little better.
figure
axesm('eqdcylin')%,"MapLonLimit",[90 110],"MapLatLimit",[-8 8]);
plotm(coast(:,2), coast(:,1),'k','LineWidth',1.0)
[Lon,Lat] = meshgrid(lon1,lat1);
quiverm(Lat,Lon,u',v')
I'm not sure I like the idea of arbitrarily flipping matrices to try to get an expected output. Do you have any information on how the other software processes the data? Are you sure you are using the same data in both places?
댓글 수: 4
Cris LaPierre
2021년 11월 12일
편집: Cris LaPierre
2021년 11월 12일
No, your code returns the same result as mine. I checked using isequal. However, your code is assigning the variable v to what should be u (comes from uwnd, not vwnd).
That gave me the insight to figure out what was happening. When I check your u and v matrices, they are the same. You accidentally loaded the uwnd data for both the u and v components. That means the original quiver command was
quiver(lon1q, lat1q,u',u',1,'k','LineWidth',1)
% ^^
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Vector Fields에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



