Matlab weather map with geoshow
Mostrar comentarios más antiguos
Hello all! I have a certain problem creating a weather map. I have a netcdf file including all the data (Wind and coord variables etc) which I have assigned to variables and tried creating the map. I 'm including the code below
ncid = netcdf.open('lap_wrfout_d02_20130620.nc');
finfo = ncinfo('lap_wrfout_d02_20130620.nc');
disp(finfo);
dimNames = {finfo.Dimensions.Name};
dimMatch = strncmpi(dimNames,'x',1);
disp(finfo.Dimensions(dimMatch));
vartime = ncread('lap_wrfout_d02_20130620.nc', 'time');
vardataU10 = ncread('lap_wrfout_d02_20130620.nc', 'U10');
vardataV10 = ncread('lap_wrfout_d02_20130620.nc', 'V10');
meanU10 = mean(vardataU10, 3);
meanV10 = mean(vardataV10, 3);
ws = sqrt(meanU10.^2 + meanV10.^2);
XLONGdata = ncread('lap_wrfout_d02_20130620.nc', 'XLONG');
XLATdata = ncread('lap_wrfout_d02_20130620.nc', 'XLAT');
Now the problem is i cannot create the weather map. I 've tried that thus far:
[Xi, Yi] = meshgrid(linspace(10,45),linspace(30,50));
vq = griddata(double(XLONGdata),double(XLATdata),double(ws),Xi,Yi);
axesm('MapProjection','lambert','MapLatLimit',[min(min(double(XLATdata))) max(max(double(XLATdata)))],'MapLonLimit',[min(min(double(XLONGdata))) max(max(double(XLONGdata)))],'Frame','on','Grid','on', 'MeridianLabel', 'on', 'ParallelLabel', 'on');
imagesc(linspace(10,45),linspace(30,50),vq, 'AlphaData', 0.85);
colormap 'jet';
xlabel('Longitude');
ylabel('Latitude');
colorbar
h = geoshow(Yi,Xi,vq,'DisplayType','surface','FaceColor', 'white','FaceAlpha',0,'linewidth',2);
h.ZData = zeros(size(h.XData));
p = geoshow('landareas.shp','FaceColor', 'white','FaceAlpha',0,'linewidth',2);
The lambert map appears as a small black dot compared to the weather map data(which appears with correct colors etc.) Thanks in advance. Edit: would it be useful to use contour plot?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Mapping Toolbox en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!