-
Notifications
You must be signed in to change notification settings - Fork 0
/
calculateErrorBetweenMarginTrajectory.m
207 lines (190 loc) · 6.55 KB
/
calculateErrorBetweenMarginTrajectory.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
clear all
clc
%%load saved data
strata=load('C:\EquinorProject\Meeting\28Apr\WaveNorth\strata.mat');
glob.strata=strata.strata;
numberOfLayers=load('C:\EquinorProject\Meeting\28Apr\WaveNorth\numberOfLayers.mat');
glob.numberOfLayers=numberOfLayers.numberOfLayers;
facies=load('C:\EquinorProject\Meeting\28Apr\WaveNorth\facies.mat');
glob.facies=facies.facies;
glob.ySize=size(glob.strata,1);
glob.xSize=size(glob.strata,2);
iteration=size(glob.strata,3);
glob.dx=250; %cell size
deltaT=100; %calculate platform margin at every 100 iterations
T=linspace(deltaT,iteration,iteration/deltaT);
% %%for diagonal cross section where y=x;
% long=min(glob.xSize,glob.ySize);
% gradDiag=zeros(long,iteration);
% PfDiag=zeros(long,iteration);
% Zdiag=zeros(long,iteration);
% for y=1:long-1
% xPos=y;
% for t=2:iteration
%
% g=glob.strata(y+1,xPos+1,t)-glob.strata(y,xPos,t);
% gradDiag(y,t)=g/25;
% for m=1:glob.numberOfLayers(y,xPos,t)
% if glob.facies{y+1,xPos,t}(1)==10 && glob.facies{y,xPos,t}(m)==1
% PfDiag(y,t)=1;
% Zdiag(y,t)=glob.strata(y,xPos,t);
% elseif glob.facies{y,xPos,t}(m)==10 && glob.facies{y,xPos,t}(m)==11 && glob.facies{y+1,xPos,t}(1)==1
% PfDiag(y,t)=1;
% end
% end
%
%
% end
%
% end
% gradDiag(gradDiag>1)=1;
% gradDiag=abs(gradDiag);
% for i=1:length(T)
% t=T(i);
% PDiag(:,i)=gradDiag(:,t).*PfDiag(:,t);
% end
% [Xdiag,Zdiag] = find(PDiag);
% for i=1:size(Xdiag,1)
% Z2diag(i)=glob.strata(Xdiag(i),Xdiag(i),Zdiag(i)*deltaT);
% end
% figure
% subplot(2,1,1)
% scatter(Xdiag,Zdiag,200,'r');
% ylabel('EMT','FontSize',18,'FontWeight','bold');
% xlabel('km','FontSize',18,'FontWeight','bold');
% title(['Diagonal, t= ', num2str(0.001*iteration),'My'],'FontSize',20);
% xticks([1, 0.25*(long+2), 0.5*(long+2), 0.75*(long+2),long+1]);
% xticklabels (round([0 ,long*1.414*glob.dx/4000 ,long*1.414*glob.dx/2000,long*1.414*3*glob.dx/4000,long*1.414*glob.dx/1000]));
% % yticks([0 ,5, 10]);
% % yticklabels ([0 0.5*iteration/1000,iteration/1000]);
% axis([1 long+1 0 iteration/deltaT])
% ax=gca;
% ax.LineWidth = 0.6;
% ax.FontSize = 24;
% ax.FontWeight = 'bold';
%
% subplot(2,1,2)
% scatter(Xdiag,Z2diag,200,'r');
% ylabel('Elevation (m)','FontSize',18,'FontWeight','bold');
% xlabel('km','FontSize',18,'FontWeight','bold');
% xticks([1, 0.25*(long+2), 0.5*(long+2), 0.75*(long+2),long+1]);
% xticklabels (round([0 ,long*1.414*glob.dx/4000 ,long*1.414*glob.dx/2000,long*1.414*3*glob.dx/4000,long*1.414*glob.dx/1000]));
% % yticks([0 ,5, 10]);
% % yticklabels ([0 0.5*iteration/1000,iteration/1000]);
% axis([1 long+1 0 1500])
% ax=gca;
% ax.LineWidth = 0.6;
% ax.FontSize = 24;
% ax.FontWeight = 'bold';
%%for othogonal cross section along y axis
xPos=glob.xSize/2;
gradY=zeros(glob.ySize,iteration); %to store elevation difference between adjacent cells
Pfy=zeros(glob.ySize,iteration); %to store probability of facies transition
Zy=zeros(glob.ySize,iteration); %to store elevation values of platform margins
for y=1:glob.ySize-1
for t=2:iteration
g=glob.strata(y+1,xPos,t)-glob.strata(y,xPos,t);
gradY(y,t)=g/50;
for m=1:glob.numberOfLayers(y,xPos,t)
if glob.facies{y+1,xPos,t}(1)==10 && glob.facies{y,xPos,t}(m)==1
Pfy(y,t)=1;
Zy(y,t)=glob.strata(y,xPos,t);
elseif glob.facies{y,xPos,t}(m)==10 && glob.facies{y,xPos,t}(m)==11 && glob.facies{y+1,xPos,t}(1)==1
Pfy(y,t)=1;
end
end
end
end
%turn the calculated gradient into a value between 0 and 1
gradY(gradY>1)=1;
gradY=abs(gradY);
for i=1:length(T)
t=T(i);
Py(:,i)=gradY(:,t).*Pfy(:,t);
end
[X1,Z] = find(Py);
for i=1:size(X1,1)
Z2(i)=glob.strata(X1(i),xPos,Z(i)*deltaT);
end
%%plot figure in time
figure
subplot('Position',[0.14, 0.55, 0.72 0.35])
scatter(X1,Z,200,'r');
ylabel('EMT','FontSize',18,'FontWeight','bold');
xlabel('y(km)','FontSize',18,'FontWeight','bold');
title(['t= ', num2str(0.001*iteration),'My'],'FontSize',20);
xticks([1 10 20 30 40 50 60 70 80 90 100]);
xticklabels (0:(glob.dx/100):20);
% yticks([0 ,5, 10]);
% yticklabels ([0 0.5*iteration/1000,iteration/1000]);
axis([1 glob.ySize 0 iteration/deltaT])
ax=gca;
ax.LineWidth = 0.6;
ax.FontSize = 24;
ax.FontWeight = 'bold';
%%for othogonal cross section along x axis
yPos=glob.ySize/2;
gradX=zeros(glob.xSize,iteration);
Pfx=zeros(glob.xSize,iteration);
for x=1:glob.xSize-1
for t=2:iteration
g=glob.strata(yPos,x+1,t)-glob.strata(yPos,x,t);
gradX(x,t)=g/50;
for m=1:glob.numberOfLayers(yPos,x,t)
if glob.facies{yPos,x+1,t}(1)==10 && glob.facies{yPos,x,t}(m)==1
Pfx(x,t)=1;
elseif glob.facies{yPos,x,t}(m)==10 && glob.facies{yPos,x,t}(m)==11 && glob.facies{yPos,x+1,t}(1)==1
Pfx(x,t)=1;
end
end
end
end
gradX(gradX>1)=1;
gradX=abs(gradX);
[row, col] = find(Pfx(:,1:iteration)>0);
for i=1:length(T)
t=T(i);
Px(:,i)=gradX(:,t).*Pfx(:,t);
end
[X2,Z] = find(Px);
for i=1:size(X2,1)
Z3(i)=glob.strata(yPos,X2(i),Z(i)*deltaT);
end
subplot('Position',[0.14, 0.1, 0.68 0.35])
scatter(X2,Z,200,'r');
ylabel('EMT','FontSize',18,'FontWeight','bold');
xlabel('x(km)','FontSize',18,'FontWeight','bold');
xticks([1 10 20 30 40 50 60 70 80 90 100]);
xticklabels (0:(glob.dx/100):20);
% yticks([0 ,5, 10]);
% yticklabels ([0 0.5*iteration/1000,iteration/1000]);
axis([1 glob.xSize 0 iteration/deltaT])
ax=gca;
ax.LineWidth = 0.6;
ax.FontSize = 24;
ax.FontWeight = 'bold';
%%plot cross section in depth
figure
subplot('Position',[0.14, 0.55, 0.72 0.35])
scatter(X1,Z2,200,'r');
ylabel('Elevation (m)','FontSize',18,'FontWeight','bold');
xlabel('y(km)','FontSize',18,'FontWeight','bold');
title(['t= ', num2str(0.001*iteration),'My'],'FontSize',20);
xticks([1 10 20 30 40 50 60 70 80 90 100]);
xticklabels (0:(glob.dx/100):20);
axis([1 glob.ySize 0 1500])
ax=gca;
ax.LineWidth = 0.6;
ax.FontSize = 24;
ax.FontWeight = 'bold';
subplot('Position',[0.14, 0.1, 0.68 0.35])
scatter(X2,Z3,200,'r');
ylabel('Elevation (m)','FontSize',18,'FontWeight','bold');
xlabel('x(km)','FontSize',18,'FontWeight','bold');
xticks([1 10 20 30 40 50 60 70 80 90 100]);
xticklabels (0:(glob.dx/100):20);
axis([1 glob.xSize 0 1500])
ax=gca;
ax.LineWidth = 0.6;
ax.FontSize = 24;
ax.FontWeight = 'bold';