#! /bin/sh
# set -x

# Demos shell for sugoupillaud
# Albena Mateeva, Jan 29, 2001


#---------------------------------------------------------------
# An example reflectivity series in rdemo.asc
#
# 2048 samples corresponding to:
#
# a surface reflection coeficient
# ( r[0]=-1.0 for this example, i.e., free surface )
#
# and 2047 subsurface interfaces (equally spaced in time).
#
#---------------------------------------------------------------

#-------- show example reflectivity ---------------

# in this example the two-way time thickness of the subsurface layers is 2ms

a2b n1=1 < rdemo.asc | suaddhead ns=2048 | sushw key=dt a=2000 > rdemo.su

suxgraph < rdemo.su label1="Time (s)" label2="Displacement Reflection \
Coeficient" title="REFLECTIVITY SERIES" x2beg=-1 x2end=1 height=600 width=300 &


    # COMPUTE AND GRAPH DISPLACEMENT SEISMOGRAMS FOR A SURFACE SOURCE: 

#------ surface seismogram --------------------------------------------

sugoupillaud < rdemo.su | suresamp | \
suxgraph label1="Time (s)" label2="Displacement" \
	 title="SURFACE SEISMOGRAM" x2beg=-1 x2end=1 height=600 width=300 &


#------ receiver burried at 250 ms (250 layers) below the surface ----- 

sugoupillaud <rdemo.su k=251 | suresamp | \
suxgraph label1="Time (s)" label2="Displacement" \
	 title="RECEIVER DEPTH 250 ms" x2beg=-1 x2end=1 height=563 width=300  &

	 	 
#------ receiver burried at 500 ms (500 layers) below the surface ----- 

sugoupillaud < rdemo.su k=501 | suresamp | \
suxgraph label1="Time (s)" label2="Displacement" \
	 title="RECEIVER DEPTH 500 ms" x2beg=-1 x2end=1 height=527 width=300  &


# REMARK: The length of these seismograms is defined by the default value
# of tmax. It coinsides with the arrival of the primary reflection from the
# deepest interface. This choice (and any smaller tmax) neutralizes the
# consequences of modelling the earth below the deepest interface as a
# homogeneous half-space.

# SUGGESTED EXERCISE: Change the surface reflection coeficient
# (the first entry in the rdemo.asc file) from -1.0 (free surface)
# to zero (no surface-related multiples) and see what happens to
# the seismograms.
 
exit 0
