Skip to content
Permalink
master
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
clear
clc
DataPath = '.\';
AvailableFiles = dir((fullfile(DataPath, '*.csv'))); % list available data files
lt_array = csvread('Lat.csv');
lg_array = csvread('Lon.csv');
for idxFile=1:24
figure(1)
File2Read = AvailableFiles(idxFile).name;
ozone_array =csvread(File2Read);
hPlot = subplot(4,6,idxFile);
X = lt_array(1,:);
Y = lg_array(:,1);
mesh(X, Y, ozone_array);
hPlot.Position = hPlot.Position + [-0.01 -0.01 +0.03 +0.03];
contourcbar
end
%% Create a display of the data from the NetCDF files like this
%[X,Y] = meshgrid(X, Y);
for idxFile=1 : 24
figure(2)
File2Read = AvailableFiles(idxFile).name;
ozone_array =csvread(File2Read);
hPlot = subplot(4,6,idxFile);
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(Y, X, ozone_array, 'EdgeColor', 'none',...
'FaceAlpha', 0.5) % edge colour outlines the edges, 'FaceAlpha', sets the transparency
hPlot.Position = hPlot.Position + [-0.01 -0.01 +0.03 +0.03];
contourcbar
end
%% Plot contour map
% [X,Y] = meshgrid(X, Y); % this calculation has been carried out above
% already
for idxFile=1 : 24
figure(3);
File2Read = AvailableFiles(idxFile).name;
ozone_array =csvread(File2Read);
hPlot = subplot(4,6,idxFile);
% 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.25 0.5 0.25])
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')
contourcbar
%
lat_figure3 = lt_array(1, 1:5:698);
lon_figure3 = lg_array(1:5:398,1);
oz_figure3 = ozone_array(1:5:398, 1:5:698);
% display the data
NumContours = 10;
contourfm(lon_figure3, lat_figure3, oz_figure3, NumContours)
% This is a bit advanced, sets the visibility of the various parts of the
% plot so the land, cities etc shows through.
Plots = findobj(gca,'Type','Axes');
Plots.SortMethod = 'depth';
hPlot.Position = hPlot.Position + [-0.01 -0.01 +0.03 +0.03];
end