From 6057c8ed283c3ce2c38c7131c6cd4faa8ebdd4f7 Mon Sep 17 00:00:00 2001 From: Adrian Date: Mon, 10 Aug 2020 04:09:12 +0300 Subject: [PATCH] added useful comments --- Visualisation.m | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/Visualisation.m b/Visualisation.m index 4c9930d..6c73eea 100644 --- a/Visualisation.m +++ b/Visualisation.m @@ -1,10 +1,13 @@ +%%Open NetCDF files filename = 'o3_surface_20180701000000.nc'; clc; +%%Information about software disp('This software allows you to visualise the ozone layer on the European Map') disp('This software provides support for colour blind users.') pause(2) clc +%%User choose what map model wants to see disp('Pick 1 of the 8 ozone map models') disp('1: Chimere map model') disp('2: Emep map model') @@ -51,14 +54,16 @@ elseif modelChoice == 8 end clc; +%%Read data from NetCDF file disp('Loading data in progress') -lon = ncread(ncfile,'lon'); -lat = ncread(ncfile,'lat'); -h = ncread(ncfile,'hour'); -ozoneChoice = ncread(ncfile,ozoneModel); -[X,Y] = meshgrid(lon,lat); +lon = ncread(ncfile,'lon'); %%assign the longtitude +lat = ncread(ncfile,'lat'); %%assign the latitude +h = ncread(ncfile,'hour'); %%assign the hours +ozoneChoice = ncread(ncfile,ozoneModel); %%it takes the user map model +[X,Y] = meshgrid(lon,lat); %%create meshgrid with data clc; +%%Colour blinds issues menu disp('If you have colourblind please choose what type:') disp('1.Protanopia') disp('2.Deuteranopia') @@ -66,6 +71,7 @@ disp('3.Tritanopia') disp('0.I do not have') colourblind = input('Enter: ') +%%Colour the map with the user input if colourblind == 0 colormap default elseif colourblind == 1 @@ -79,16 +85,17 @@ end clc disp('The map in the figure will load shortly ..') +%%Loops through the hours for k = 1 : length(h) - clf; - matrix = pcolor(X,Y,ozoneChoice(:,:,k)'); + clf; %%clear figure + matrix = pcolor(X,Y,ozoneChoice(:,:,k)'); %%assign the data matrix.EdgeAlpha = 0; matrix.FaceAlpha = 0.8; - load coast - cities = shaperead('worldcities', 'UseGeoCoords', true); - bar = colorbar; + load coast %%load coastlines + cities = shaperead('worldcities', 'UseGeoCoords', true);%%load cities + bar = colorbar; %%legend to know the value of the ozone bar.Label.String = 'Ozone Level'; - geoshow(cities, 'Marker', '+', 'Color', 'red') + geoshow(cities, 'Marker', '+', 'Color', 'red') %%cities on the map hold on; plot(long,lat,'k') title(sprintf('Ensemble Data on Europe'))