#! /bin/csh

# proc Boomer

# select window, band pass, AGC or T^2 gain:
  suwind key=fldr min=$1 max=$2 tmin=$3 tmax=$4 verbose=0 < $5.su | \
  sufilter f=150,200,1500,1700 | \
 sugain scale=1 tpow=2 > $5.tmp
 #sugain scale=1 panel=1 agc=1 wagc=0.02 > $5.tmp

set numtraces = `expr $2 - $1`
echo $numtraces
set wbox = `expr $numtraces / 50`
echo $wbox

# PLOT POSTSCRIPT IMAGE
 supswigb wbox=$wbox hbox=10 \
 ybox=0.5 \
 d1num=0.05 d2num=100 \
 n1tic=5 n2tic=5 \
 d1=0.000333 d2=1 \
 nbpi=300 \
# f2=1 \
 perc=85 bias=0.0\
# bperc=10  wclip=10 \
 grid1=dot grid2=dot \
  title="APEX 98013 Water Gun (elics) $5 Traces $1-$2" \
 label1="TWT [s]" label2="FFID" \
 < $5.tmp > $5$6.ps

rm $5.tmp

#tduseismic $5$6

#makegif $5$6
gv -portrait $5$6.ps
