Permalink
Cannot retrieve contributors at this time
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?
5011CEM-visualisation/VisualisationMap.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
91 lines (87 sloc)
2.58 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%Open NetCDF files | |
file_nc = 'o3_surface_20180701000000.nc'; | |
clc; | |
disp('This software allows user to look over an European Map and analyse the ozone layer.') | |
disp('Colorblind support:') | |
disp('If you are having problems with color please choose one of the options: 1.Deuteranopia, 2.Tritanopia, 3.Protanopia, 0. For none') | |
colorcorrection = input('Enter: ') | |
%%Colour the map with the user input | |
if colorcorrection == 0 | |
colormap default | |
elseif colorcorrection == 1 | |
colormap winter | |
elseif colorcorrection == 2 | |
colormap autumn | |
elseif colorcorrection == 3 | |
colormap spring | |
end | |
clc | |
%%Option for user to choose which model to see | |
disp('Choose a model you wish to see : 1. Mocage map model, 2. Eurad map model, 3. Match map model, 4. Emep map model, 5. Silam map model, 6. Ensemble map model, 7. Chimere map model, 8. Lotoseuros map model') | |
userInput = input('Choose one of the available models: ') | |
if userInput == 1 | |
model = 'mocage_ozone' | |
clc; | |
disp("You choose mocage") | |
pause(1) | |
elseif userInput == 2 | |
model = 'eurad_ozone' | |
clc; | |
disp("You choose eurad") | |
pause(1) | |
elseif userInput == 3 | |
model = 'match_ozone' | |
clc; | |
disp("You choose match") | |
pause(1) | |
elseif userInput == 4 | |
model = 'emep_ozone' | |
clc; | |
disp("You choose emap") | |
pause(1) | |
elseif userInput == 5 | |
model = 'silam_ozone' | |
clc; | |
disp("You choose silam") | |
pause(1) | |
elseif userInput == 6 | |
model = 'ensemble_ozone' | |
clc; | |
disp("You choose ensemble") | |
pause(1) | |
elseif userInput == 7 | |
model = 'chimere_ozone' | |
clc; | |
disp("You choose chimere") | |
pause(1) | |
elseif userInput == 8 | |
model = 'lotoseuros_ozone' | |
clc; | |
disp("You choose lotoseuros") | |
pause(1) | |
end | |
clc; | |
%%Assign data from the file | |
lon = ncread(file_nc,'lon'); %%data for longtitude | |
lat = ncread(file_nc,'lat'); %%data for latitude | |
hour = ncread(file_nc,'hour'); %%data for hours | |
modeldata = ncread(file_nc,model); %%takes user input model | |
[X,Y] = meshgrid(lon,lat); %%meshgrid with data | |
clc; | |
disp('Map is processed') | |
%%Loops through the hours | |
for i = 1 : length(hour) | |
clf; %%clear figure | |
map = pcolor(X,Y,modeldata(:,:,i)'); %%assign the data | |
map.EdgeAlpha = 0; | |
map.FaceAlpha = 0.8; | |
load coast %%load the coastlines | |
cities = shaperead('worldcities', 'UseGeoCoords', true);%%load the cities | |
legendmap = colorbar; %%colorbar for the values of ozone | |
legendmap.Label.String = 'Level of Ozone'; | |
geoshow(cities, 'Marker', '+', 'Color', 'red') %%cities on the map | |
hold on; | |
plot(long,lat,'k') | |
title(sprintf('Visualise the Ensemble Data on Europe')) | |
pause(1) | |
end | |