Skip to content
Permalink
Browse files
added the files to the github
these are the accessible files to visualisation
  • Loading branch information
jayakank committed Apr 24, 2020
1 parent 3dea710 commit 224b60f6e7effdd2b1297f049ffcf78400063a08
Show file tree
Hide file tree
Showing 9 changed files with 1,319 additions and 0 deletions.
@@ -0,0 +1,35 @@
if(~isdeployed)
cd(fileparts(which(mfilename)));
end
DataPath = '.\';
AvailableFiles = dir((fullfile(DataPath, '*.fig'))); % list available data files

% for idx = 1: size(AvailableFiles,1)
% OpenFileName = AvailableFiles(idx).name;
% fig = openfig(OpenFileName);
% Ozone = fig.Children.Children.ZData;
%
% Name = strsplit(OpenFileName,'.');
% writematrix(Ozone, strcat(Name{1},'.csv'))
% close all
% end

OpenFileName = AvailableFiles(1).name;
fig = openfig(OpenFileName);
lat = fig.Children.Children.XData;
lon = fig.Children.Children.YData;


writematrix(lat,'Lat.csv')
writematrix(lon,'Lon.csv')

%loop through pictures
for idx = 1: size(AvailableFiles,25)
OpenFileName = AvailableFiles(25).name;
fig = openfig(OpenFileName);
ozone_array = fig.Children.Children.ZData;
lt_array = fig.Children.Children.XData;
lg_array = fig.Children.Children.YData;
%writematrix(Ozone, strcat(Name{1},'.csv'))
close all
end
@@ -0,0 +1,24 @@
if(~isdeployed)
cd(fileparts(which(mfilename)));
end
DataPath = '.\';
AvailableFiles = dir((fullfile(DataPath, '*.fig'))); % list available data files

% for idx = 1: size(AvailableFiles,1)
% OpenFileName = AvailableFiles(idx).name;
% fig = openfig(OpenFileName);
% Ozone = fig.Children.Children.ZData;
%
% Name = strsplit(OpenFileName,'.');
% writematrix(Ozone, strcat(Name{1},'.csv'))
% close all
% end

OpenFileName = AvailableFiles(1).name;
fig = openfig(OpenFileName);
lat = fig.Children.Children.XData;
lon = fig.Children.Children.YData;


writematrix(lat,'Lat.csv')
writematrix(lon,'Lon.csv')
398 Lat.csv

Large diffs are not rendered by default.

398 Lon.csv

Large diffs are not rendered by default.

@@ -0,0 +1,98 @@
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
colourblind1(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
colormap(jet)
colormap(autumn)
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
@@ -0,0 +1,99 @@
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
colormap(hsv)

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
colormap(hsv)
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
colormap(hsv)

%
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
@@ -0,0 +1,75 @@
%%
% Create some data
[X] = 30.05:0.1:69.95; % create X value
[Y] = -24.95:0.1:44.95;% create Y values
% create a mesh of values
Z = peaks(700);
Z = Z(:,151:550);
% Display the raw data
figure(1)
mesh(X,Y,Z)
% The data you will have from the NetCDF files will be X, Y and Z where
% X & Y are the Lat and Lon values in a vector form
% Z represents the ozone in a 2D array
% The data provided here as X, Y, Z is in the corresponding formats.


%% 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

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

% display the data
NumContours = 10;
contourfm(X, Y, Z, 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';

0 comments on commit 224b60f

Please sign in to comment.