Go to the list of seismic processes.      Go to SIOSEIS introduction.
#! /bin/bash

#  vpick - velocity picker using sioseis and matlab
#  Usage: vpick filename start_rpnum [ rpnum_inc end_rpnum]
#
#  you may want to add the diskin  SET parameter (start and end time)
#  I collect all the cmp gathers into a separate file to keep the disk I/O down.
#  Paul Henkart, May 2006

declare -i start_rpnum=0 rpnum_inc=0 end_rpnum=0 
declare -i rpnum

num_args="$#"
if [ $num_args = "0" ]; then
   echo "Usage: vpick filename start_rpnum [ rpnum_inc end_rpnum]"
   exit
fi
file=$1
if [ ! -f $file ]; then
   echo "***  ERROR  ***  Could not open input file: $file"
   exit
fi
start_rpnum=$2
rpnum_inc=$3
if [ $rpnum_inc == 0 ]; then
     rpnum_inc=1
fi
end_rpnum=$4
if [ $end_rpnum == 0 ]; then
     end_rpnum=$start_rpnum
fi


matfile="vpick.mat"
vpickfile="$file.vpick"

for (( rpnum=start_rpnum; rpnum <= end_rpnum; rpnum=rpnum+rpnum_inc ))
do

   sioseis << eof
   noecho procs diskin filter agc plot velan prout end
   diskin
      fno $rpnum lno $rpnum allno no
      ipath $file end END
   filter pass 20 100 dbdrop 48 end end
   agc
      winlen .5 end END
   prout
       fno 0 lno 99999 ftr 0 ltr 99999 end
   end
   velan
       vels 1400 10 1800 nrp 1 type spec winlen .048 opath $matfile
       end
   end
   plot
      nibs 75 nsecs 0 scalar -1 trpin 20 vscale 2.5 def 0.04
      srpath sunfil.ras 
      ftag 1 taginc 100 ann rp&tr ann2 range end
   end
   end
//  eof must be in column 1 - bash is stupid
eof
   display -rotate 90 sunfil.ras &



#/Applications/MATLAB72/bin/matlab -nojvm << eof1
/Applications/MATLAB_R2010a.app/bin/matlab -nodesktop << eof1
fid = fopen('$vpickfile','a');
load $matfile;
n = size(vel);nt = n(1);
nv = n(2);
rpno = vel(1,1);
st = vel(2,1);
dt = vel(3,1);
sv = vel(4,1);
dv = vel(5,1);
vel(1,1) = 0;vel(2,1) = 0;vel(3,1) = 0;vel(4,1) = 0;vel(5,1) = 0;
x = sv:dv:sv+nv*dv-dv;
y = -st:-dt:-(st+nt*dt-dt);
contour(x,y,vel,20)
title 'rp $rpnum';
xx=[];
yy=[];
n = 0;
but = 1;
while but == 1
   [xi,yi,button] = ginput(1);
   n = n + 1;
   xx(n,1) = xi;
   yy(n,1) = yi;
   if button > 1
      but = 0;
   end
end
pause
n = size(xx);
fprintf(fid,'  fno %.0f vtp ',$rpnum);
for i = 1:n(1)
   fprintf(fid,'%.0f %.3f ',xx(i),-yy(i));
end
fprintf(fid,'end\n');
st = fclose(fid);
quit
eof1

done
echo " "