-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathl_gc.m
60 lines (53 loc) · 1.66 KB
/
l_gc.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
function [curve,info]=l_gc(wlog,mnem,depths)
% Function extracts curve with mnemonic "mnem" from log data set "wlog"
% If global variable S4M.case_sensitive is set to false, the case of the curve
% mnemonic is disregarded.
%
% See also: l_gu, l_gd
%
% Written by: E. Rietsch, December 28, 2000
% Last updated: May 12, 2008: Improved display of curve mnemonics using "disps"
%
% [curve,info]=l_gc(wlog,mnem,depths)
% INPUT
% wlog log structure
% mnem curve mnemonic
% depths optional vector of depth values for which the curve values are
% required; these values need not coincide with depth values in "wlog".
% if not given, all samples of curve are output
% OUTPUT
% curve column vector with curve
% info relevant row of "wlog.curve_info" with mnemonic name, units of
% measurement, and description
% UPDATE HISTORY
% July 27, 2003; second output argument
global S4M
mnems=wlog.curve_info(:,1);
if S4M.case_sensitive
idx=find(ismember(mnems,mnem));
else
idx=find(ismember(lower(mnems),lower(mnem)));
end
if ~isempty(idx) && length(idx) == 1
if nargin == 2
curve=wlog.curves(:,idx);
else
if wlog.step > 0
curve=interp1(wlog.curves(:,1),wlog.curves(:,idx),depths,'*linear');
else
curve=interp1q(wlog.curves(:,1),wlog.curves(:,idx),depths);
end
end
if nargout == 2
info=wlog.curve_info(idx,:);
end
return
end
% Handle error condition
if isempty(idx)
disp([' Curve "',mnem,'" not found. Available curves are:'])
disps(cell2str(mnems,', '))
else
disps([' More than one curve found: ',cell2str(mnems(idx),', ')])
end
error(' Abnormal termination')