⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s_rm_zeros.m

📁 matlab源代码
💻 M
字号:
function seismic=s_rm_zeros(seismic)
% Function removes common zeros at the beginning and end of traces and
% adjusts start and end times
% Written by: E. R.
% Last updated: October 19, 2003: Input and output argument are the same
%
%             seismic=s_rm_zeros(seismic)
% INPUT
% seismic     seismic data set
% OUTPUT
% seismic     seismic after removal of common leading and trailing zeros

nsamp=size(seismic.traces,1);

test=max(abs(seismic.traces),[],2);
index=find(test > 0);
if isempty(index)
   error(' Traces are identically zero')
end
seismic.traces=seismic.traces(index(1):index(end),:);
seismic.first=seismic.first+(index(1)-1)*seismic.step;
seismic.last=seismic.last-(nsamp-index(end))*seismic.step;

seismic=s_history(seismic,'append', ...
       [num2str(nsamp-size(seismic.traces,1)),' leading/trailing zeros removed']);

⌨️ 快捷键说明

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