#! /bin/sh
WIDTH=350
XOFF1=380
XOFF2=760
HEIGHT=450
YOFF1=520

echo
echo
echo "HELPFUL HINT: click on any ximage window to get true colors."
echo
echo
echo ""
echo "Not making data---it is made by running Xselect1"
sleep 2

# Plot the model 
suximage <modeldata perc=99 title="Shot Gathers" \
	label1="Time (sec)" label2="Shot Gather" f2=1 d2=0.166667   \
	wbox=${WIDTH} hbox=${HEIGHT} xoff=0 yoff=0 &
 
 
######SELECTING EXAMPLES: SECOND GROUP######
# Get a stacking chart
suchart <modeldata |                     
xgraph n=72 title="Stacking Chart" label1="sx" label2="gx" \
	linecolor=2 linewidth=0 marksize=2 mark=8 \
	-geometry ${WIDTH}x${HEIGHT}+${XOFF1}+0 &

# Windowing Example
# Select middle 36 traces and the middle 100 ms of the time traces
# Remark: suwind NEVER resamples--even if you start between samples.
#         If you want resampling, use suresamp (see next few examples)
# Note that 50 * .004 = 0.2
# Note that tracl is default key for suwind, so not mentioned
suwind <modeldata min=19 count=36 |
suresamp tmin=0.2 nt=100 |
suximage perc=99 title="Windowed Shots"\
	label1="Time (sec)" label2="Traces" f2=19 d2=1 \
	wbox=${WIDTH} hbox=${HEIGHT} xoff=${XOFF2} yoff=0 &

# Windowing Example -- same thing, using suresamp
# If you don't need resampling, then suwind is fine.
suwind <modeldata min=19 count=36 |
suresamp tmin=0.2 nt=100 |
suximage perc=99 title="Windowed Shots (with suresamp)"\
	wbox=${WIDTH} hbox=${HEIGHT} xoff=0 yoff=${YOFF1} &

# Subsample to twice .004 = .008 sampling interval, note the
# typical anti-alias filtering before sub-sampling
sufilter <modeldata f=52.5,57.5,62.5 amps=1.0,0.5,0.0 |
suresamp nt=100 dt=.008 |
suximage perc=99 title="Time Subsampled Shots"\
	label1="Time (sec)" label2="Shot Gather" f2=1 d2=0.166667 \
	wbox=${WIDTH} hbox=${HEIGHT} xoff=${XOFF1} yoff=${YOFF1} &

# Interpolate time traces to half .004 = .002 sampling interval
suresamp <modeldata nt=400 dt=.002 |
suximage perc=99 title="Time Interpolated Shots"\
	label1="Time (sec)" label2="Shot Gather" f2=1 d2=0.166667 \
	wbox=${WIDTH} hbox=${HEIGHT} xoff=${XOFF2} yoff=${YOFF1} &

exit
