Skip to content
Permalink
6b5b84e197
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
112 lines (59 sloc) 2.38 KB
if(~isdeployed)
cd(fileparts(which(mfilename)));
end
DataPath = '.\';
AvailableFiles = dir((fullfile(DataPath, '*.csv'))); % list available data files
mapfig = figure;
animated(1,1,1, 25) = 0;
caxis([0 1]);
OpenFileName = "24HR_CBE_01.fig";
fig = openfig(OpenFileName);
lon = double( fig.Children.Children.XData);
lat = double(fig.Children.Children.YData);
close(gcf)
colour_option = questdlg("could you please choose one colour?", "Colour Map", "Non-Colour Blind", "Colour Blind","Non-Colour Blind");
if colour_map_option == "Colour-Blind"
cmap = ametrine(256);
colormap ametrine;
end
for idx = 1: size(AvailableFiles,1)
%OpenFileName = AvailableFiles(idx).name;
%fig = openfig(OpenFileName);
%Ozone = fig.Children.Children.ZData;
% close(gcf)
ozone = csvread(AvailableFiles(idx).name);
%POINTS = [LON(:), LAT(:), Ozone(:)];
worldmap('Europe');
load coastlines
plotm(coastlat, coastlon)
%plot the data
% setm(gca,'mapprojection','eqdcylin')
%cmap = ametrine(256);
%colormap morgenstemning;
colorbar
northarrow('latitude',53.270137,'longitude', -15.465583,'linewidth',1.5);
surfm( lat, lon ,ozone, "edgeColor" , "none", ...
"FaceAlpha", 0.5)
Land = shaperead("landareas",'UseGeoCoords', true);
% geoshow(gca, land, 'FaceColor', [0.5 0.7 0.5])
Lakes = shaperead('worldlakes', 'UseGeoCoords', true);
geoshow(Lakes, 'FaceColor', 'blue')
Rivers = shaperead('worldrivers', 'UseGeoCoords', true);
geoshow(Rivers, 'Color', 'blue')
cities = shaperead('worldcities', 'UseGeoCoords', true);
geoshow(cities, 'Marker', '.', 'Color', 'red')
Plots = findobj( gca, "Type", "Axes");
Plots.SortMethod = "depth";
frame = getframe(gcf);
if idx == 1
[animated, cmap] = rgb2ind(frame.cdata, 256, 'nodither');
else
animated(:,:,1,idx) = rgb2ind(frame.cdata, cmap, 'nodither');
end
%Name = strsplit(OpenFileName,'.');
%writematrix(Ozone, strcat(Name{1},'.csv'))
end
filename = "map.gif";
imwrite(animated, cmap, filename, 'DelayTime', 0.5, ...
'LoopCount', inf);
web(filename)