l_rename.m

来自「地震、测井方面matlab代码,解释的比较详细」· M 代码 · 共 55 行

M
55
字号
function wlog=l_rename(wlog,varargin)
% Function replaces one or more curve mnemonics by new ones
% The function also works with structure arrays.
% Written by: E. R., December 24, 2000
% Last updated: November 8, 2004: update also field "curve_types (if it exists).                
%
%          wlog=l_rename(wlog,varargin)
% INPUT
% wlog     log structure or structure array
% varargin  two-element cell arrays. The first element is a string representing an existing
%          curve mnemonic, the second is the desired curve mnemonic. If S4M.case_sensitive == 0, the
%          existing curve mnemonic is not case sensitive.
% OUTPUT
% wlog   log structure or structure array with the new header mnemonics
%
% EXAMPLE
%       wlog=l_rename(wlog,{'DT','DTP'},{'RHOB','rho'})  % Change 'DT' to 'DTP' and 'RHOB' to 'rho'
%
%       See also function "l_curve" with "option" 'rename'

global S4M

for kk=1:length(wlog)
   for ii=1:length(varargin)
      mnems=varargin{ii};
      if size(mnems) ~= 2
         disp(mnems)
         error(' Input arguments: old and new header mnemonic must be represented as a two-element cell')
      end

      idx=curve_index1(wlog(kk),mnems{1});

      %		Check if new mnemonic already exists
      wlog(kk).curve_info(idx,1)=mnems(2);
      wlog(kk).curve_info=description_substitution(wlog(kk).curve_info);
      if isfield(wlog(kk),'curve_types')
         if S4M.case_sensitive
            idx=find(ismember(wlog(kk).curve_types(:,1),mnems{1}));
         else
            idx=find(ismember(lower(wlog(kk).curve_types(:,1)),lower(mnems{1})));
         end
         if ~isempty(idx)
            wlog(kk).curve_types(idx,1)=mnems(2);
         end
      end
      ier=l_check(wlog(kk));
      if ier
         warning('Possible inconsistency in the well log')
      end   
   end
   
end


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?