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_Project/Compare_Hour.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
326 lines (283 sloc)
12.8 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
clc | |
fprintf(" 1 to visualise one of the seven models,\n") | |
fprintf(" 2 to compare model figures,\n") | |
fprintf(" 3 to compare the ozone layer between 2 different hours of the same model\n") | |
fprintf(" and\n 0 to exit.\n") | |
ok=input("input:"); | |
while ok<0 || ok>3 | |
if ok==0 | |
fprintf("over\n") | |
break | |
end | |
clc | |
fprintf("error!\n") | |
fprintf(" 1 to visualise one of the seven models,\n") | |
fprintf(" 2 to compare model figures,\n") | |
fprintf(" 3 to compare the ozone layer between 2 different hours of the same model\n") | |
fprintf(" and\n 0 to exit.\n") | |
ok=input("input: 1 to visualise one of the seven models,\n 2 to compare model figures,\n 3 to compare the ozone layer between 2 different hours of the same model\n and\n 0 to exit:"); | |
end | |
while ok>=1 && ok<=3 | |
ncFilelList=["Individual_Models\W_fr-meteofrance,MODEL,SILAM+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc",... | |
"Individual_Models\W_fr-meteofrance,MODEL,MATCH+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc",... | |
"Individual_Models\W_fr-meteofrance,MODEL,ENSEMBLE+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc",... | |
"Individual_Models\W_fr-meteofrance,MODEL,CHIMERE+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc",... | |
"Individual_Models\W_fr-meteofrance,MODEL,EURAD+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc",... | |
"Individual_Models\W_fr-meteofrance,MODEL,MOCAGE+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc",... | |
"Individual_Models\W_fr-meteofrance,MODEL,EMEP+FORECAST+SURFACE+O3+0H24H_C_LFPW_20180701000000.nc"]; | |
meteoModelTitleList=["Meteorologic Model: Silam","Meteorologic Model:Match","Meteorologic Model:Ensemble",... | |
"Meteorologic Model:Chimere","Meteorologic Model:Eurad","Meteorologic Model:Mokage","Meteorologic Model:Emep"]; | |
if ok==0 | |
clc | |
fprintf("over\n") | |
break | |
end | |
%% | |
if ok==3 | |
clc | |
fnum=input("choose kind of fig:1-mesh 2-map 3-countour_map || 0-go back:"); | |
while fnum<0 || fnum>3 | |
fprintf("input again\n") | |
fnum=input("choose kind of fig:1-mesh 2-map 3-countour_map || 0-go back:"); | |
if fnum==0 | |
clc | |
fprintf("exit\n") | |
break | |
end | |
end | |
while fnum>=1 && fnum<=3 | |
if fnum~=0 | |
h1=input("input an integer between 0 and 26 representing 1 of the 25 hours:"); | |
while h1>25 || h1<1 | |
fprintf("input again\n") | |
h1=input("input an integer between 0 and 26 representing 1 of the 25 hours:"); | |
end | |
h2=input("input a second integer between 0 and 26 representing 1 of the 25 hours:"); | |
while h2>25 || h2<1 | |
clc | |
fprintf("input again\n") | |
h2=input("input an integer between 0 and 26 representing 1 of the 25 hours:"); | |
end | |
end | |
if fnum==1 | |
clc | |
fprintf("1=Meteorologic Model Silam\n") | |
fprintf("2=Meteorologic Model Match\n") | |
fprintf("3=Meteorologic Model Ensemble\n") | |
fprintf("4=Meteorologic Model Chimere\n") | |
fprintf("5=Meteorologic Model Eurad\n") | |
fprintf("6=Meteorologic Model Mocage\n") | |
fprintf("7=Meteorologic Model Emep\n") | |
m1=input("File:"); | |
while m1<1 || m1>7 | |
clc | |
fprintf("error \n") | |
fprintf("1=Meteorologic Model Silam\n") | |
fprintf("2=Meteorologic Model Match\n") | |
fprintf("3=Meteorologic Model Ensemble\n") | |
fprintf("4=Meteorologic Model Chimere\n") | |
fprintf("5=Meteorologic Model Eurad\n") | |
fprintf("6=Meteorologic Model Mocage\n") | |
fprintf("7=Meteorologic Model Emep\n") | |
m1=input("File:"); | |
end | |
for i = 1:length(ncFilelList) | |
if i==m1 | |
pnc1=ncFilelList(i); | |
t1=meteoModelTitleList(i); | |
end | |
end | |
y = double(ncread(pnc1,'longitude')); | |
zlabel('ozone') | |
x = double(ncread(pnc1,'latitude')); | |
time = ncread(pnc1,'time'); | |
ozone = ncread(pnc1,'unknown'); | |
figure(1) | |
clf | |
z1 = ozone(:,:,h1); | |
title(t1) | |
mesh(x,y,z1) | |
figure(2) | |
clf | |
z2 = ozone(:,:,h2); | |
title(t1) | |
mesh(x,y,z2) | |
end | |
if fnum==2 | |
clc | |
fprintf("1=Meteorologic Model Silam\n") | |
fprintf("2=Meteorologic Model Match\n") | |
fprintf("3=Meteorologic Model Ensemble\n") | |
fprintf("4=Meteorologic Model Chimere\n") | |
fprintf("5=Meteorologic Model Eurad\n") | |
fprintf("6=Meteorologic Model Mocage\n") | |
fprintf("7=Meteorologic Model Emep\n") | |
m1=input("File:"); | |
while m1<1 || m1>7 | |
clc | |
fprintf("error \n") | |
fprintf("1=Meteorologic Model Silam\n") | |
fprintf("2=Meteorologic Model Match\n") | |
fprintf("3=Meteorologic Model Ensemble\n") | |
fprintf("4=Meteorologic Model Chimere\n") | |
fprintf("5=Meteorologic Model Eurad\n") | |
fprintf("6=Meteorologic Model Mocage\n") | |
fprintf("7=Meteorologic Model Emep\n") | |
m1=input("File:"); | |
end | |
for i = 1:length(ncFilelList) | |
if i==m1 | |
pnc1=ncFilelList(i); | |
t1=meteoModelTitleList(i); | |
end | |
end | |
y = double(ncread(pnc1,'longitude')); | |
zlabel('ozone') | |
x = double(ncread(pnc1,'latitude')); | |
time = ncread(pnc1,'time'); | |
ozone = ncread(pnc1,'unknown'); | |
[x,y] = meshgrid(x, y); | |
figure(3) | |
clf | |
title(t1) | |
z1 = ozone(:,:,h1); | |
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', 'EdgeColor', 'cyan') | |
rivers = shaperead('worldrivers', 'UseGeoCoords', true); | |
geoshow(rivers, 'Color', 'blue') | |
cities = shaperead('worldcities', 'UseGeoCoords', true); | |
geoshow(cities, 'Marker', 'hexagram', 'Color', 'green') | |
setm(gca,'ffacecolor','#0072BD') | |
surfm(x,y,z1, 'EdgeColor', 'none','FaceAlpha', 0.6) | |
figure(4) | |
clf | |
title(t1) | |
z2 = ozone(:,:,h2); | |
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', 'EdgeColor', 'cyan') | |
rivers = shaperead('worldrivers', 'UseGeoCoords', true); | |
geoshow(rivers, 'Color', 'blue') | |
cities = shaperead('worldcities', 'UseGeoCoords', true); | |
geoshow(cities, 'Marker', 'hexagram', 'Color', 'green') | |
setm(gca,'ffacecolor','#0072BD') | |
surfm(x,y,z2, 'EdgeColor', 'none','FaceAlpha', 0.6) | |
end | |
if fnum==3 | |
clc | |
fprintf("1=Meteorologic Model Silam\n") | |
fprintf("2=Meteorologic Model Match\n") | |
fprintf("3=Meteorologic Model Ensemble\n") | |
fprintf("4=Meteorologic Model Chimere\n") | |
fprintf("5=Meteorologic Model Eurad\n") | |
fprintf("6=Meteorologic Model Mocage\n") | |
fprintf("7=Meteorologic Model Emep\n") | |
m1=input("File:"); | |
while m1<1 || m1>7 | |
clc | |
fprintf("error \n") | |
fprintf("1=Meteorologic Model Silam\n") | |
fprintf("2=Meteorologic Model Match\n") | |
fprintf("3=Meteorologic Model Ensemble\n") | |
fprintf("4=Meteorologic Model Chimere\n") | |
fprintf("5=Meteorologic Model Eurad\n") | |
fprintf("6=Meteorologic Model Mocage\n") | |
fprintf("7=Meteorologic Model Emep\n") | |
m1=input("File:"); | |
end | |
NumContours = 5; | |
for i = 1:length(ncFilelList) | |
if i==m1 | |
pnc1=ncFilelList(i); | |
t1=meteoModelTitleList(i); | |
end | |
end | |
y = double(ncread(pnc1,'longitude')); | |
zlabel('ozone') | |
x = double(ncread(pnc1,'latitude')); | |
time = ncread(pnc1,'time'); | |
ozone = ncread(pnc1,'unknown'); | |
[x,y] = meshgrid(x, y); | |
figure(5) | |
clf | |
title(t1) | |
z1 = ozone(:,:,h1); | |
worldmap('Europe'); % set the part of the earth to show | |
load coastlines | |
plotm(coastlat,coastlon) | |
%bordersm('countries','FaceColor', [0.5 0.7 0.5]) | |
setm(gca,'ffacecolor','#0072BD') | |
land = shaperead('landareas', 'UseGeoCoords', true); | |
geoshow(gca, land, 'FaceColor', [0.5 0.7 0.5]) | |
lakes = shaperead('worldlakes', 'UseGeoCoords', true); | |
geoshow(lakes, 'FaceColor', 'blue', 'EdgeColor', 'cyan') | |
rivers = shaperead('worldrivers', 'UseGeoCoords', true); | |
geoshow(rivers, 'Color', 'blue') | |
cities = shaperead('worldcities', 'UseGeoCoords', true); | |
geoshow(cities, 'Marker', 'hexagram', 'Color', 'green') | |
contourfm(x, y, z1, NumContours,'r') | |
Plots = findobj(gca,'Type','Axes'); | |
Plots.SortMethod = 'depth'; | |
figure(6) | |
clf | |
title(t1) | |
z2 = ozone(:,:,h2); | |
worldmap('Europe'); % set the part of the earth to show | |
load coastlines | |
plotm(coastlat,coastlon) | |
%bordersm('countries','FaceColor', [0.5 0.7 0.5]) | |
setm(gca,'ffacecolor','#0072BD') | |
land = shaperead('landareas', 'UseGeoCoords', true); | |
geoshow(gca, land, 'FaceColor', [0.5 0.7 0.5]) | |
lakes = shaperead('worldlakes', 'UseGeoCoords', true); | |
geoshow(lakes, 'FaceColor', 'blue', 'EdgeColor', 'cyan') | |
rivers = shaperead('worldrivers', 'UseGeoCoords', true); | |
geoshow(rivers, 'Color', 'blue') | |
cities = shaperead('worldcities', 'UseGeoCoords', true); | |
geoshow(cities, 'Marker', 'hexagram', 'Color', 'green') | |
contourfm(x, y, z2, NumContours,'r') | |
Plots = findobj(gca,'Type','Axes'); | |
Plots.SortMethod = 'depth'; | |
end | |
fnum=input("choose kind of fig:1-mesh 2-map 3-countour_map || 0-go back:"); | |
while fnum<0 || fnum>3 | |
fprintf("input again\n") | |
fnum=input("choose kind of fig:1-mesh 2-map 3-countour_map || 0-go back:"); | |
if fnum==0 | |
fprintf("exit\n") | |
break | |
end | |
end | |
end | |
end | |
%% | |
clc | |
fprintf(" 1 to visualise one of the seven models,\n") | |
fprintf(" 2 to compare model figures,\n") | |
fprintf(" 3 to compare the ozone layer between 2 different hours of the same model\n") | |
fprintf(" and\n 0 to exit.\n") | |
ok=input("input:"); | |
while ok<0 || ok>3 | |
if ok==0 | |
fprintf("over\n") | |
break | |
end | |
clc | |
fprintf("error!\n") | |
fprintf(" 1 to visualise one of the seven models,\n") | |
fprintf(" 2 to compare model figures,\n") | |
fprintf(" 3 to compare the ozone layer between 2 different hours of the same model\n") | |
fprintf(" and\n 0 to exit.\n") | |
ok=input("input:"); | |
end | |
end | |
clc |