Skip to content
Permalink
Browse files
1.13
FINAL
  • Loading branch information
carvalh8 committed Jul 25, 2020
1 parent c0b5c72 commit 413897e31eedbdcaf101ae465613828d191c5e28
Showing 1 changed file with 117 additions and 118 deletions.
235 BigData.m
@@ -12,149 +12,148 @@ function display()
choose = 1; %bool value

if (choose == 1) %% Create a Menu and Choose one of the models
typechoosen = menu('Which model would you like to see?', 'Chimere', 'Emep', 'Ensemble', 'Eurad','Lotoseuros','Match','Mocage','Silam', 'Exit'); %% options that are shown in the menu.
typechoosen = menu('Which model would you like to see?', 'Chimere Model', 'Emep Model', 'Ensemble Model', 'Eurad Model','Lotoseuros Model','Match Model','Mocage Model','Silam Model', 'Exit'); %% options that are shown in the menu.
if typechoosen == 1
showtype = ('chimere_ozone');
titlechoice = 'chimere_ozone';
titlechoice = 'Chimere Figure';
elseif typechoosen == 2
showtype = ('emep_ozone');
titlechoice = 'emep_ozone';
titlechoice = 'Emep Figure';
elseif typechoosen == 3
showtype = ('ensemble_ozone');
titlechoice = 'ensemble_ozone';
titlechoice = 'Ensemble Figure';
elseif typechoosen == 4
showtype = ('eurad_ozone');
titlechoice = 'eurad_ozone';
titlechoice = 'Eurad Figure';
elseif typechoosen == 5
showtype = ('lotoseuros_ozone');
titlechoice = 'lotoseuros_ozone';
titlechoice = 'Lotoseuros Figure';
elseif typechoosen == 6
showtype = ('match_ozone');
titlechoice = 'match_ozone';
titlechoice = 'Match Figure';
elseif typechoosen == 7
showtype = ('mocage_ozone');
titlechoice = 'mocage_ozone';
titlechoice = 'Mocage Figure';
elseif typechoosen == 8
showtype = ('silam_ozone');
titlechoice = 'silam_ozone';
titlechoice = 'Silam Figure';
elseif typechoosen ==9
close all;
end
clc
clc;
end

clc;
ozone_end = ncread(ncfile, showtype); % reads one specific model from the combined file depending on the user choice in the menu above.
if typechoosen ~=9 %% advance if the choosen one is other than the 9
ozone_end = ncread(ncfile, showtype); % reads one specific model from the combined file depending on the user choice in the menu above.

longitude = ncread(ncfile,'lon'); %% longitude variable
latitude = ncread(ncfile,'lat'); %% latitude variable
time = ncread(ncfile,'hour'); %% time variable
timel = length(time)*10 ; %% length of the time variable
clc;
[X,Y] = meshgrid(longitude,latitude) ;
figure('Name', titlechoice,'NumberTitle','off'); %%formats the figure info shown
set(gcf, 'Position', get(0, 'Screensize')); %% fullscreen
clf;

uicontrol( 'Position', [30 140 180 40],'String','Exit','Callback',@(src,evnt)quit ); %Call the exit function if pressed
uicontrol( 'Position', [30 190 180 40],'String','Colour Blindness','Callback',@(src,evnt)colour_blindness); %Call the colour_blindness function if pressed
uicontrol( 'Position', [30 230 180 40],'String','Menu','Callback',@(src,evnt)menu_back); %Call the menu_back function if pressed
uicontrol( 'Position', [30 310 180 40],'String','Start/Restart','Callback',@(src,evnt)start); %Call the menu_back function if pressed
uicontrol( 'Position', [30 270 88 40],'String','Resume','Callback',@(src,evnt)resume); %Call the menu_back function if pressed
uicontrol( 'Position', [122 270 88 40],'String','Pause','Callback',@(src,evnt)wait); %Call the menu_back function if pressed

info = 1;
clc;


function start()
for i = 1:timel %% loop to run the graphics and menus according with the time lenght

map = pcolor(X,Y,ozone_end(:,:,i)') ; %% set the data on the map.
map.EdgeAlpha = 0;

ylabel('Longitude')
xlabel('Latitude')
clc;

cities = shaperead('worldcities', 'UseGeoCoords', true); %% shows cities
geoshow(cities, 'Marker', 'O', 'Color', 'red')

lakes = shaperead('worldlakes', 'UseGeoCoords', true); %% shows lakes
geoshow(lakes, 'FaceColor', 'blue')

rivers = shaperead('worldrivers', 'UseGeoCoords', true); %% shows rivers
geoshow(rivers, 'Color', 'blue')

borders('countries','black') %% shows all the borders

longitude = ncread(ncfile,'lon'); %% longitude variable
latitude = ncread(ncfile,'lat'); %% latitude variable
time = ncread(ncfile,'hour'); %% time variable
timel = length(time)*10 ; %% length of the time variable
clc;
choose = colorbar; % Colorbar that shows the Ozone level
choose.Label.String = 'Ozone Levels';
hold on


title(sprintf('Hour: %d',time(i))) %% Show the hours above the map.
clc;

pause(0.5)

[X,Y] = meshgrid(longitude,latitude) ;
figure('Name', titlechoice,'NumberTitle','off'); %%formats the figure info shown
set(gcf, 'Position', get(0, 'Screensize')); %% fullscreen
clf;

uicontrol( 'Position', [30 110 180 40],'String','Exit','Callback',@(src,evnt)quit ); %Call the exit function if pressed
uicontrol( 'Position', [30 160 180 40],'String','Colour Blindness','Callback',@(src,evnt)colour_blindness); %Call the colour_blindness function if pressed
uicontrol( 'Position', [30 200 180 40],'String','Menu','Callback',@(src,evnt)menu_back); %Call the menu_back function if pressed
uicontrol( 'Position', [30 290 180 40],'String','Start/Restart','Callback',@(src,evnt)start); %Call the menu_back function if pressed
uicontrol( 'Position', [30 250 88 40],'String','Resume','Callback',@(src,evnt)resume); %Call the menu_back function if pressed
uicontrol( 'Position', [122 250 88 40],'String','Pause','Callback',@(src,evnt)wait); %Call the menu_back function if pressed

info = 1;
clc;
end
end

function wait()
uiwait() %% Stops
end
function resume()
uiresume() %%Resumes
end
function quit()
close all %% Closes all windows

end
function colour_blindness() %% Menu to the color accessibility options
info = menu('Color Accessibility Options', 'Default', 'Protanopia','Deuteranopia','Tritanopia','Monochromacy');
if info == 1
colormap default; %% Default colors
elseif info == 2
colormap winter; %% Protanopia colors.
elseif info == 3
colormap cool; %% Deuteranopia colors.
elseif info == 4
colormap copper; %% Tritanopia colors.
elseif info == 5
colormap bone; %% Greyscale
end
clc;
end
function menu_back() %% Menu to change the model
typechoosen = menu('Which model would you like to see?', 'Chimere', 'Emep', 'Ensemble', 'Eurad','Lotoseuros','Match','Mocage','Silam'); %% options that are shown in the menu.
if typechoosen == 1
showtype = ('chimere_ozone');
titlechoice = 'chimere_ozone';
elseif typechoosen == 2
showtype = ('emep_ozone');
titlechoice = 'emep_ozone';
elseif typechoosen == 3
showtype = ('ensemble_ozone');
titlechoice = 'ensemble_ozone';
elseif typechoosen == 4
showtype = ('eurad_ozone');
titlechoice = 'eurad_ozone';
elseif typechoosen == 5
showtype = ('lotoseuros_ozone');
titlechoice = 'lotoseuros_ozone';
elseif typechoosen == 6
showtype = ('match_ozone');
titlechoice = 'match_ozone';
elseif typechoosen == 7
showtype = ('mocage_ozone');
titlechoice = 'mocage_ozone';
elseif typechoosen == 8
showtype = ('silam_ozone');
titlechoice = 'silam_ozone';

function start()
for i = 1:timel %% loop to run the graphics and menus according with the time lenght

map = pcolor(X,Y,ozone_end(:,:,i)') ; %% set the data on the map.
map.EdgeAlpha = 0;

ylabel('Longitude')
xlabel('Latitude')
clc;

cities = shaperead('worldcities', 'UseGeoCoords', true); %% shows cities
geoshow(cities, 'Marker', 'O', 'Color', 'red')

lakes = shaperead('worldlakes', 'UseGeoCoords', true); %% shows lakes
geoshow(lakes, 'FaceColor', 'blue')

rivers = shaperead('worldrivers', 'UseGeoCoords', true); %% shows rivers
geoshow(rivers, 'Color', 'blue')

borders('countries','black') %% shows all the borders

clc;
choose = colorbar; % Colorbar that shows the Ozone level
choose.Label.String = 'Ozone Levels';
hold on

title(sprintf('Hour: %d',time(i))) %% Show the hours above the map.
clc;

pause(0.5)
end
clc;
ozone_end = ncread(ncfile, showtype); % Reads one specific model from the combined file depending on the user choice in the menu above.
end

function wait()
uiwait()
end
function resume()
uiresume()
end
function quit()
close all % Closes all windows

end
function colour_blindness() %% Menu to the color accessibility options
info = menu('Color Accessibility Options', 'Default', 'Protanopia','Deuteranopia','Tritanopia','Monochromacy');
if info == 1
colormap default; %%default colors
elseif info == 2
colormap winter; %%Protanopia colors.
elseif info == 3
colormap cool; %%Deuteranopia colors.
elseif info == 4
colormap copper; %%Tritanopia colors.
elseif info == 5
colormap bone; %%Greyscale
end
clc;
end
function menu_back() %% Menu to change the model
typechoosen = menu('Which model would you like to see?', 'Chimere', 'Emep', 'Ensemble', 'Eurad','Lotoseuros','Match','Mocage','Silam'); %% options that are shown in the menu.
if typechoosen == 1
showtype = ('chimere_ozone');
titlechoice = 'chimere_ozone';
elseif typechoosen == 2
showtype = ('emep_ozone');
titlechoice = 'emep_ozone';
elseif typechoosen == 3
showtype = ('ensemble_ozone');
titlechoice = 'ensemble_ozone';
elseif typechoosen == 4
showtype = ('eurad_ozone');
titlechoice = 'eurad_ozone';
elseif typechoosen == 5
showtype = ('lotoseuros_ozone');
titlechoice = 'lotoseuros_ozone';
elseif typechoosen == 6
showtype = ('match_ozone');
titlechoice = 'match_ozone';
elseif typechoosen == 7
showtype = ('mocage_ozone');
titlechoice = 'mocage_ozone';
elseif typechoosen == 8
showtype = ('silam_ozone');
titlechoice = 'silam_ozone';
end

ozone_end = ncread(ncfile, showtype); % reads one specific model from the combined file depending on the user choice in the menu above.
end
end

0 comments on commit 413897e

Please sign in to comment.