Skip to content
Permalink
dc31c80803
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
79 lines (68 sloc) 2.2 KB
%%
ncfile = 'o3_surface_20180701000000.nc';
&ncinfo(fileName) %- gives info on nc file
ncdisp(fileName) % displays nc file
%%select a ozone map of your choice
disp('1: emep ozone map')
disp('2: chimere ozone map')
disp('3: ozone map')
disp('4: lotoseuros ozone map')
disp('5: eurad ozone map')
disp('6: ensemble ozone map')
disp('7: silam ozone map')
disp('8: mocage ozone map')
selected_map = input('Select ozone map')
if selected_map == 1
select = 'emep_ozone'
elseif selected_map == 2
select = 'chimere_ozone'
elseif selected_map == 3
select = 'match_ozone'
elseif selected_map == 4
select = 'lotoseuros_ozone'
elseif selected_map == 5
select = 'eurad_ozone'
elseif selected_map == 6
select = 'ensemble_ozone'
elseif selected_map == 7
select = 'silam_ozone'
elseif selected_map == 8
select = 'mocage_ozone'
end
X = ncread(ncfile, 'lat');
Y = ncread(ncfile, 'lon');
time = ncread(ncfile, 'hour');
selection = ncread(ncfile, select);
chimere_ozone = ncread(ncfile, "chimere_ozone");
%colour blindness selection
disp('Do you require colourblind assistance?')
cBlind = input('input 1 for yes or 2 for no')
if cBlind == 1
colormap bone;
elseif cBlind == 2
colormap default;
end
%% Create a display of the data from the NetCDF files like this
figure(2);
clf
%
for i = 1:length(time)
Z = chimere_ozone(:,:,i);
% 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(double(X), double(Y), double(Z), 'EdgeColor', 'none',...
'FaceAlpha', 0.5) % edge colour outlines the edges, 'FaceAlpha', sets the transparency
title(sprintf('Current time: %.0f', time(i)));
pause(0.05)
end