Skip to content
Permalink
Browse files
Update compare.m
compare.m file modified to include visualization code provided by my module leader on moodle. This code has been modified to produce two heatmap figures one for the CBE-SE and for the SE-CBE to produce CBE-SE.fig and SE-CBE.fig seen in the project.
  • Loading branch information
mirikip committed Aug 13, 2020
1 parent 586c069 commit 0538fc672db129cd3c3e73237d4a04adf971aa87
Showing 1 changed file with 68 additions and 1 deletion.
@@ -5,4 +5,71 @@ SEdata = simpleEnsemble();
CBEdata = CBE();

%subtract CBEdata from SEdata
ensembleCompare = SEdata - CBEdata;
ensembleCompare = CBEdata - SEdata;
compareEnsemble = SEdata - CBEdata;

%use visualization code provided on moodle to visualize the results of the
%ensemble comparison

%%
% Create some data
[X] = 30.25:0.1:69.95; % create X value
[Y] = -24.75:0.1:44.95;% create Y values
% create a mesh of values
Z = ensembleCompare( 1:698, 1:398, 1:1); %extract array from matrix

%% Create a display of the data from the NetCDF files like this
[X,Y] = meshgrid(X, Y);

figure(2);
clf
% Create the map
worldmap('Europe'); % set the part of the earth to show

load coastlines
plotm(coastlat,coastlon)

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')

% Plot the data
surfm(X, Y, Z, 'EdgeColor', 'none',...
'FaceAlpha', 0.5) % edge colour outlines the edges, 'FaceAlpha', sets the transparency

%% Plot contour map
% [X,Y] = meshgrid(X, Y); % this calculation has been carried out above
% already
Z = compareEnsemble( 1:698, 1:398, 1:1); %extract array from matrix

figure(3);
clf
% Create the map
worldmap('Europe'); % set the part of the earth to show

load coastlines
plotm(coastlat,coastlon)

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')

% Plot the data
surfm(X, Y, Z, 'EdgeColor', 'none',...
'FaceAlpha', 0.5) % edge colour outlines the edges, 'FaceAlpha', sets the transparency

0 comments on commit 0538fc6

Please sign in to comment.