#! /bin/sh
#### shell for  sugazmig, sumigps
#### Author: John Stockwell 7 Apr 1993

demo=gazdag
perc=99

#### Example 1 --- compute and display impulse response
### use suspike to make test data
n1=64
n2=32
suspike nspk=3 it1=16 ix1=16 it2=32 ix2=16 it3=48 ix3=16 |
sushw key=dt,d2 a=50000,.05 >syndata1
supsimage <syndata1 perc=$perc \
	title="Suspike data"\
	label1="Time (sec)" label2="Midpoint (km)" >${demo}.1.eps

### Migrate with SUGAZMIG
sugazmig <syndata1 tmig=0 vmig=1 |
supsimage  perc=$perc \
	title="SUGAZMIG Migration"\
	label1="Migrated Time (sec)" label2="Midpoint (km)" >${demo}.2.eps

### Migrate with SUMIGPS
sumigps <syndata1 tmig=0 vmig=1 |
supsimage  perc=$perc \
	title="SUMIGPS Migration"\
	label1="Migrated Time (sec)" label2="Midpoint (km)" >${demo}.3.eps

###Example 2 ---- constant velocity migration of simple syncline model
n1=101
n2=101
### use susynlv to make synthetic data
susynlv nt=$n1 dt=0.04 ft=0.0 nxo=1 \
	nxm=$n2 dxm=.05 fxm=0.0 er=0 ob=1  \
	v00=1.0 dvdz=0 dvdx=0 smooth=1 \
	ref="0,.5;1.0,.5;2.,1.0;2.5,1.5;3.0,1.0;4.0,.5;5.0,.5" |
sushw key=d2 a=.05 >syndata2
supsimage <syndata2 perc=$perc \
	title="Synthetic Data"\
	label1="Time (sec)" label2="Distance (km)" >${demo}.4.eps

###  Migrate with SUGAZMIG
sugazmig <syndata2 tmig=0 vmig=1 |
supsimage  perc=$perc \
	title="SUGAZMIG Migration"\
	label1="Migrated Time (sec)" label2="Midpoint (km)" >${demo}.5.eps

### Migrate with SUMIGPS
sumigps <syndata2 tmig=0 vmig=1 |
supsimage  perc=$perc \
	title="SUMIGPS Migration"\
	label1="Migrated Time (sec)" label2="Midpoint (km)" >${demo}.6.eps

### Example 3 ---- variable velocity migration
n1=101
n2=101
### use susynlv to make synthetic data
susynlv nt=$n1 dt=0.04 ft=0.0 nxo=1 \
	nxm=$n2 dxm=.05 fxm=0.0 er=0 ob=1  \
	v00=1.0 dvdz=.2 dvdx=0 smooth=1 \
	ref="0,.5;1.0,.5;2.,1.0;2.5,1.5;3.0,1.0;4.0,.5;5.0,.5" |
sushw key=d2 a=.05 >syndata3
supsimage <syndata3 perc=$perc \
	title="Synthetic Data"\
	label1="Time (sec)" label2="Distance (km)" >${demo}.7.eps

### Migrate with SUGAZMIG --- background velocity specified by tmig and vmig
sugazmig <syndata3 tmig=0,4 vmig=1,2.0 |
supsimage  perc=$perc \
	title="SUGAZMIG Migration"\
	label1="Migrated Time (sec)" label2="Midpoint (km)" >${demo}.8.eps

### Migrate with SUMIGPS
sumigps <syndata3 tmig=0,4 vmig=1,2.0 |
supsimage  perc=$perc \
	title="SUMIGPS Migration"\
	label1="Migrated Time (sec)" label2="Midpoint (km)" >${demo}.9.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

exit 0
