#! /bin/sh
# Invert the data created by CSHOT

recordfile=record

echo "Run time information being stored in file:  $recordfile"
>$recordfile

################
cd inversion.dir	# where inversion files are
################

echo " Please standby. The inversion takes about 5 minutes."

(
### Preprocessing
/bin/rm -f DATA1
cz1in <data1in

/bin/rm -f PTRACES
cz1

### Inversion
cxzcs

) > $recordfile 2>&1

sleep 20

/bin/mv -f $recordfile ..
echo "run time info now in file:  $recordfile"

### Strip the Fortran bytes
ftnstrip <reflect >reflect.strip;       /bin/mv -f reflect.strip reflect
ftnstrip <reflectcos >reflectcos.strip; /bin/mv -f reflectcos.strip reflectcos

### Plot the sections
xmovie <reflect n1=301 n2=48 d1=40 d2=80 f2=4000. perc=99 style=seismic \
	-geometry 560x430+50+570 \
	title=" Inversion (R)" \
	label1=" Depth(ft)"  label2=" Midpoint(ft)" &

xmovie <reflectcos n1=301 n2=48 d1=40 d2=80 f2=4000. perc=99 style=seismic \
	-geometry 560x430+650+570 \
	title=" Inversion (R * cos)" \
	label1=" Depth(ft)"  label2=" Midpoint(ft)" &
