wind pattern is wrong
2 次查看(过去 30 天)
显示 更早的评论
Hello All I am trying to plot wind from era interim data , I compare my plot with plot by NCL and Grads and I found that the pattern plotted by the MatLab is wrong. here is the code . I have attached the file data and output. thanks in advance
if true
file2='era_interim_0.5_uv.nc'
lat2 =ncread(file2,'latitude')
long2 =ncread(file2,'longitude')
time2 =double(ncread(file2,'time'))
ncdisp(file2)
u10 = ncread(file2,'u10',...
[1 1 1],[length(long2) length(lat2) length(time2)],[1 1 1]);
v10 = ncread(file2,'v10',...
[1 1 1],[length(long2) length(lat2) length(time2)],[1 1 1]);
%%drawing wind
a_lat2=21.5
a_lat1=-11.5
a_lon1=1.5
a_lon2=51.5
lat1i=find(lat2 == a_lat1)
lat2i=find(lat2 == a_lat2)
lon1i=find(long2 == a_lon1)
lon2i=find(long2 == a_lon2)
lats = [a_lat1 a_lat2];
lons = [a_lon1 a_lon2];
f1=figure;
H1 = worldmap(lats,lons);
coast = load('coast');
geoshow(coast.lat,coast.long);
states = shaperead('cntry02.shp','UseGeoCoords', true);
geoshow(states,'DisplayType', 'polygon', 'FaceColor', 'none','edgecolor','black','LineWidth',2)
a=double(squeeze(lat2(lat2i:lat1i)));
b=double(squeeze(long2(lon1i:lon2i)));
[b1 a1]=meshgrid(b,a);
u100=u10(lon1i:lon2i,lat2i:lat1i,1);
v100=v10(lon1i:lon2i,lat2i:lat1i,1);
quiverm(a1,b1,u100',v100',2)
geoshow(states,'DisplayType', 'polygon', 'FaceColor', 'none','edgecolor','black','LineWidth',2)
end
0 个评论
回答(1 个)
Chad Greene
2014-5-22
Read the quiverm documentation carefully. It confoundingly defines u as the meridional component and v as the zonal component. Further, it wants u and v to be in units of degrees, not distance or speed. This effectively shrinks the zonal component of the vectors close to the poles. You can try to fix the second issue with the reckon function, or you can use ncquiverref instead of quiverm to fix both issues.
1 个评论
Chad Greene
2014-7-29
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!