Files
matlab-python/ATD/report_CrossGraphs_ENG.m

1499 lines
75 KiB
Matlab
Executable File

function [Site,FIG] = report_CrossGraphs_ENG(rTL,rIPL,rTuL,rRaL,rPCL,rPL,rRL,rKL,rCrL,rMPBEL,...
GI_Disp_TL,GI_Date_TL,GI_Prof_TL,GI_Disp_IPL,GI_Date_IPL,GI_Prof_IPL,...
GI_Level_PL,GI_Prof_PL,GI_Date_PL,GI_Rain_RL,GI_Date_RL,GI_Angolo_KL,...
GI_Num_KL,GI_Date_KL,GI_Disp_CrL,GI_Num_CrL,GI_Date_CrL,GI_Q1_TuL,...
GI_Q2_TuL,GI_Q3_TuL,GI_Q4_TuL,GI_Q1_Num_TuL,GI_Q2_Num_TuL,GI_Q3_Num_TuL,...
GI_Q4_Num_TuL,GI_Z_TuL,GI_Seg_TuL,GI_NumSeg_TuL,GI_Date_TuL,GI_Z_PCL,GI_Date_PCL,...
GI_XYZ_Rad,GI_Num_Rad,GI_dS_RL_MPB,GI_dS_RL_TuL,GI_dS_TuL_RL,GI_Date_Rad,...
GI_Date_MPB,GI_dS_MPB,GI_MPB_Base,GI_dS_MPB_RL,siteID,toolrif,chainID,Font_Chapter,...
Font_caption,Font_tools,m,rAR,br,FIG,DT,FileName)
import mlreportgen.dom.*
import mlreportgen.report.*
% Make sure DOM is compilable
makeDOMCompilable()
%% --- TILT LINK + PIEZO LINK ---
% Tilt Link V + Piezo Link : Spostamento massimo locale vs Falda
if rTL(m,1) > 0 && rPL(m,1) > 0 && exist( 'GI_Disp_TL','var')
if isempty(GI_Level_PL(:,m)) == 0 && GI_Date_PL(1,m) ~= 0 && isempty(GI_Disp_TL(:,m)) == 0 && GI_Date_TL(1,m) ~= 0
ind_PL = find(GI_Date_PL(:,m));
ind_TL = find(GI_Date_TL(:,m));
sezGrafTLvsPL = Paragraph('Correlation between sensors - Tilt Link vs Piezo Link');
sezGrafTLvsPL.Style = {FontSize(Font_tools),Bold(1),Italic(1)};
GI_VarFaldaPL = GI_Level_PL(:,m)-GI_Level_PL(1,m);
figure(21)
yyaxis left
GI_TiltLink = plot(GI_Date_TL(1:ind_TL(end),m),GI_Disp_TL(1:ind_TL(end),m),'Color','red');
set(gca,'YColor','k')
if max(GI_Disp_TL(:,m)) < 10
ylim([-inf 10]);
end
ylabel('Displacement [mm]');
yyaxis right
GI_PiezoLink = plot(GI_Date_PL(1:ind_PL(end),m),GI_VarFaldaPL(1:ind_PL(end)),':','Color','blue');
var = max(abs(GI_VarFaldaPL(1:ind_PL(end))));
media = mean(GI_VarFaldaPL(1:ind_PL(end)));
if var < 1
ylim([media-0.5 media+0.5]);
end
ylabel('Water level variation [m]');
set(gca,'YColor','k')
title('Correlation between displacements and water level variation');
xlabel('Date [dd/mm/yyyy]');
h = gca;
h.XAxis.MinorTick = 'on';
datetick('x','dd/mm/yyyy','keepticks','keeplimits');
xtickangle(20);
yyaxis left
lgdTL = (['Displacement (' num2str(GI_Prof_TL(1,m)) ' m)']);
lgdPL = ('Water level variation [m]');
str(1,1) = {['Displacement (' num2str(GI_Prof_TL(1,m)) ' m)']};
str(2,1) = {'Water level variation'};
lgd = legend(lgdTL,lgdPL, 'Location','north');
numcolumns = 2;
[legend_h,object_h,plot_h,text_strings] = columnlegend(numcolumns,str);
clear str
testoTLvsPL = Paragraph(['The following graph aims to highlight any possible correlation '...
'between the water level variation and displacements recorded by Tilt Link sensors. ' ...
'In particular, with respect to the reference time period, sensors considered for this analysis '...
'include the Tilt Link that recorded the highest local differential displacement '...
'and the piezometer that measured the largest water level variation (if the Array '...
'equips a single piezometer, water level data will refer to the only sensor available).']);
testoTLvsPL2 = Paragraph(['In this case, displacements included in the chart refers to the Tilt Link '...
'located at ' num2str(-(GI_Prof_TL(1,m))) ' m of depth, '...
'while the water level variation over time derives from the piezometer '...
'installed at ' num2str((GI_Prof_PL(1,m))) ' metres below ground level.']);
TempName = char(strcat('Report',siteID,'-', char(toolrif),'-TLvsPL_ENG.png'));
saveas(GI_PiezoLink,TempName);
ChartTLvsPL = Image(TempName);
ChartTLvsPL.Style = {ScaleToFit};
ChartTLvsPL_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison between water level variation and '...
'maximum local differential displacement during the reference time period']);
FIG = FIG+1;
ChartTLvsPL_cap.Style = {HAlign('justify'),FontSize(Font_caption),Italic(1),Color('midnightblue')};
testoTLvsPL.HAlign = 'justify';
testoTLvsPL2.HAlign = 'justify';
add(DT,sezGrafTLvsPL);
add(DT,testoTLvsPL);
add(DT,testoTLvsPL2);
add(DT,ChartTLvsPL);
add(DT,ChartTLvsPL_cap);
add(DT,br);
close(figure(21));
% pulisco variabili da riutilizzare per catena successiva
clear GI_VarFaldaPL;
end
end
%% --- IN PLACE LINK + PIEZO LINK ---
% In Place Link + Piezo Link : Spostamento massimo locale vs Falda
if rIPL(m,1) > 0 && rPL(m,1) > 0 && exist( 'GI_Disp_IPL','var')
if isempty(GI_Level_PL(:,m)) == 0 && GI_Date_PL(1,m) ~= 0 && ...
isempty(GI_Disp_IPL(:,m)) == 0 && GI_Date_IPL(1,m) ~= 0
ind_PL = find(GI_Date_PL(:,m));
ind_IPL = find(GI_Date_IPL(:,m));
sezGrafIPLvsPL = Paragraph('Correlation between sensors - In Place Link vs Piezo Link');
sezGrafIPLvsPL.Style = {FontSize(Font_tools),Bold(1),Italic(1)};
GI_VarFaldaPL = GI_Level_PL(:,m)-GI_Level_PL(1,m);
figure(21)
yyaxis left
GI_InPlaceLink = plot(GI_Date_IPL(1:ind_IPL(end),m),GI_Disp_IPL(1:ind_IPL(end),m),'Color','red');
set(gca,'YColor','k')
if max(GI_Disp_IPL(:,m)) < 10
ylim([-inf 10]);
end
ylabel('Displacement [mm]');
yyaxis right
GI_PiezoLink = plot(GI_Date_PL(1:ind_PL(end),m),GI_VarFaldaPL(1:ind_PL(end)),':','Color','blue');
var = max(abs(GI_VarFaldaPL(1:ind_PL(end))));
media = mean(GI_VarFaldaPL(1:ind_PL(end)));
if var < 1
ylim([media-0.5 media+0.5]);
end
ylabel('Water level variation [m]');
set(gca,'YColor','k')
title('Correlation between displacements and water level variation');
xlabel('Date [dd/mm/yyyy]');
h = gca;
h.XAxis.MinorTick = 'on';
datetick('x','dd/mm/yyyy','keepticks','keeplimits');
xtickangle(20);
lgdIPL = (['Displacements (' num2str(GI_Prof_IPL(1,m)) ' m)']);
lgdPL = ('Water level variation');
str(1,1) = {['Displacements (' num2str(GI_Prof_IPL(1,m)) ' m)']};
str(2,1) = {'Water level variation'};
lgd = legend(lgdIPL,lgdPL, 'Location','north');
numcolumns = 2;
[legend_h,object_h,plot_h,text_strings] = columnlegend(numcolumns,str);
clear str
testoIPLvsPL = Paragraph(['The following graph aims to highlight any possible correlation '...
'between the water level variation and displacements recorded by Tilt Link sensors. ' ...
'In particular, with respect to the reference time period, sensors considered for this analysis '...
'include the Tilt Link that recorded the highest local differential displacement along the '...
'maximum slope direction, and the piezometer that measured the largest water level variation (if the Array '...
'equips a single piezometer, water level data will refer to the only sensor available).']);
testoIPLvsPL2 = Paragraph(['In this case, displacements included in the chart refers to the Tilt Link '...
'located at ' num2str(-(GI_Prof_TL(1,m))) ' m of depth, '...
'while the water level variation over time derives from the piezometer '...
'installed at ' num2str((GI_Prof_PL(1,m))) ' metres below ground level.']);
TempName = char(strcat('Report',siteID,'-', char(toolrif),'-IPLvsPL_ENG.png'));
saveas(GI_PiezoLink,TempName);
ChartIPLvsPL = Image(TempName);
ChartIPLvsPL.Style = {ScaleToFit};
ChartIPLvsPL_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison between water level variation and '...
'maximum local differential displacement, along the maximum slope direction, during the reference time period']);
FIG = FIG+1;
ChartIPLvsPL_cap.Style = {HAlign('justify'),FontSize(Font_caption),Italic(1),Color('midnightblue')};
testoIPLvsPL.HAlign = 'justify';
testoIPLvsPL2.HAlign = 'justify';
add(DT,sezGrafIPLvsPL);
add(DT,testoIPLvsPL);
add(DT,testoIPLvsPL2);
add(DT,ChartIPLvsPL);
add(DT,ChartIPLvsPL_cap);
add(DT,br);
close(figure(21));
% pulisco variabili da riutilizzare per catena successiva
clear GI_VarFaldaPL;
end
end
Site = Chapter;
%% Grafici riassuntivi del SITO
if m == rAR && rAR > 1
titleCha = 0;
% --- Piogge vs falda ---
if sum(rRL) > 0 && sum(rPL) > 0 && exist('GI_Rain_RL','var') && exist('GI_Level_PL','var')
if isempty(GI_Level_PL) == 0 && isempty(GI_Rain_RL) == 0
if titleCha == 0
sezSITE = Heading1('Correlations between different sensors');
sezSITE.Style = {OuterMargin('0in','0in','0in','0in'),FontSize(Font_Chapter),HAlign('justify')};
Site.Title = sezSITE;
spazio = Paragraph('');
add(Site,spazio);
titleCha = 1;
end
sezGrafRLvsPL = Heading2('Correlation between sensors - Rain Link vs Piezo Link');
sezGrafRLvsPL.Style = {FontSize(Font_tools),Bold(1),Italic(1)};
GI_VarFaldaPL = GI_Level_PL-GI_Level_PL(1,:);
testoRLvsPL = Paragraph(['The following graph aims to highlight any possible correlation '...
'between the piezometer that measured the largest water level variation for each Array present on-site, '...
'and local rainfall data recorded by the rain gauge.']);
add(Site,sezGrafRLvsPL);
add(Site,testoRLvsPL);
testoRLvsPL.HAlign = 'justify';
figure(22)
GI_RainLink = bar(GI_Date_RL,GI_Rain_RL,75,'k');
yyaxis left
ylabel('Rainfall [mm]');
set(gca,'YColor','k')
yyaxis right
ylabel('Water level variation [m]');
set(gca,'YColor','k')
title('Correlation between rainfall and water level variation');
xlabel('Date [dd/mm/yyyy]');
strRL(1,1) = cellstr('Rainfall');
legend(strRL,'Location','northwest');
[~,colPL] = size(GI_Level_PL);
num = 2;
index = [];
hold on
grid on
cmap = lines(colPL);
for p = 1:colPL
if GI_Date_PL(1,p) ~= 0
ind_PL = find(GI_Date_PL(:,p));
index = [index; p];
GI_RainLink = plot(GI_Date_PL(1:ind_PL(end),p),GI_VarFaldaPL(1:ind_PL(end),p),'-','Color',cmap(p,:));
h = gca;
h.XAxis.MinorTick = 'on';
datetick('x','dd/mm/yyyy','keepticks','keeplimits');
xtickangle(20);
str(1,num) = cellstr([char(chainID(p,4)) ' -' num2str(GI_Prof_PL(1,p)) 'm']);
str(1,1) = cellstr('Rainfall');
legend(str,'Location','northwest');
num = num+1;
end
end
leg = legend(str,'Location','best');
clear str
TempName = char(strcat('Report',siteID,'-', char(toolrif),'-RLvsPL_ENG.png'));
saveas(GI_RainLink,TempName);
ChartRLvsPL = Image(TempName);
ChartRLvsPL.Style = {ScaleToFit};
ChartRLvsPL_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison between rainfall data and water level '...
'variations during the reference time period']);
FIG = FIG+1;
ChartRLvsPL_cap.Style = {HAlign('center'),FontSize(Font_caption),Italic(1),Color('midnightblue')};
text = ('In this case, the water level variation refers to data recorded by sensors reported below:');
testoRLvsPL2 = Paragraph(text);
testoRLvsPL2.HAlign = 'justify';
add(Site,testoRLvsPL2);
I = size(index);
for a = 1:I(1)
text = ['- Array ',char(chainID(index(a),4)),' - Piezometer at ',num2str(GI_Prof_PL(1,index(a))),' m b.g.l.'];
testoRLvsPL2 = Paragraph(text);
add(Site,testoRLvsPL2);
end
add(Site,ChartRLvsPL);
add(Site,ChartRLvsPL_cap);
add(Site,br);
close(figure(22));
end
end
escludiTL = 0;
escludiIPL = 0;
% --- Piogge vs Max Spostamento Tilt Link ---
if sum(rRL) > 0 && sum(rTL) > 0 && exist('GI_Rain_RL','var') && exist('GI_Disp_TL','var')
if isempty(GI_Disp_TL) == 0 && isempty(GI_Rain_RL) == 0
if titleCha == 0
sezSITE = Heading1('Correlation between different sensors');
sezSITE.Style = {OuterMargin('0in','0in','0in','0in'),FontSize(Font_Chapter),HAlign('justify')};
Site.Title = sezSITE;
spazio = Paragraph('');
add(Site,spazio);
titleCha = 1;
end
sezGrafRLvsTL = Heading2('Correlation between sensors - Rain Link vs Tilt Link V');
sezGrafRLvsTL.Style = {FontSize(Font_tools),Bold(1),Italic(1)};
testoRLvsTL = Paragraph(['The following graph aims to highlight any possible correlation '...
'between 3D MEMS that recorded the maximum local differential displacement for each Array installed on-site, '...
'and local rainfall data measured by the rain gauge']);
add(Site,sezGrafRLvsTL);
add(Site,testoRLvsTL);
testoRLvsTL.HAlign = 'justify';
figure(23)
GI_RainLink = bar(GI_Date_RL,GI_Rain_RL,75,'k');
yyaxis left
ylabel('Rainfall [mm]');
set(gca,'YColor','k')
yyaxis right
ylabel('Displacement [mm]');
set(gca,'YColor','k')
title('Correlation between rainfall and displacements');
xlabel('Date [dd/mm/yyyy]');
strRL(1,1) = cellstr('Rainfall');
legend(strRL,'Location','northwest');
[~,colTL] = size(GI_Disp_TL);
num = 2;
hold on
grid on
index = [];
cmap = lines(colTL);
for t = 1:colTL
if GI_Date_TL(1,t) ~= 0
ind_TL = find(GI_Date_TL(:,t));
index = [index; t];
GI_RainLink = plot(GI_Date_TL(1:ind_TL(end),t),GI_Disp_TL(1:ind_TL(end),t),'-','Color',cmap(t,:));
h = gca;
h.XAxis.MinorTick = 'on';
datetick('x','dd/mm/yyyy','keepticks','keeplimits');
xtickangle(20);
str(1,1) = cellstr('Rainfall');
str(1,num) = cellstr([char(chainID(t,4)) ' ' num2str(GI_Prof_TL(1,t)) 'm']);
legend(str,'Location','northwest');
num = num+1;
end
end
clear str
TempName = char(strcat('Report',siteID,'-', char(toolrif),'-RLvsTL_ENG.png'));
saveas(GI_RainLink,TempName);
ChartRLvsTL = Image(TempName);
ChartRLvsTL.Style = {ScaleToFit};
ChartRLvsTL_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison '...
'between rainfall and displacement data during the reference time period']);
FIG = FIG+1;
ChartRLvsTL_cap.Style = {HAlign('center'),FontSize(Font_caption),Italic(1),Color('midnightblue')};
text = 'Displacement data refer to data recorded by sensors listed below: ';
testoRLvsTL2 = Paragraph(text);
testoRLvsTL2.HAlign = 'justify';
add(Site,testoRLvsTL2);
I = size(index);
for a = 1:I(1)
text = ['- Array ',char(chainID(index(a),4)),' - MEMS at ',num2str(abs(GI_Prof_TL(1,index(a)))),' m b.g.l.'];
testoRLvsTL2 = Paragraph(text);
add(Site,testoRLvsTL2);
end
add(Site,ChartRLvsTL);
add(Site,ChartRLvsTL_cap);
add(Site,br);
escludiTL = 1;
close(figure(23));
end
end
% --- Piogge vs Max Spostamento In Place Link ---
if sum(rRL) > 0 && sum(rIPL) > 0 && exist('GI_Rain_RL','var') && exist('GI_Disp_IPL','var')
if isempty(GI_Disp_IPL) == 0 && isempty(GI_Rain_RL) == 0
if titleCha == 0
sezSITE = Heading1('Correlation between different sensors');
sezSITE.Style = {OuterMargin('0in','0in','0in','0in'),FontSize(Font_Chapter),HAlign('justify')};
Site.Title = sezSITE;
spazio = Paragraph('');
add(Site,spazio);
titleCha = 1;
end
sezGrafRLvsIPL = Heading2('Correlation between sensors - Rain Link vs In Place Link');
sezGrafRLvsIPL.Style = {FontSize(Font_tools),Bold(1),Italic(1)};
testoRLvsIPL = Paragraph(['The following graph aims to highlight any possible correlation '...
'between 3D MEMS that recorded the maximum local differential displacement for each Array installed on-site '...
'and local rainfall data measured by the rain gauge']);
add(Site,sezGrafRLvsIPL);
add(Site,testoRLvsIPL);
testoRLvsIPL.HAlign = 'justify';
figure(23)
GI_RainLink = bar(GI_Date_RL,GI_Rain_RL,75,'k');
yyaxis left
ylabel('Rainfall [mm]');
set(gca,'YColor','k')
yyaxis right
ylabel('Displacement [mm]');
set(gca,'YColor','k')
title('Correlation between rainfall and displacements');
xlabel('Date [dd/mm/yyyy]');
strRL(1,1) = cellstr('Rainfall');
legend(strRL,'Location','northwest');
[~,colIPL] = size(GI_Disp_IPL);
num = 2;
hold on
grid on
index = [];
cmap = lines(colIPL);
for t = 1:colIPL
if GI_Date_IPL(1,t) ~= 0
ind_IPL = find(GI_Date_IPL(:,t));
index = [index; t];
GI_RainLink = plot(GI_Date_IPL(1:ind_IPL(end),t),GI_Disp_IPL(1:ind_IPL(end),t),'-','Color',cmap(t,:));
h = gca;
h.XAxis.MinorTick = 'on';
datetick('x','dd/mm/yyyy','keepticks','keeplimits');
xtickangle(20);
str(1,num) = cellstr([char(chainID(t,4)) ' ' num2str(GI_Prof_IPL(1,t)) 'm']);
num = num+1;
end
end
leg = legend(str,'Location','northwest');
clear str
TempName = char(strcat('Report',siteID,'-', char(toolrif),'-RLvsIPL_ENG.png'));
saveas(GI_RainLink,TempName);
ChartRLvsIPL = Image(TempName);
ChartRLvsIPL.Style = {ScaleToFit};
ChartRLvsIPL_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison '...
'between rainfall and displacement data during the reference time period']);
FIG = FIG+1;
ChartRLvsIPL_cap.Style = {HAlign('center'),FontSize(Font_caption),Italic(1),Color('midnightblue')};
text = 'Displacement data refer to data recorded by sensors listed below: ';
testoRLvsIPL2 = Paragraph(text);
testoRLvsIPL2.HAlign = 'justify';
add(Site,testoRLvsIPL2);
I = size(index);
for a = 1:I(1)
text = ['- Array ',char(chainID(index(a),4)),' - MEMS at ',num2str(abs(GI_Prof_IPL(1,index(a)))),' m b.g.l.'];
testoRLvsIPL2 = Paragraph(text);
add(Site,testoRLvsIPL2);
end
add(Site,ChartRLvsIPL);
add(Site,ChartRLvsIPL_cap);
add(Site,br);
escludiIPL = 1;
close(figure(23));
end
end
% --- Spostamenti Tilt Link o In Place Link - clinometri - fessurimetri ---
if sum(rTL) > 0 && exist('GI_Disp_TL','var') && sum(rKL) > 0 && exist('GI_Angolo_KL','var') || ...
sum(rIPL) > 0 && exist('GI_Disp_IPL','var') && sum(rKL) > 0 && exist('GI_Angolo_KL','var') || ...
sum(rTL) > 0 && exist('GI_Disp_TL','var') && sum(rCrL) > 0 && exist('GI_Disp_CrL','var') || ...
sum(rIPL) > 0 && exist('GI_Disp_IPL','var') && sum(rCrL) > 0 && exist('GI_Disp_CrL','var') || ...
sum(rCrL) > 0 && exist('GI_Disp_CrL','var') && sum(rKL) > 0 && exist('GI_Angolo_KL','var')
if isempty(GI_Disp_TL) == 0 && isempty(GI_Angolo_KL) == 0 || ...
isempty(GI_Disp_IPL) == 0 && isempty(GI_Angolo_KL) == 0 || ...
isempty(GI_Disp_TL) == 0 && isempty(GI_Disp_CrL) == 0 || ...
isempty(GI_Disp_IPL) == 0 && isempty(GI_Disp_CrL) == 0 || ...
isempty(GI_Disp_CrL) == 0 && isempty(GI_Angolo_KL) == 0
figure(25)
hold on
grid on
if sum(rTL) > 0 && sum(rKL) > 0 && sum(rCrL) > 0 % Ci sono Tilt + Klino + Crack
sezGrafTLvsKL = Heading2('Correlation between sensors: Tilt Link V, Klino Link, Crack Link');
testoTLvsKL = Paragraph(['The following graph aims to highlight any possible correlation '...
'between 3D MEMS that recorded the maximum local differential displacement for each Array, the maximum tilt value '...
'measured by Klino Links and the maximum crack opening recorded by crack meters installed on-site.']);
title('Maximum values recorded by Tilt, Klino and Crack Link sensors');
ChartTLvsKL_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison '...
'between maximum values of local differential displacement, tilt, and opening recorded during '...
'the reference time period respectively by Tilt Links, Klino Links, and Crack Links']);
elseif sum(rIPL) > 0 && sum(rKL) > 0 && sum(rCrL) > 0 % Ci sono In Place + Klino + Crack
sezGrafTLvsKL = Heading2('Correlation between sensors: In Place Link, Klino Link, Crack Link');
testoTLvsKL = Paragraph(['The following graph aims to highlight any possible correlation '...
'between 3D MEMS that recorded the maximum local differential displacement for each Array, the maximum tilt value '...
'measured by Klino Links and the maximum crack opening recorded by crack meters installed on-site.']);
title('Maximum values recorded by In Place, Klino and Crack Link sensors');
ChartTLvsKL_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison '...
'between maximum values of local differential displacements, tilt, and opening recorded during '...
'the reference time period respectively by Tilt Links, Klino Links, and Crack Links']);
elseif sum(rTL) > 0 && sum(rKL) > 0 % Tilt + Klino
sezGrafTLvsKL = Heading2('Correlation between sensors: Tilt Link V and Klino Link');
testoTLvsKL = Paragraph(['The following graph aims to highlight any possible correlation '...
'between 3D MEMS that recorded the maximum local differential displacement for each Array, and the maximum tilt value '...
'measured by Klino Links installed on-site.']);
title('Maximum values recorded by Tilt and Klino Link sensors');
ChartTLvsKL_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison '...
'between maximum values of local differential displacements and tilt recorded during '...
'the reference time period respectively by Tilt Links and Klino Links']);
elseif sum(rIPL) > 0 && sum(rKL) > 0 % In Place + Klino
sezGrafTLvsKL = Heading2('Correlation between sensors: In Place Link and Klino Link');
testoTLvsKL = Paragraph(['The following graph aims to highlight any possible correlation '...
'between 3D MEMS that recorded the maximum local differential displacement for each Array, and the maximum tilt value '...
'measured by Klino Links installed on-site.']);
title('Maximum values recorded by In Place and Klino Link sensors');
ChartTLvsKL_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison '...
'between maximum values of local differential displacements and tilt recorded during '...
'the reference time period respectively by In Place Links and Klino Links']);
elseif sum(rTL) > 0 && sum(rCrL) > 0 % Tilt e Crack
sezGrafTLvsKL = Heading2('Correlation between sensors: Tilt Link V and Crack Link');
testoTLvsKL = Paragraph(['The following graph aims to highlight any possible correlation '...
'between 3D MEMS that recorded the maximum local differential displacement for each Array, '...
'and the maximum crack opening recorded by crack meters installed on-site.']);
title('Maximum values recorded by Tilt and Crack Link sensors');
ChartTLvsKL_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison '...
'between maximum values of local differential displacements and opening recorded during '...
'the reference time period respectively by Tilt Links and Crack Links']);
elseif sum(rIPL) > 0 && sum(rCrL) > 0 % In Place e Crack
sezGrafTLvsKL = Heading2('Correlation between sensors: In Place Link and Crack Link');
testoTLvsKL = Paragraph(['The following graph aims to highlight any possible correlation '...
'between 3D MEMS that recorded the maximum local differential displacement for each Array, '...
'and the maximum crack opening recorded by crack meters installed on-site.']);
title('Maximum values recorded by In Place and Crack Link sensors');
ChartTLvsKL_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison '...
'between maximum values of local differential displacements and opening recorded during '...
'the reference time period respectively by In Place Links and Crack Links']);
elseif sum(rKL) > 0 && sum(rCrL) > 0
sezGrafTLvsKL = Heading2('Correlation between sensors: Klino Link and Crack Link');
testoTLvsKL = Paragraph(['The following graph aims to highlight any possible correlation '...
'between the maximum tilt value '...
'measured by Klino Links, and the maximum crack opening recorded by crack meters installed on-site.']);
title('Maximum values recorded by Klino and Crack Link sensors');
ChartTLvsKL_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison '...
'between maximum values of tilt and opening recorded during '...
'the reference time period respectively by Klino Links and Crack Links']);
end
sezGrafTLvsKL.Style = {FontSize(Font_tools),Bold(1),Italic(1)};
testoTLvsKL.HAlign = 'justify';
yyaxis left
ylabel('Displacement [mm]');
set(gca,'YColor','k')
yyaxis right
ylabel(['Tilt [' char(176) ']']);
set(gca,'YColor','k')
xlabel('Date [dd/mm/yyyy]');
[~,colTL] = size(GI_Disp_TL);
[~,colIPL] = size(GI_Disp_IPL);
[~,colKL] = size(GI_Date_KL);
[~,colCrL] = size(GI_Date_CrL);
num = 1;
cmap = lines(2*colKL+colTL+colIPL+colCrL);
cont = 1;
% Tilt Link V
indexTL = [];
if sum(rTL) > 0
yyaxis left
for t = 1:colTL
if GI_Date_TL(1,t) ~= 0
ind_TL = find(GI_Date_TL(:,t));
indexTL = [indexTL; t];
plot(GI_Date_TL(1:ind_TL(end),t),GI_Disp_TL(1:ind_TL(end),t),'-','Color',cmap(cont,:));
cont = cont+1;
h = gca;
h.XAxis.MinorTick = 'on';
datetick('x','dd/mm/yyyy','keepticks','keeplimits');
xtickangle(20);
str(1,num) = cellstr([char(chainID(t,4)) ' ' num2str(GI_Prof_TL(1,t)) ' m']);
num = num+1;
end
end
MIN(1) = min(min(GI_Disp_TL));
MAX(1) = max(max(GI_Disp_TL));
end
% In Place Link
indexIPL = [];
if sum(rIPL) > 0
yyaxis left
for t = 1:colIPL
if GI_Date_IPL(1,t) ~= 0
ind_IPL = find(GI_Date_IPL(:,t));
indexIPL = [indexIPL; t];
plot(GI_Date_IPL(1:ind_IPL(end),t),GI_Disp_IPL(1:ind_IPL(end),t),'-','Color',cmap(cont,:));
cont = cont+1;
h = gca;
h.XAxis.MinorTick = 'on';
datetick('x','dd/mm/yyyy','keepticks','keeplimits');
xtickangle(20);
str(1,num) = cellstr([char(chainID(t,4)) ' ' num2str(GI_Prof_IPL(1,t)) ' m']);
num = num+1;
end
end
MIN(2) = min(min(GI_Disp_IPL));
MAX(2) = max(max(GI_Disp_IPL));
end
% Crack Link
indexCrL = [];
if sum(rCrL) > 0
yyaxis left
for c = 1:colCrL
if GI_Date_CrL(1,c) ~= 0
var = GI_Disp_CrL-GI_Disp_CrL(1,:);
ind_CrL = find(GI_Date_CrL(:,c));
indexCrL = [indexCrL; c];
if sum(rKL) > 0
plot(GI_Date_CrL(1:ind_CrL(end),c),var(1:ind_CrL(end),c),'-','Color',cmap(cont,:));
else
GI_KlinoLink = plot(GI_Date_CrL(1:ind_CrL(end),c),var(1:ind_CrL(end),c),'-','Color',cmap(cont,:));
end
cont = cont+1;
h = gca;
h.XAxis.MinorTick = 'on';
datetick('x','dd/mm/yyyy','keepticks','keeplimits');
xtickangle(20);
str(1,num) = cellstr([char(chainID(c,4)) ' node ' num2str(GI_Num_CrL(1,c))]);
num = num+1;
end
end
MIN(3) = min(min(var));
MAX(3) = max(max(var));
ylim([floor(min(min(MIN))) ceil(max(max(MAX)))]);
end
% Klino Link
indexKL = [];
if sum(rKL) > 0
yyaxis right
kk = 1;
for k = 1:colKL
if GI_Date_KL(1,k) ~= 0
ind_KL = find(GI_Date_KL(:,k));
indexKL = [indexKL; k];
plot(GI_Date_KL(1:ind_KL(end),k),GI_Angolo_KL(1:ind_KL(end),kk)...
-GI_Angolo_KL(1,kk),'-','Color',cmap(cont,:));
GI_KlinoLink = plot(GI_Date_KL(1:ind_KL(end),k),GI_Angolo_KL(1:ind_KL(end)...
,kk+1)-GI_Angolo_KL(1,kk+1),'-','Color',cmap(cont+1,:));
cont = cont+2;
kk = kk+2;
h = gca;
h.XAxis.MinorTick = 'on';
datetick('x','dd/mm/yyyy','keepticks','keeplimits');
xtickangle(20);
str(1,num) = cellstr([char(chainID(k,4)) ' node' num2str(GI_Num_KL(1,k)) ', X axis']);
str(1,num+1) = cellstr([char(chainID(k,4)) ' node ' num2str(GI_Num_KL(1,k)) ', Y axis']);
num = num+2;
end
end
ylim([floor(min(min(GI_Angolo_KL))) ceil(max(max(GI_Angolo_KL)))]);
end
numcolumns = 1;
[legend_h,object_h,plot_h,text_strings] = columnlegend(numcolumns,str,'Location','NorthWest');
TempName = char(strcat('Report',siteID,'-', char(toolrif),'-TLvsKL_ENG.png'));
if titleCha == 0
sezSITE = Heading1('Correlation between different sensors');
sezSITE.Style = {OuterMargin('0in','0in','0in','0in'),FontSize(Font_Chapter),HAlign('justify')};
Site.Title = sezSITE;
titleCha = 1;
end
add(Site,sezGrafTLvsKL);
add(Site,testoTLvsKL);
saveas(GI_KlinoLink,TempName);
ChartTLvsKL = Image(TempName);
ChartTLvsKL.Style = {ScaleToFit};
FIG = FIG+1;
ChartTLvsKL_cap.Style = {HAlign('justify'),FontSize(Font_caption),Italic(1),Color('midnightblue')};
text = 'Reported values refer to data recorded by sensors listed below: ';
testoTL2 = Paragraph(text);
testoTL2.HAlign = 'justify';
add(Site,testoTL2);
% Tilt Link
I = size(indexTL);
for a = 1:I(1)
text = ['- Array ',char(chainID(indexTL(a),4)),' - MEMS at ',num2str(abs(GI_Prof_TL(1,indexTL(a)))),' m b.g.l.'];
testoTL2 = Paragraph(text);
add(Site,testoTL2);
end
% In Place Link
I = size(indexIPL);
for a = 1:I(1)
text = ['- Array ',char(chainID(indexIPL(a),4)),' - MEMS at ',num2str(abs(GI_Prof_IPL(1,indexIPL(a)))),' m b.g.l.'];
testoTL2 = Paragraph(text);
add(Site,testoTL2);
end
% Klino Link
I = size(indexKL);
for a = 1:I(1)
text = ['- Array ',char(chainID(indexKL(a),4)),' - Tilt meter ',num2str(GI_Num_KL(1,indexKL(a)))];
testoTL2 = Paragraph(text);
add(Site,testoTL2);
end
% Crack Link
I = size(indexCrL);
for a = 1:I(1)
text = ['- Array ',char(chainID(indexCrL(a),4)),' - Crack meter, node ',num2str(GI_Num_CrL(1,indexCrL(a)))];
testoTL2 = Paragraph(text);
add(Site,testoTL2);
end
add(Site,ChartTLvsKL);
add(Site,ChartTLvsKL_cap);
add(Site,br);
end
close(figure(25));
escludiTL = 1;
end
% --- Spostamenti a confronto ---
% ---> Tilt Link
if sum(rTL) > 0 && exist('GI_Disp_TL','var')
if isempty(GI_Disp_TL) == 0
if escludiTL == 0
sezGrafTL = Heading2('Correlation between Tilt Link V sensors');
sezGrafTL.Style = {FontSize(Font_tools),Bold(1),Italic(1)};
testoTL = Paragraph(['The following graph aims to highlight any possible correlation '...
'between highest displacement values recorded by 3D MEMS '...
'for each single Vertical Array installed on-site.']);
testoTL.HAlign = 'justify';
figure(24)
ylabel('Displacement [mm]');
set(gca,'YColor','k')
title('Correlation between maximum values measured by each single Array');
xlabel('Date [dd/mm/yyyy]');
[~,colTL] = size(GI_Disp_TL);
num = 1;
index = [];
for t = 1:colTL
if GI_Date_TL(1,t) ~= 0
ind_TL = find(GI_Date_TL(:,t));
index = [index; t];
hold on
grid on
GI_TiltLink = plot(GI_Date_TL(1:ind_TL(end),t),GI_Disp_TL(1:ind_TL(end),t));
h = gca;
h.XAxis.MinorTick = 'on';
datetick('x','dd/mm/yyyy','keepticks','keeplimits');
xtickangle(20);
str(1,num) = cellstr([char(chainID(t,4)) ' ' num2str(GI_Prof_TL(1,t)) ' m']);
leg = legend(str,'Location','northwest');
num = num+1;
end
end
TempName = char(strcat('Report',siteID,'-', char(toolrif),'-TL_ENG.png'));
if num >= 3
if titleCha == 0
sezSITE = Heading1('Correlation between different sensors');
sezSITE.Style = {OuterMargin('0in','0in','0in','0in'),FontSize(Font_Chapter),HAlign('justify')};
Site.Title = sezSITE;
titleCha = 1;
end
add(Site,sezGrafTL);
add(Site,testoTL);
saveas(GI_TiltLink,TempName);
ChartTL = Image(TempName);
ChartTL.Style = {ScaleToFit};
ChartTL_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison '...
'between highest value of 2D differential local displacement '...
'recorded by each single Array during the reference time period']);
FIG = FIG+1;
ChartTL_cap.Style = {HAlign('justify'),FontSize(Font_caption),Italic(1),Color('midnightblue')};
text = 'Displacement data refer to the following sensors: ';
testoTL2 = Paragraph(text);
testoTL2.HAlign = 'justify';
add(Site,testoTL2);
I = size(index);
for a = 1:I(1)
text = ['- Array ',char(chainID(index(a),4)),' - MEMS at ',num2str(abs(GI_Prof_TL(1,index(a)))),' m b.g.l.'];
testoTL2 = Paragraph(text);
add(Site,testoTL2);
end
add(Site,ChartTL);
add(Site,ChartTL_cap);
add(Site,br);
end
close(figure(24));
end
end
end
% ---> In Place Link
if sum(rIPL) > 0 && exist('GI_Disp_IPL','var')
if isempty(GI_Disp_IPL) == 0
if escludiIPL == 0
sezGrafIPL = Heading2('Correlation between In Place sensors');
sezGrafIPL.Style = {FontSize(Font_tools),Bold(1),Italic(1)};
testoIPL = Paragraph(['The following graph aims to highlight any possible correlation '...
'between highest displacement values recorded by 3D MEMS '...
'for each single In Place Array installed on-site.']);
testoIPL.HAlign = 'justify';
figure(24)
ylabel('Displacement [mm]');
set(gca,'YColor','k')
title('Correlation between maximum values measured by each single Array');
xlabel('Date [dd/mm/yyyy]');
[~,colIPL] = size(GI_Disp_IPL);
num = 1;
index = [];
for t = 1:colIPL
if GI_Date_IPL(1,t) ~= 0
ind_IPL = find(GI_Date_IPL(:,t));
index = [index; t];
hold on
grid on
GI_InPlaceLink = plot(GI_Date_IPL(1:ind_IPL(end),t),GI_Disp_IPL(1:ind_IPL(end),t));
h = gca;
h.XAxis.MinorTick = 'on';
datetick('x','dd/mm/yyyy','keepticks','keeplimits');
xtickangle(20);
str(1,num) = cellstr([char(chainID(t,4)) ' ' num2str(GI_Prof_IPL(1,t)) ' m']);
leg = legend(str,'Location','northwest');
num = num+1;
end
end
TempName = char(strcat('Report',siteID,'-', char(toolrif),'-IPL_ENG.png'));
if num >= 3
if titleCha == 0
sezSITE = Heading1('Correlation between different sensors');
sezSITE.Style = {OuterMargin('0in','0in','0in','0in'),FontSize(Font_Chapter),HAlign('justify')};
Site.Title = sezSITE;
titleCha = 1;
end
add(Site,sezGrafIPL);
add(Site,testoIPL);
saveas(GI_InPlaceLink,TempName);
ChartIPL = Image(TempName);
ChartIPL.Style = {ScaleToFit};
ChartIPL_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison '...
'between highest value of 2D differential local displacement '...
'recorded by each single Array during the reference time period']);
FIG = FIG+1;
ChartIPL_cap.Style = {HAlign('center'),FontSize(Font_caption),Italic(1),Color('midnightblue')};
text = 'Displacement data refer to the following sensors: ';
testoIPL2 = Paragraph(text);
testoIPL2.HAlign = 'justify';
add(Site,testoIPL2);
I = size(index);
for a = 1:I(1)
text = ['- Array ',char(chainID(index(a),4)),' - MEMS at ',num2str(abs(GI_Prof_IPL(1,index(a)))),' m b.g.l.'];
testoIPL2 = Paragraph(text);
add(Site,testoIPL2);
end
add(Site,ChartIPL);
add(Site,ChartIPL_cap);
add(Site,br);
end
close(figure(24));
end
end
end
%---> Quadranti Tunnel Link
if sum(rTuL) > 0 && exist('GI_Q1_TuL','var')
if isempty(GI_Q1_TuL) == 0 && isempty(GI_Q2_TuL) == 0 && isempty(GI_Q3_TuL) == 0 ...
&& isempty(GI_Q4_TuL) == 0
if titleCha == 0
sezSITE = Heading1('Correlation between different sensors');
sezSITE.Style = {OuterMargin('0in','0in','0in','0in'),FontSize(Font_Chapter),HAlign('justify')};
spazio = Paragraph('');
add(Site,spazio);
Site.Title = sezSITE;
titleCha = 1;
end
sezGrafTuL = Heading2('Correlation between Tunnel Links');
sezGrafTuL.Style = {FontSize(Font_tools),Bold(1),Italic(1)};
testoTuL = Paragraph(['The following graph aims to highlight any correlation between '...
'highest 2D displacement values recorded by 3D MEMS for each single Cir Array installed on-site. '...
'Displacements are compared according to the corresponding sector, defined by dividing the monitored '...
'section in four separated areas which are numbered as explained in the following figure. ']);
testoTuL.HAlign = 'justify';
img = Image(('Quadranti.png'));
img.Style = {Height('6cm'),HAlign('center')};
imgcaption = Paragraph(['Fig. ' num2str(FIG) ' - Sectors numbering in a tunnel section']);
FIG = FIG+1;
imgcaption.Style = {HAlign('center'),FontSize(Font_caption),Italic(1),Color('midnightblue')};
% Quadrante 1
figure(25)
set(gca,'YColor','k')
[~,colTuL] = size(GI_Q1_TuL);
num = 1;
for t = 1:colTuL
if GI_Date_TuL(1,t) ~= 0
y1(num) = GI_Q1_TuL(1,t);
y2(num) = GI_Q2_TuL(1,t);
y3(num) = GI_Q3_TuL(1,t);
y4(num) = GI_Q4_TuL(1,t);
y5(num) = 0;
str(1,num) = chainID(t,4);
num = num+1;
end
end
y = [y1;y2;y3;y4;y5];
x = [1;2;3;4;5];
Quadranti = barh(x,y);
grid on
title('Correlation between displacements recorded in different sectors');
xlabel('Displacement [mm]');
ylabel('Sector [-]');
ylim([0 5]); % Con 5, metto la legenda in alto a sx (il valore 5 ? pieno di 0)
% Stimo limiti asse X
ini1 = min(GI_Q1_TuL);
ini2 = min(GI_Q2_TuL);
ini3 = min(GI_Q3_TuL);
ini4 = min(GI_Q4_TuL);
Min = [ini1; ini2; ini3; ini4];
C = min(Min);
end1 = max(GI_Q1_TuL);
end2 = max(GI_Q2_TuL);
end3 = max(GI_Q3_TuL);
end4 = max(GI_Q4_TuL);
Max = [end1; end2; end3; end4];
B = max(Max);
A = [abs(C),abs(B)];
LIM = max(A);
POS = find(A == LIM);
if -LIM > -2.5 % mm
ini = -2.5;
else
ini = -LIM;
end
if LIM < 2.5
End = 2.5;
else
End = LIM;
end
xlim([ini End]);
if num-1 == 1 % 1 solo array
ylim([0 5]);
else
ylim([0 6]);
end
yticks(1:4);
if POS == 1 % Legenda a DX
legend(str,'Location','northeast');
else % SX
legend(str,'Location','northwest');
end
add(Site,sezGrafTuL);
add(Site,testoTuL);
add(Site,img);
add(Site,imgcaption);
TempName1 = char(strcat('Report',siteID,'-', char(toolrif),'-Quadranti_ENG.png'));
saveas(Quadranti(1),TempName1);
ChartTuL = Image(TempName1);
ChartTuL.Style = {Height('7.5cm'),HAlign('center')};
close(figure(25))
Quadranti_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison '...
'between highest 2D displacement values '...
'recorded by each single Array in the corresponding sector of the monitored tunnel section '...
'during the reference time period']);
FIG = FIG+1;
Quadranti_cap.Style = {HAlign('justify'),FontSize(Font_caption),Italic(1),Color('midnightblue')};
text = 'Displacement data refer to the following sensors: ';
testoTuL2 = Paragraph(text);
testoTuL2.HAlign = 'justify';
add(Site,testoTuL2);
text = 'Sector 1';
testoTuL1 = Paragraph(text);
testoTuL1.Style = {HAlign('justify'),FontSize(Font_caption),Bold(1),Color('midnightblue')};
add(Site,testoTuL1);
for a = 1:colTuL
if GI_Date_TuL(1,a) ~= 0
text1 = ['- Array ',char(chainID(a,4)),' - node ',num2str(abs(GI_Q1_Num_TuL(1,a))),''];
testoTuL2 = Paragraph(text1);
add(Site,testoTuL2);
end
end
text = 'Sector 2';
testoTuL3 = Paragraph(text);
testoTuL3.Style = {HAlign('justify'),FontSize(Font_caption),Bold(1),Color('midnightblue')};
add(Site,testoTuL3);
for a = 1:colTuL
if GI_Date_TuL(1,a) ~= 0
text2 = ['- Array ',char(chainID(a,4)),' - node ',num2str(abs(GI_Q2_Num_TuL(1,a))),''];
testoTuL4 = Paragraph(text2);
add(Site,testoTuL4);
end
end
text = 'Sector 3';
testoTuL5 = Paragraph(text);
testoTuL5.Style = {HAlign('justify'),FontSize(Font_caption),Bold(1),Color('midnightblue')};
add(Site,testoTuL5);
for a = 1:colTuL
if GI_Date_TuL(1,a) ~= 0
text3 = ['- Array ',char(chainID(a,4)),' - node ',num2str(abs(GI_Q3_Num_TuL(1,a))),''];
testoTuL6 = Paragraph(text3);
add(Site,testoTuL6);
end
end
text = 'Sector 4';
testoTuL7 = Paragraph(text);
testoTuL7.Style = {HAlign('justify'),FontSize(Font_caption),Bold(1),Color('midnightblue')};
add(Site,testoTuL7);
for a = 1:colTuL
if GI_Date_TuL(1,a) ~= 0
text4 = ['- Array ',char(chainID(a,4)),' - node ',num2str(abs(GI_Q4_Num_TuL(1,a))),''];
testoTuL8 = Paragraph(text4);
add(Site,testoTuL8);
end
end
add(Site,ChartTuL);
add(Site,Quadranti_cap);
end
end
% ---> Confronti variazioni segmenti Stella
if sum(rTuL) > 0 && exist('GI_Seg_TuL','var')
if isempty(GI_Seg_TuL) == 0
testoStar = Paragraph(['The following graph aims to compare the length variation of '...
'each convergence segment referred to tunnel sections monitored with a Cir Array. Please refer to '...
'the corresponding Array section of this Report for information regarding any specific convergence star.']);
testoStar.HAlign = 'justify';
figure(26)
set(gca,'YColor','k')
s = 1;
num = 1;
[~,colTuL] = size(GI_Date_TuL);
for t = 1:colTuL
if GI_Date_TuL(1,t) ~= 0 % Esistono dati per quell'array
% Segmento 1
s1(num) = GI_Seg_TuL(1,s);
s = s+1;
% Segmento 2
if GI_NumSeg_TuL(t,1) > 1
s2(num) = GI_Seg_TuL(1,s);
s = s+1;
else
s2(num) = 0;
end
% Segmento 3
if GI_NumSeg_TuL(t,1) > 2
s3(num) = GI_Seg_TuL(1,s);
s = s+1;
else
s3(num) = 0;
end
% Segmento 4
if GI_NumSeg_TuL(t,1) > 3
s4(num) = GI_Seg_TuL(1,s);
s = s+1;
else
s4(num) = 0;
end
% Segmento 5
if GI_NumSeg_TuL(t,1) > 4
s5(num) = GI_Seg_TuL(1,s);
s = s+1;
else
s5(num) = 0;
end
% Segmento 6
if GI_NumSeg_TuL(t,1) > 5
s6(num) = GI_Seg_TuL(1,s);
s = s+1;
else
s6(num) = 0;
end
% Segmento 7
if GI_NumSeg_TuL(t,1) > 6
s7(num) = GI_Seg_TuL(1,s);
s = s+1;
else
s7(num) = 0;
end
str(1,num) = chainID(t,4);
num = num+1;
end
end
y = [s1;s2;s3;s4;s5;s6;s7];
x = [1;2;3;4;5;6;7];
yticklabels({'S1','S2','S3','S4','S5','S6','S7'})
Stella = barh(x,y);
grid on
title('Correlation between convergence segments length variation');
xlabel('Displacement [mm]');
ylabel('Segment [-]');
% Stimo limiti asse X
ini = min(y);
ini = min(ini);
End = max(y);
End = max(End);
A = [abs(ini),End];
RIF = max(A);
ind = find(A == RIF);
if ind == 1
legend(str,'Location','northeast');
else
legend(str,'Location','northwest');
end
if -RIF > -2.5 % mm
ini = -2.5;
else
ini = -RIF;
end
if RIF < 2.5
End = 2.5;
else
End = RIF;
end
xlim([ini End]);
yticks(1:7);
if num-1 == 1 % Numero Array
ylim([0 7]);
else
ylim([0 8]);
end
add(Site,testoStar);
TempName1 = char(strcat('Report',siteID,'-', char(toolrif),'-Stella_ENG.png'));
saveas(Stella(1),TempName1);
ChartStella = Image(TempName1);
ChartStella.Style = {Height('7.5cm'),HAlign('center')};
add(Site,ChartStella);
close(figure(26))
Quadranti_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison '...
'between length variations of each convergence segment '...
'recorded in the corresponding tunnel section by each single Array '...
'during the reference time period']);
FIG = FIG+1;
Quadranti_cap.Style = {HAlign('justify'),FontSize(Font_caption),Italic(1),Color('midnightblue')};
add(Site,Quadranti_cap);
add(Site,br);
end
end
% ---> Grafici spostamento in calotta PreConv vs Cir
if sum(rTuL) > 0 && exist('GI_Z_TuL','var') && sum(rPCL) > 0 && exist('GI_Z_PCL','var')
if isempty(GI_Z_TuL) == 0 && isempty(GI_Z_PCL) == 0
sezGrafTuLvsPCL = Heading2('Correlation between PreConv Array and Cir Array');
sezGrafTuLvsPCL.Style = {FontSize(Font_tools),Bold(1),Italic(1)};
testoTuLvsPCL = Paragraph(['The following graph aims to highlight any correlation '...
'between local displacements recorded by PreConv Array and Cir Array sensors. The comparison '...
'takes into account two nodes, one for each Array, installed approximately in the same place of the '...
'upper part of the monitored section.']);
testoTuLvsPCL.HAlign = 'justify';
% Cerco eventuali correlazioni con Cir Array
NomeFile = strcat('Report',siteID,'-PCLvsTuL.txt');
Filetesto = importdata(NomeFile);
[rF,~] = size(Filetesto);
AAA = 1;
num = 1;
sen = 1;
SensoriTuL = zeros(1,1);
SensoriPCL = zeros(1,1);
CatenaTuL = cell(1,1);
CatenaPCL = cell(1,1);
colCIR = 0;
while AAA < rF % A un PreConv possono competere pi? Cir
PCL = 0;
Cir = 0;
check1 = Filetesto(AAA,1);
if check1 == 99999 % Non ci sono PreConv Array o non ci sono Cir
break
else
check2 = Filetesto(AAA+1,1);
for nn = 1:rAR
chain = char(chainID(nn,4));
if check1 == str2num(chain(end-2:end))
PCL = nn;
NodoPCL = Filetesto(AAA+2,1);
SensoriPCL(sen,1) = NodoPCL;
CatenaPCL(sen,1) = chainID(nn,4);
end
if check2 == str2num(chain(end-2:end))
Cir = nn;
NodoTuL = Filetesto(AAA+3,1);
SensoriTuL(sen,1) = NodoTuL;
CatenaTuL(sen,1) = chainID(nn,4);
colCIR = colCIR+1;
end
if PCL > 0 && Cir > 0
figure(27)
ylabel('Displacement [mm]');
xlabel('Date [dd/mm/yyyy]');
set(gca,'YColor','k')
title('Correlation between corresponding sensors');
grid on
hold on
dim1 = find(GI_Z_PCL(:,PCL));
dim2 = find(GI_Z_TuL(:,colCIR));
if isempty(dim1) == 0 && isempty(dim2) == 0
plot(GI_Date_PCL(1:dim1(end),PCL),GI_Z_PCL(1:dim1(end),PCL));
GI_TuLvsPCL = plot(GI_Date_TuL(1:dim2(end),Cir),GI_Z_TuL(1:dim2(end),colCIR));
MIN1 = min(GI_Z_PCL(:,PCL));
MIN2 = min(GI_Z_TuL(:,colCIR));
MIN = min(MIN1,MIN2);
MAX1 = max(GI_Z_PCL(:,PCL));
MAX2 = max(GI_Z_TuL(:,colCIR));
MAX = max(MAX1,MAX2);
if MAX < 5 && MIN > -5 % mm
ylim([-5 5]);
elseif MAX < 5
ylim([MIN-1 5]);
elseif MIN > -5
ylim([-5 MAX+1]);
end
datetick('x','dd/mm/yyyy','keepticks','keeplimits');
h = gca;
h.XAxis.MinorTick = 'on';
xtickangle(20);
str(1,1) = cellstr([char(CatenaPCL(sen,1)) ' Node ' num2str(NodoPCL) '']);
str(1,2) = cellstr([char(CatenaTuL(sen,1)) ' Node ' num2str(NodoTuL) '']);
legend(str,'Location','northwest');
TempName = char(strcat('Report',siteID,'-PCLvsTuL',num2str(num),'_ENG.png'));
saveas(GI_TuLvsPCL,TempName);
num = num+1;
end
close(figure(27));
sen = sen+1;
AAA = AAA+4;
break
end
end
end
end
num = num-1;
if num ~= 0 % Non ci sono legami
add(Site,sezGrafTuLvsPCL);
add(Site,testoTuLvsPCL);
if num == 1
TempName = char(strcat('Report',siteID,'-PCLvsTuL',num2str(num),'_ENG.png'));
Chart1 = Image(TempName);
Chart1.Style = {ScaleToFit};
add(Site,Chart1);
else
n = 1;
while n <= num
TempName = char(strcat('Report',siteID,'-PCLvsTuL',num2str(n),'_ENG.png'));
Chart1 = Image(TempName);
Chart1.Style = {Height('7cm')};
if n+1 <= num
TempName = char(strcat('Report',siteID,'-PCLvsTuL',num2str(n+1),'_ENG.png'));
Chart2 = Image(TempName);
Chart2.Style = {Height('7cm')};
lot = Table({Chart1, Chart2});
lot.Style = {ResizeToFitContents(false), Width('100%')};
n = n+2;
add(Site,lot);
else
n = n+1;
add(Site,Chart1);
end
end
end
ChartPCLvsTuL_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison between '...
'local displacements recorded during the reference time period by the '...
'Cir Array sensor installed on the upper part of '...
'the tunnel section, and the corresponding PreConv Array sensor']);
FIG = FIG+1;
ChartPCLvsTuL_cap.Style = {HAlign('justify'),FontSize(Font_caption),Italic(1),Color('midnightblue')};
add(Site,ChartPCLvsTuL_cap);
text = 'Displacement data refer to the following sensors: ';
testoPCLvsTuL2 = Paragraph(text);
testoPCLvsTuL2.HAlign = 'justify';
add(Site,testoPCLvsTuL2);
I = size(SensoriPCL);
for a = 1:I(1)
textPC = ['- PreConv Array ' char(CatenaPCL(a,1)) ' - Node ' num2str(SensoriPCL(a,1)) ';'];
textCA = ['- Cir Array ' char(CatenaTuL(a,1)),' - Node ' num2str(SensoriTuL(a,1)) '.'];
spazio = Paragraph('');
testoPCLvsTuL2 = Paragraph(textPC);
testoPCLvsTuL3 = Paragraph(textCA);
add(Site,testoPCLvsTuL2);
add(Site,testoPCLvsTuL3);
add(Site,spazio);
end
add(Site,br);
end
end
end
% ---> Grafici spostamento Cir vs Rad
if sum(rRaL) > 0 && exist('GI_dS_RL_TuL','var') && sum(rRaL) > 0 && exist('GI_dS_TuL_RL','var')
if isempty(GI_dS_RL_TuL) == 0 && isempty(GI_dS_TuL_RL) == 0
sezGrafTuLvsRL = Heading2('Correlazioni tra Cir Array e Rad Array');
sezGrafTuLvsRL.Style = {FontSize(Font_tools),Bold(1),Italic(1)};
testoTuLvsRL = Paragraph(['The following graph aims to highlight any possible correlation '...
'between 2D local differential displacement values recorded by the Radial Link located closer '...
'to the monitored section, and the corresponding Tunnel Link sensor.']);
testoTuLvsRL.HAlign = 'justify';
% Cerco eventuali correlazioni con Cir Array
NomeFile = strcat('Report',siteID,'-TuLvsRL.txt');
Filetesto = importdata(NomeFile);
[rF,~] = size(Filetesto);
AAA = 1;
num = 1;
sen = 1;
SensoriTuL = zeros(1,1);
SensoriRL = zeros(1,1);
CatenaTuL = cell(1,1);
CatenaRL = cell(1,1);
colCIR = 0;
while AAA < rF
Rad = 0;
Cir = 0;
check1 = Filetesto(AAA,1);
if check1 == 99999 % Non ci sono Rad Array o non ci sono Cir
break
else
check2 = Filetesto(AAA+1,1);
for nn = 1:rAR
chain = char(chainID(nn,4));
if check1 == str2num(chain(end-2:end)) % Il primo deve sempre essere il Cir
Cir = nn;
NodoTuL = Filetesto(AAA+2,1);
SensoriTuL(sen,1) = NodoTuL;
CatenaTuL(sen,1) = chainID(nn,4);
colCIR = colCIR+1;
end
if check2 == str2num(chain(end-2:end))
Rad = nn;
NodoRL = Filetesto(AAA+3,1);
SensoriRL(sen,1) = NodoRL;
CatenaRL(sen,1) = chainID(nn,4);
end
if Rad > 0 && Cir > 0
figure(28)
ylabel('Displacement [mm]');
xlabel('Date [dd/mm/yyyy]');
set(gca,'YColor','k')
title('Correlation between corresponding sensors');
grid on
hold on
dim1 = find(GI_dS_RL_TuL(:,Rad));
dim2 = find(GI_dS_TuL_RL(:,colCIR));
if isempty(dim1) == 0 && isempty(dim2) == 0
plot(GI_Date_Rad(1:dim1(end),Rad),GI_dS_RL_TuL(1:dim1(end),Rad));
GI_TuLvsRL = plot(GI_Date_TuL(1:dim2(end),Cir),GI_dS_TuL_RL(1:dim2(end),colCIR));
MAX1 = max(GI_dS_RL_TuL(:,Rad));
MAX2 = max(GI_dS_TuL_RL(:,colCIR));
MAX = max(MAX1,MAX2);
if MAX < 5 % mm
ylim([0 5]);
end
datetick('x','dd/mm/yyyy','keepticks','keeplimits');
h = gca;
h.XAxis.MinorTick = 'on';
xtickangle(20);
str(1,1) = cellstr([char(CatenaTuL(sen,1)) ' Node ' num2str(NodoTuL) '']);
str(1,2) = cellstr([char(CatenaRL(sen,1)) ' Node ' num2str(NodoRL) '']);
legend(str,'Location','northwest');
TempName = char(strcat('Report',siteID,'-TuLvsRL',num2str(num),'_ENG.png'));
saveas(GI_TuLvsRL,TempName);
num = num+1;
end
close(figure(28));
sen = sen+1;
AAA = AAA+4;
break
end
end
end
end
num = num-1;
if num ~= 0 % Non ci sono legami
add(Site,sezGrafTuLvsRL);
add(Site,testoTuLvsRL);
if num == 1
TempName = char(strcat('Report',siteID,'-TuLvsRL',num2str(num),'_ENG.png'));
Chart1 = Image(TempName);
Chart1.Style = {ScaleToFit};
add(Site,Chart1);
else
n = 1;
while n <= num
TempName = char(strcat('Report',siteID,'-TuLvsRL',num2str(n),'_ENG.png'));
Chart1 = Image(TempName);
Chart1.Style = {Height('7cm')};
if n+1 <= num
TempName = char(strcat('Report',siteID,'-TuLvsRL',num2str(n+1),'_ENG.png'));
Chart2 = Image(TempName);
Chart2.Style = {Height('7cm')};
lot = Table({Chart1, Chart2});
lot.Style = {ResizeToFitContents(false), Width('100%')};
n = n+2;
add(Site,lot);
else
n = n+1;
add(Site,Chart1);
end
end
end
ChartTuLvsRL_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison '...
'between 2D local displacement data recorded by the Radial Link sensor closer to '...
'the monitored section, and the corresponding Tunnel Link sensor']);
FIG = FIG+1;
ChartTuLvsRL_cap.Style = {HAlign('justify'),FontSize(Font_caption),Italic(1),Color('midnightblue')};
add(Site,ChartTuLvsRL_cap);
text = 'Displacement data refer to the following sensors: ';
testoTuL2vsRL = Paragraph(text);
testoTuL2vsRL.HAlign = 'justify';
add(Site,testoTuL2vsRL);
I = size(SensoriRL);
for a = 1:I(1)
text = ['- Rad Array ' char(CatenaRL(a,1)) ' - Node ' num2str(SensoriRL(a,1)) ...
', Cir Array ' char(CatenaTuL(a,1)),' - Node ' num2str(SensoriTuL(a,1)) ''];
testoTuL2vsRL = Paragraph(text);
add(Site,testoTuL2vsRL);
end
add(Site,br);
end
end
end
% ---> Grafici spostamento Rad vs MPB
if sum(rRaL) > 0 && exist('GI_dS_RL_MPB','var') && sum(rMPBEL) > 0 && exist('GI_dS_MPB_RL','var')
if isempty(GI_dS_RL_MPB) == 0 && isempty(GI_dS_MPB_RL) == 0
sezGrafMPBvsRL = Heading2('Correlation between Rad Array and Multipoint Borehole Extensometer (MPBX)');
sezGrafMPBvsRL.Style = {FontSize(Font_tools),Bold(1),Italic(1)};
testoMPBvsRL = Paragraph(['The following graph aims to highlight any possible correlation '...
'between 3D local differential displacement values recorded by the Radial Link sensor and the '...
'corresponding radial deformation measured by the longest rod of the MPBX.']);
testoMPBvsRL.HAlign = 'justify';
% Cerco eventuali correlazioni con Estensimetro multibase
NomeFile = strcat('Report',siteID,'-RLvsMPBEL.txt');
Filetesto = importdata(NomeFile);
[rF,~] = size(Filetesto);
AAA = 1;
num = 1;
sen = 1;
SensoriRL = zeros(1,1);
SensoriMPB = zeros(1,1);
CatenaRL = cell(1,1);
CatenaMPB = cell(1,1);
colMPB = 0;
while AAA < rF
Rad = 0;
MPB = 0;
check1 = Filetesto(AAA,1);
if check1 == 99999 % Non ci sono Rad Array o estensimetri multibase
break
else
check2 = Filetesto(AAA+1,1);
for nn = 1:rAR
chain = char(chainID(nn,4));
if check1 == str2num(chain(end-2:end)) % Il primo deve sempre essere il Rad
Rad = nn;
NodoRL = Filetesto(AAA+2,1);
SensoriRL(sen,1) = NodoRL;
CatenaRL(sen,1) = chainID(nn,4);
end
if check2 == str2num(chain(end-2:end))
MPB = nn;
NodoMPB = Filetesto(AAA+3,1);
SensoriMPB(sen,1) = NodoMPB;
CatenaMPB(sen,1) = chainID(nn,4);
colMPB = colMPB+1;
end
if Rad > 0 && MPB > 0
figure(29)
ylabel('Displacement [mm]');
xlabel('Date [dd/mm/yyyy]');
set(gca,'YColor','k')
title('Correlation between corresponding displacements');
grid on
hold on
dim1 = find(GI_dS_RL_MPB(:,Rad));
dim2 = find(GI_dS_MPB_RL(:,colMPB));
if isempty(dim1) == 0 && isempty(dim2) == 0
plot(GI_Date_Rad(1:dim1(end),Rad),GI_dS_RL_MPB(1:dim1(end),Rad));
GI_MPBvsRL = plot(GI_Date_MPB(1:dim2(end),MPB),GI_dS_MPB_RL(1:dim2(end),colMPB));
MAX1 = max(GI_dS_RL_MPB(:,Rad));
MAX2 = max(GI_dS_MPB_RL(:,colMPB));
MAX = max(MAX1,MAX2);
if MAX < 5 % mm
ylim([-5 5]);
end
datetick('x','dd/mm/yyyy','keepticks','keeplimits');
h = gca;
h.XAxis.MinorTick = 'on';
xtickangle(20);
str(1,1) = cellstr([char(CatenaRL(sen,1)) ' Node ' num2str(NodoRL) '']);
str(1,2) = cellstr([char(CatenaMPB(sen,1)) ' MPBX ' num2str(NodoMPB) '']);
legend(str,'Location','northwest');
TempName = char(strcat('Report',siteID,'-RLvsMPB',num2str(num),'_ENG.png'));
saveas(GI_MPBvsRL,TempName);
num = num+1;
end
close(figure(29))
sen = sen+1;
AAA = AAA+4;
break
end
end
end
end
num = num-1;
if num ~= 0 % Non ci sono legami
add(Site,sezGrafMPBvsRL);
add(Site,testoMPBvsRL);
if num == 1
TempName = char(strcat('Report',siteID,'-RLvsMPB',num2str(num),'_ENG.png'));
Chart1 = Image(TempName);
Chart1.Style = {ScaleToFit};
add(Site,Chart1);
else
n = 1;
while n <= num
TempName = char(strcat('Report',siteID,'-RLvsMPB',num2str(n),'_ENG.png'));
Chart1 = Image(TempName);
Chart1.Style = {Height('7cm')};
if n+1 <= num
TempName = char(strcat('Report',siteID,'-RLvsMPB',num2str(n+1),'_ENG.png'));
Chart2 = Image(TempName);
Chart2.Style = {Height('7cm')};
lot = Table({Chart1, Chart2});
lot.Style = {ResizeToFitContents(false), Width('100%')};
n = n+2;
add(Site,lot);
else
n = n+1;
add(Site,Chart1);
end
end
end
ChartMPBvsRL_cap = Paragraph(['Fig. ' num2str(FIG) ' - Comparison '...
'between 3D local differential displacement values recorded by the Radial Link sensor and the '...
'corresponding radial deformation measured by the longest rod of the MPBX.']);
FIG = FIG+1;
ChartMPBvsRL_cap.Style = {HAlign('justify'),FontSize(Font_caption),Italic(1),Color('midnightblue')};
add(Site,ChartMPBvsRL_cap);
text = 'Displacement data refer to the following sensors: ';
testoMPB2vsRL = Paragraph(text);
testoMPB2vsRL.HAlign = 'justify';
add(Site,testoMPB2vsRL);
I = size(SensoriRL);
for a = 1:I(1)
text = ['- Rad Array ' char(CatenaRL(a,1)) ' - Node ' num2str(SensoriRL(a,1)) ...
', Analog Array ' char(CatenaMPB(a,1)),' - MPBX ' num2str(SensoriMPB(a,1)) ''];
testoMPB2vsRL = Paragraph(text);
add(Site,testoMPB2vsRL);
end
add(Site,br);
end
end
end
end
fileID = fopen(FileName,'a');
fmt = '%s \r';
text = 'report_CrossGraphs_ENG function executed correctly';
fprintf(fileID,fmt,text);
fclose(fileID);
end