function refsection(seis,beg,dt,aflag,color,delta,lf,hf,tshift); % REFSECTION(SEIS,BEG,DT,AFLAG,DELTA,LF,HF,TSHIFT) plots a seismogram section % of seismograms in 2D array SEIS. BEG is begin time of section, DT is sample % interval and AFLAG determines amplitude scaling. If AFLAG < 0 each trace is % scaled to its maximum amplitude, if AFLAG = 0 each trace is scaled to the % maximum amplitude of the entire section, and if AFLAG > 0 then each trace is % scaled to that amplitude (note this option allows direct comparison of plots % produced by different calls to SECTION). COLOR controls the color of the % record section (e.g., 'k' for black). DELTA is and array containing the % position of the geophones (can be left empty []). LF and HF are low and high % cutoff frequencies for bandpass filtering (no filtering is applied if they % are left blank). TSHIFT is a time shift that is be applied to the entire % section (no time shift is applied is TSHIFT=0 or []). % S.R. 1/20/08 ny=size(seis,1); nt=size(seis,2); if nargin < 4 aflag=-1; color='k'; delta=[]; lf=[]; hf=[]; tshift=0; end if isempty(tshift) tshift=0; end if isempty(delta) delta=[1:ny]; end ddelta=min(delta-[0 delta(1:end-1)]); % precondition seis for iy=1:ny seis(iy,:)=seis(iy,:)-mean(seis(iy,:)); seis(iy,:)=detrend(seis(iy,:)); seis(iy,:)=taper(seis(iy,:),0.001,dt,0.0011,nt*dt-0.0011); end if ~isempty(lf) seis=bpfilt(seis,dt,lf,hf); end if (tshift~=0) seis=ttshift(seis,dt,tshift); if tshift>0 seis=taper(seis,0.001,dt,tshift+0.001,-1); else seis=taper(seis,0.001,dt,-1,nt*dt+tshift-0.001); end end for iy=1:ny seis(iy,:)=seis(iy,:)-mean(seis(iy,:)); seis(iy,:)=detrend(seis(iy,:)); seis(iy,:)=taper(seis(iy,:),0.001,dt,0.0011,nt*dt-0.0011); end yaxe=[1:ny]; if aflag < 0 for iy=1:ny xymat(iy,:)=delta(iy)-ddelta*seis(iy,:)/max(abs(seis(iy,:))+0.0000001); cxymat(iy,:)=delta(iy)-ddelta*( (sign(seis(iy,:))+1)/2 ) .* seis(iy,:) /max(abs(seis(iy,:))+0.0000001); end elseif aflag == 0 for iy=1:ny xymat(iy,:)=delta(iy)-ddelta*seis(iy,:)/max(max(abs(seis))+0.0000001); cxymat(iy,:)=delta(iy)-ddelta*( (sign(seis(iy,:))+1)/2 ) .* seis(iy,:) /max(max(abs(seis))+0.0000001); end else for iy=1:ny xymat(iy,:)=delta(iy)-ddelta*seis(iy,:)/aflag; cxymat(iy,:)=delta(iy)-ddelta*( (sign(seis(iy,:))+1)/2 ) .* seis(iy,:) /aflag; end end time=[0:nt-1]*dt+beg; plot(xymat,time,[color,'-']); hold on for iy=1:ny hh=fill(cxymat(iy,:),time,color); set(hh,'LineStyle','none') set(hh,'EdgeColor',[1 1 1]) end hold off ylabel('Time [seconds]') xlabel('Distance [meters]')