#! /bin/sh
# Ground-roll  supression be K-L transform 
# Processing in 3 steps
# 1- Imaging dispersion curve by wave field transform (suphasevel)
# 2- Applaying dinamic linear move out (DLMO) to (sudlmo) 
#    flatten  the guided waves using velocity function estimated at the previous 
# 3- Extracting the guided wave using >K-L transform ( sugroll) 
#set -x
WIDTH=420
HEIGHT=400
WIDTHOFF1=0
WIDTHOFF2=430
WIDTHOFF3=860
HEIGHTOFF1=50
HEIGHTOFF2=500


#!# Set parameters
alldata=ozdata.16
pickdata=disp.pic           
parfile=disp.par


# Plot  the original data 
	
	sunormalize < $alldata  | sufilter f=18,22,60,80 | suxwigb key=offset perc=98 title=" Original data"\
				 label1="Time (sec)" label2="Distance (m)"\
				 wbox=$WIDTH hbox=$HEIGHT xbox=$WIDTHOFF1 ybox=$HEIGHTOFF1 & 
### Do dispersion analyses 

echo "Pick phase velocities by moving mouse and typing 's', type 'Q' when done"
	
	   sunormalize < $alldata | suphasevel fmax=70 dv=25 fv=1500 | suamp |  suximage mpicks=$pickdata 
	   
	   sort < $pickdata | mkparfile string1=fnmo string2=vnmo > $parfile

	   sushift < $alldata tmin=-1.0 tmax=2.5 | sudlmo par=$parfile | sugroll |\

	  sudlmo invert=1 par=$parfile | sushift tmin=0 tmax=2.5 | sufilter f=18,22,60,80 |\
	  suxwigb key=offset perc=98  label1="Time (sec)" label2="Distance (m)" \
	  wbox=$WIDTH hbox=$HEIGHT xbox=$WIDTHOFF2 ybox=$HEIGHTOFF1

# set +x
