Fast(er) High Resolution Blue Marble plot for Mapping Toolbox
6 次查看(过去 30 天)
显示 更早的评论
I need to plot weather data (LAT/LON specified) above Denmark using a satellite picture. I chose Blue Marble as it has worked perfectly for something like a stereographic with Greenland in focus, and it can be properly set up for longitude and latitude data. However a mercator projection for Denmark needs a higher resolution image, thus the image resolution will change (WIDTH= and HEIGHT= in DenmarkBlueMarbleURL). This however increases the runtime rather exponentially.
The following code is the problematic part from a larger project,
%%Plot data of Denmark (IN PROGRESS)
% Mapping Toolbox, somewhat working.
disp(' - Denmark')
% Get blue marble from NASA's neowms site.
% 1920*1080 seems to be the most appropiate resolution when it comes to
% both processing speed and resolution. Not enough for Denmark, however.
DenmarkBlueMarbleURL = 'http://neowms.sci.gsfc.nasa.gov/wms/wms?SERVICE=WMS&LAYERS=BlueMarbleNG&EXCEPTIONS=application/vnd.ogc.se_xml&FORMAT=image/jpeg&TRANSPARENT=FALSE&HEIGHT=6000&BGCOLOR=0xFFFFFF&REQUEST=GetMap&WIDTH=7200&BBOX=-180.0,-90.0,180.0,90.0&STYLES=&SRS=EPSG:4326&VERSION=1.1.1';
% A is the image, and R is the raster reference, "grid translation" I guess.
[A, R] = wmsread(DenmarkBlueMarbleURL);
FigDenmark = figure('Position', [100, 100, 1440, 900]);
% mercator projection
axesm('mercator', 'MapLatLimit', [52 70], 'MapLonLimit', [00 30])
% Will remove axis-constrained background
axis off;
% Plot blue marble.
geoshow(A, R);
% FaceAlpha will determine transparency
pcolorm(YM, XM, AuroraData, 'FaceAlpha', .5); shading flat;
% Use our own colourmap
colormap(AuroraColourmap);
caxis([0 100]) % AuroraData scale goes from 0 to 100.
ColourBarAurora = colorbar; ylabel(ColourBarAurora, 'Probability in percentage of visible aurora');
title(['Aurora forecast for ' datestr(CurrentTime, 'yyyy/mm/dd HHMM')]);
gridm;
drawnow
saveas(FigDenmark, 'CurrentDataPlot', 'tif');
It takes me about five minutes to run this section of the code. I believe the problem is geoshow(A,R), since everything goes fine until then, so this is the interesting part, ignore the AuroraData-dependent code. Also, if you change the latitude and longitude (i.e. to only fetch a map of Denmark) in the DenmarkBlueMarbleURL (BBOX=) it seems to take longer as well, so I always just fetch the whole map.
In short: Is there a faster way to use a blue marble plot to plot data on top?
1 个评论
Chad Greene
2016-6-8
Do you need to plot in map coordinates? What about simply,
imagesc(A)
Another option is to clip A to the lat,lon region of interest before calling geoshow. A 6000x7200 image will take a long time with geoshow, but it'll be much faster if you can only plot the values that are within your lat/lon range of interest.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Mapping Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!