#! /bin/sh
# set -x

# Demos shell 3 for supickamp
# Andreas Rueger, Feb 18,1997


#------------------------------------
# Create an su Data set with :
#
#     32 traces in input file
# tracl=32 tracr=32 offset=400 ns=64 dt=4000
#
#------------------------------------

temp=pickdata.bin
mouse=window.data

#-------- create data set ---------------------
suplane dip2=3 |sufilter f=10,20,40,50  > $temp


#--  Lets try to isolate  events using mouse clicks
#--
#--  search window determined by file $mouse
#--  and windowlength parameter <wl>
#--  time sampling within search window is <dt_resamp>


# -----------------------------------------
# first mouse-pick upper window coordinates
# using xgraph. See xgraph documentation for
# details on mouse clicks.
# -----------------------------------------

echo
echo "Make mouse picks on each trace by placing"
echo "the cursor on the point to be picked, and typing"
echo "the letter  s . When you are finished picking,"
echo "type q to quit."
echo
echo "The idea is to pick points at a time earlier than"
echo "the point of maximum amplitude on the traces and"
echo "to let supickamp find the true maximum."

suxwigb <$temp perc=100 hbox=600 wbox=400 \
        d2=1 f2=0 mpicks=$mouse \
        label1="Time (s)" label2="Trace # " 

supickamp <$temp \
	format=binary d2=1 x2beg=0 verbose=1 \
	dt_resamp=0.001 \
	t_xabove=$mouse wl=0.01 \
	arg2=tmax arg1=i2 outpar=pick.info |
xgraph 	label1="Time (s)" label2="Trace # " \
	title="Maxima" \
	d1num=0.05 d2num=5 \
	x1beg=0 x1end=0.25 \
	grid1=dot grid2=dot \
	mark=0 marksize=15 linewidth=0 \
	n=32 height=600 width=400 style=seismic &
 
exit
