clear; clc
[amplitude,TraceHeaderInfo,SegyTraceHeaders,SegyHeader]=ReadSegy('data.sgy');
%parameters
dt=4; %sampling rate
tmin=0;
tmax=2000;
notrace=2112;
time=[tmin:dt:tmax]';
%load horizon/synthetic horizon
picks=850+800*sin([1:2112]*0.003)';
picks=round(picks/dt)*dt;
%set searching window. in this case +/-12ms above and below horizon
pickminplus=[picks-(dt*3),picks-(dt*2),picks-dt,picks-0,picks+dt,picks+(dt*2),picks+(dt*3)]';
%processing
h = waitbar(0,'Processing... be patient...');
for i=1:notrace
waitbar(i/notrace)
pickminplus1{i}=pickminplus(:,i);
index{i}=find(ismember(time,pickminplus1{i}));
amplitude1{i}=amplitude(:,i);
amplitude11{i}=amplitude1{i}(index{i});
ccc1{i}=find(amplitude11{i}==max(amplitude11{i}));
ccc2(i)=ccc1{i}(1,:);
newpick(i)=pickminplus1{i}(ccc2(i));
end
close(h)
%plotting
x=[1:2112];
plot(x,picks,'b',x,newpick','r')
xlabel ('trace number')
ylabel ('TWT (ms)')
No comments:
Post a Comment