#! /bin/sh
# Authors: Jack Cohen, John Stockwell--03/94

demo=synlv

#Remark: Since synlv puts 10^3 in header fields internally,
#        use kilo_units in distances and velocities

######Common parameters for demo######
v00=5.0     # P-wave velocity at surface
dvdx=1.0    # velocity gradient (dv/dx)
dvdz=2.0    # velocity gradient (dv/dz)
nt=351 dt=0.004
fpeak=25.0  # should be <= half nyquist to avoid spatial aliasing


######Common Shot gathers (specify nxs, fxs, dxs)######

# Hint: Keep shots well away from the boundaries to avoid edge contributions.
#       Here, model goes from 0 to 12, first shot at fxs=4.0, last receiver
#       roughly at fxs + nxs*dxs + nxo*dxo = 5.6

#  ref="1:1,2;4,2"      reflector(s):  "amplitude:x1,z1;x2,z2;x3,z3;..."
REF1="1.0:0.0,1.0;12.0,1.0"
REF2="0.7:0.0,1.6;12.0,3.6"
REF3="0.5:0.0,4.2;2.0,3.5;5.0,4.2;7.0,4.7;12.0,4.2"
nxo=16 fxo=0.1 dxo=0.1   # offset information: number, first, spacing
nxs=6  fxs=4.0 dxs=0.1   # shot information: number, first, spacing
ob=0  	 		 # to eliminate the turned ray contribution

susynlv v00=$v00 dvdx=$dvdx dvdz=$dvdz \
		nt=$nt dt=$dt verbose=0 \
		ref=$REF1 ref=$REF2 ref=$REF3 \
		nxo=$nxo fxo=$fxo dxo=$dxo \
		nxs=$nxs fxs=$fxs dxs=$dxs \
		ob=$ob fpeak=$fpeak ndpfz=10 |
supsimage perc=99 title="Shot Gathers" \
	label1="Time (sec)" label2="Shot Gather"\
	 f2=1 d2=0.0625 >${demo}.1.eps
# Note: 16 offsets at nominal unit spacing (tracr), so d2 = 1/16 = 0.0625


# Include turned ray contributions: ob=1 (these are weak!)
#  ref="1:1,2;4,2"      reflector(s):  "amplitude:x1,z1;x2,z2;x3,z3;..."
REF1="0.5:0.0,1.0;12.0,1.0"
REF2="1.0:0.0,1.6;12.0,3.6"
REF3="0.5:0.0,4.2;2.0,3.5;5.0,4.2;7.0,4.7;12.0,4.2"
nxo=64 fxo=0.1 dxo=0.1   # offset information: number, first, spacing
nxs=2  fxs=4.0 dxs=0.1   # shot information: number, first, spacing
ob=1			 # include turned ray contribution

susynlv v00=$v00 dvdx=$dvdx dvdz=$dvdz \
		nt=$nt dt=$dt verbose=0 \
		ref=$REF1 ref=$REF2 ref=$REF3 \
		nxo=$nxo fxo=$fxo dxo=$dxo \
		nxs=$nxs fxs=$fxs dxs=$dxs \
		ob=$ob fpeak=$fpeak ndpfz=10 |
supsimage perc=99 title="Shot Gathers with Turned Rays" \
	label1="Time (sec)" label2="Shot Gather" \
	f2=1 d2=0.015625 f2num=1 d2num=1 >${demo}.2.eps
# Note: nxo=64, so d2 = 1/nxo = 0.015625

#########################################################


######Common Midpoint gathers (specify nxm, fxm, dxm)######
#  ref="1:1,2;4,2"      reflector(s):  "amplitude:x1,z1;x2,z2;x3,z3;..."
REF1="1.0:0.0,1.0;12.0,1.0"
REF2="0.7:0.0,1.6;12.0,3.6"
REF3="0.5:0.0,4.2;12.0,4.2"
nxo=16 fxo=0.1 dxo=0.1   # offset information: number, first, spacing
nxm=6  fxm=4.0 dxm=0.1   # midpoint information: number, first, spacing
ob=0  	 		 # to eliminate the turned ray contribution
nt=351 dt=0.004

susynlv v00=$v00 dvdx=$dvdx dvdz=$dvdz \
		nt=$nt dt=$dt verbose=0 \
		ref=$REF1 ref=$REF2 ref=$REF3 \
		nxo=$nxo fxo=$fxo dxo=$dxo \
		nxm=$nxm fxm=$fxm dxm=$dxm \
		ob=$ob fpeak=$fpeak ndpfz=10 |
supsimage perc=99 title="Midpoint Gathers" \
	label1="Time (sec)" label2="Midpoint Gather" \
	 f2=1 d2=0.0625 >${demo}.3.eps
# Note: 16 offsets at nominal unit spacing (tracr), so d2 = 1/16 = 0.0625


#########################################################

######Common Offset Section generated by subsetting common shot gathers#####

#  ref="1:1,2;4,2"      reflector(s):  "amplitude:x1,z1;x2,z2;x3,z3;..."
REF1="1.0:0.0,1.0;12.0,1.0"
REF2="0.8:0.0,1.01;12.0,6.0"
nxo=2  fxo=0.1 dxo=0.1   # offset information: number, first, spacing
nxs=32 fxs=4.0 dxs=0.05  # shot information: number, first, spacing
ob=0  	 		 # to eliminate the turned ray contribution

susynlv v00=$v00 dvdx=$dvdx dvdz=$dvdz \
		nt=$nt dt=$dt verbose=0 \
		ref=$REF1 ref=$REF2 \
		nxo=$nxo fxo=$fxo dxo=$dxo \
		nxs=$nxs fxs=$fxs dxs=$dxs \
		ob=$ob fpeak=$fpeak ndpfz=10 |
suwind key=offset min=200 max=200 |
supsimage perc=99 title="Common Offset 200" \
	label1="Time (sec)" label2="Trace" f2=1 d2=1 >${demo}.4.eps

echo 
echo "Output PostScript files:"

echo -n "     "
for i in ${demo}.*.eps
do
	 echo -n "$i "
done
echo
echo "You may view these with your PostScript Previewer"

exit 0
