-
Notifications
You must be signed in to change notification settings - Fork 0
/
l_seismic_elastic.m
158 lines (143 loc) · 5.08 KB
/
l_seismic_elastic.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
function wlog=l_seismic_elastic(wlog,varargin)
% Function computes seismic-relevant curves such as P-velocity, S-velocity, acoustic
% impedance, and Poison's ratio provided they do not yet exist
% Function assumes that the input wlog has at least the following curves
% DTp or Vp
% DTs or Vs
% rho
% and computes the following additional curves if they do not exist
% Vp
% Vs
% PR
% aImp
%
% Written by: E. R.: December 22, 2000
% Updated: September 28, 2004: Update field "curve_types" if this field is present
%
% wlog=l_seismic_elastic(wlog,varargin)
% INPUT
% wlog log structure with at least the curves listed above
% varargin one or more cell arrays; the first element of each cell array is
% a keyword, he other elements are parameters. Presently, keywords are:
% 'fix_pr" defines what to do with PR values that are < 0 or > 0.5
% possible values are 'yes' (replace them by their limits),
% 'no', (keep them as is
% 'nan', (replace them by NaN's)
% DEfault: {fix_pr','yes'}
% new definitions of curve mnemonics of the form {'rho','RHOB')
% By default, the function uses the definitions of global structure
% CURVES as defined in function "presets"
%
% OUTPUT
% wlog log structure with all input curves and those additional curves listed
% above if they do not exist among the curves of the input log.
param.fix_pr='yes';
[param,cm]=l_assign_input(param,varargin);
% Check for existence of density
[irho,ier]=curve_index1(wlog,cm.rho);
if isempty(irho)
disp(' Log must have curve for density')
disp([' Curve mnemonics of log: ',cell2str(wlog.curve_info(:,1),', ')])
error(' Abnormal termination')
end
% Check for existence of P-velocity curve and compute it from sonic if absent
[ivp,ier]=curve_index1(wlog,cm.vp);
if isempty(ivp)
[idtp,ier]=curve_index1(wlog,cm.dtp);
if isempty(idtp)
disp(' Log must have either a P-sonic (DTP) or a P-velocity (Vp) curve')
disp([' Curve mnemonics of log: ',cell2str(wlog.curve_info(:,1),', ')])
error(' Abnormal termination')
else
nadd=1;
new_col=1.0e6./wlog.curves(:,idtp);
if strcmpi(wlog.curve_info{idtp,2},'us/m')
punits='m/s';
elseif strcmpi(wlog.curve_info{idtp,2},'us/ft')
punits='ft/s';
else
error([' Unknown units of sonic log: ', wlog.curve_info{idtp,2}])
end
new_info={cm.vp,punits,'P-velocity'};
new_curve_type={cm.vp,'Vp','sonic velocity'};
end
else
punits=wlog.curve_info{ivp,2};
nadd=0;
new_col=[];
new_info=[];
new_curve_type=[];
end
% Check for existence of S-velocity curve and compute it from shear sonic if absent
[ivs,ier]=curve_index1(wlog,cm.vs);
if isempty(ivs)
[idts,ier]=curve_index1(wlog,cm.dts);
if isempty(idts)
disp(' Log must have either a S-sonic (DTS) or an S-velocity (Vs) curve')
disp([' Curve mnemonics of log: ',cell2str(wlog.curve_info(:,1),', ')])
error(' Abnormal termination')
else
nadd=nadd+1;
new_col=[new_col,1.0e6./wlog.curves(:,idts)];
if strcmpi(wlog.curve_info{idts,2},'us/m')
sunits='m/s';
elseif strcmpi(wlog.curve_info{idts,2},'us/ft')
sunits='ft/s';
else
error([' Unknown units of shear log: ', wlog.curve_info{idts,2}])
end
new_info=[new_info;{cm.vs,punits,'S-velocity'}];
new_curve_type=[new_curve_type;{cm.vs,'Vs','shear velocity'}];
end
else
sunits=wlog.curve_info{ivs,2};
end
% Check if P-velocity and S-velocity have the same units of measurement
if ~strcmpi(sunits,punits)
disp([' P-velocity and S-velocity do not have the same units of measurement: ', ...
punits,', ',sunits])
error(' Abnormal termination')
end
if nadd > 0
wlog.curves=[wlog.curves,new_col];
wlog.curve_info=[wlog.curve_info;new_info];
wlog=add_curve_type(wlog,new_curve_type);
end
% Compute Poison's ratio if not present in input log
ivp=curve_index1(wlog,cm.vp);
[ipr,ier]=curve_index1(wlog,cm.pr);
if isempty(ipr)
ivs=curve_index1(wlog,cm.vs);
% nadd=1;
vp2=wlog.curves(:,ivp).^2;
vs2=wlog.curves(:,ivs).^2;
new_curve=0.5*(vp2-2*vs2)./(vp2-vs2);
switch param.fix_pr
case 'yes'
new_curve(new_curve > 0.5)=0.5;
new_curve(new_curve < 0)=0;
case 'nan'
new_curve(new_curve > 0.5 | new_curve < 0)=NaN;
case 'no'
% Do nothing
otherwise
alert('Unknown value for keyword "fix_par"')
end
new_info={cm.pr,'n/a','Poisson''s ratio'};
else
% nadd=0;
new_curve=[];
new_info=[];
end
% Compute acoustic impedance if not present in input log
[iaimp,ier]=curve_index1(wlog,cm.aimp);
if isempty(iaimp)
runits=wlog.curve_info{irho,2};
% nadd=nadd+1;
new_curve=[new_curve,wlog.curves(:,ivp).*wlog.curves(:,irho)];
new_info=[new_info;{cm.aimp,[punits,' x ',runits],'Acoustic impedance'}];
wlog=add_curve_type(wlog,{cm.aimp,'Imp','impedance'});
end
% Add to existing curves
wlog.curves=[wlog.curves,new_curve];
wlog.curve_info=[wlog.curve_info;new_info];