-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathASET_ExtrapolConc.m
107 lines (83 loc) · 3.75 KB
/
ASET_ExtrapolConc.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
function [CssExtra]=ASET_ExtrapCss(V,S,Css,Cut_back,St,CssExtraM,P,C_back)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This function extrapole the different method possible in ASET. The methods
% are: None, constant value, Linear (3pt data), Rouse distribution.
% by Dominguez Ruben, L. FICH- UNL
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
surfsize=size(C_back.zsurfback,1);
bottomsize=size(C_back.zbottomback,1);
for j=1:St.mback
if Cut_back.Backcut(1,j)<=6 %when you have least 6 valid data for ensemble
if Cut_back.Backcut1(1,j)==0
CssExtra.surf(1:surfsize,j)=nan;
else
for e=1:length(C_back.zsurfback(:,j));
if isnan(C_back.zsurfback(e,j))
CssExtra.surf(e,j)=nan;
else
CssExtra.surf(e,j)=Css(Cut_back.Backcut1(1,j),j);
end
end
end
if Cut_back.Backcut1(1,j)==0
CssExtra.bottom(1:bottomsize,j)=nan;
else
for e=1:length(C_back.zbottomback(:,j));
if isnan(C_back.zbottomback(e,j))
CssExtra.bottom(e,j)=nan;
else
CssExtra.bottom(e,j)=Css(Cut_back.Backcut2(1,j),j);
end
end
end
else %when you have more than 6 valid data for ensemble
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Sediment Extrapolation Methods
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (strcmp(CssExtraM,'CON'))%Constant Extrapolation method
[CssEx]=ASET_ExtrapCssConstant(Css,C_back,j,Cut_back);
CssExtra.bottom(:,j)=CssEx.bottom;
CssExtra.surf(:,j)=CssEx.surf;
elseif (strcmp(CssExtraM,'LSI'))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%3pt Sediment Extrapolation Method
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[CssEx]=ASET_ExtrapCss3pt(V,Css,C_back,j,Cut_back);
CssExtra.bottom(:,j)=CssEx.bottom;
CssExtra.predbottom(:,j)=CssEx.predbottom;
CssExtra.surf(:,j)=CssEx.surf;
CssExtra.predsurf(:,j)=CssEx.predsurf;
elseif (strcmp(CssExtraM,'RSI'))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Rouse Sediment Extrapolation Method
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[CssEx]=ASET_ExtrapCssRouse(V,Css,C_back,P,S,j,Cut_back);
CssExtra.pred(:,j)= CssEx.pred;
CssExtra.bottom(:,j) = CssEx.bottom;
CssExtra.surf(:,j) = CssEx.surf;
CssExtra.Ca(:,j)=CssEx.Ca;
CssExtra.NRouse(:,j)=CssEx.NRouse;
CssExtra.a(:,j)=CssEx.a;
CssExtra.zpred(:,j)=CssEx.zpred;
CssExtra.acoezpred(:,j)=CssEx.acoezpred;
CssExtra.acoezbottom(:,j)= CssEx.acoezbottom;
CssExtra.acoezsurf(:,j) = CssEx.acoezsurf;
CssExtra.rcuad(:,j)=CssEx.rcuad;
CssExtra.ustarrouse(:,j)=CssEx.ustarrouse;
end
% If extrapolation is bad use the constant extrapolation method
if isreal(CssExtra.bottom(:,j)) | isreal(CssExtra.surf(:,j))
else
[CssEx]=ASET_ExtrapCssConstant(Css,C_back,j,Cut_back);
CssExtra.bottom(:,j)=CssEx.bottom;
CssExtra.surf(:,j)=CssEx.surf;
end
end
end
%Control the value calculate and delete the bad data
CssExtra.bottom(CssExtra.bottom==Inf)=nan;
CssExtra.bottom(CssExtra.bottom==-Inf)=nan;
CssExtra.bottom(CssExtra.bottom<0)=nan;
CssExtra.surf(CssExtra.surf==Inf)=nan;
CssExtra.surf(CssExtra.surf==-Inf)=nan;
CssExtra.surf(CssExtra.surf<0)=nan;