#!/bin/sh
# set -x

ARGS=$*

echo "************** Executing tfundisp with regions **************"
echo " "
tfundisp $ARGS < tregions.in

echo "************** Executing tfundisp with boxes, ellipses  **************"
echo " "
tfundisp $ARGS < tboxell.in

echo "************** Executing tfundisp with columns **************"
echo " "
tfundisp $ARGS < tcols.in

echo "************** Executing tfunhead **************"
echo " "
tfunhead $ARGS < thead.in

echo "************** Executing tfunview **************"
echo " "
tfunview $ARGS < tview.in

echo "************** Executing tfunview with alt view db **************"
echo " "
tfunview -f ./funtools2.vu $ARGS < tview.in

echo "************** Executing tfuncalc **************"
echo " "
tfuncalc < tcalc.in

echo "************** Executing tfunmerge **************"
echo " "
tfunmerge < tmerge.in

echo "************** Executing tfuncone **************"
echo " "
tfuncone < tcone.in

echo "************** Executing tfuncnts **************"
echo " "
tfuncnts $ARGS < tregions.in

echo "************** Executing tfuncnts with filter **************"
echo " "
tfuncnts $ARGS -b "pha=5:7&&pi=6:8" < tregions.in

echo "************** Executing tfuncnts with boxes, ellipses  **************"
echo " "
tfuncnts $ARGS < tboxell.in

echo "************** Executing tfundisp with paren checks **************"
echo " "
tfundisp $ARGS < tparen.in

echo "************** Executing tfundisp with filter **************"
echo " "
tfundisp $ARGS -b "pha=5:7&&pi=6:8&&" < tregions.in

echo "************** Executing tfundisp w/include file **************"
echo " "
tfundisp -i -b "pha=5:7&&pi=6:8&&" $ARGS < tregions.in

echo "************** Executing timev [*,*,2] **************"
echo " "

timev $ARGS -b "[*,*,2]" < tregions.in

echo "************** Executing timev [*,*,3] **************"
echo " "
timev $ARGS -b "[*,*,3]" < tregions.in

echo "************** Executing timev [404:603,412:611] **************"
echo " "
timev $ARGS -b "[404:603,412:611]" < tregions.in

echo "************** Executing timev [404:603,412:611,2] **************"
echo " "
timev $ARGS -b "[404:603,412:611,2]" < tregions.in

echo "************** Executing timev [404:603,412:611,3] **************"
echo " "
timev $ARGS -b "[404:603,412:611,3]" < tregions.in

echo "************** Executing tfuncnts, blocked w/phys. coords **********"
echo " "
tfuncnts -f1 ${HOME}/data/snr2.fits -c physical $ARGS < tregions.in

echo "************** Executing tfuncnts on files **************"
echo " "
tfuncnts $ARGS < tfile.in

echo "************** Executing tfundisp on files **************"
echo " "
tfundisp $ARGS < tfile.in

echo "************** Executing tfundisp w/include file **************"
echo " "
tfundisp -i -b "pha=5:7&&pi=6:8&&" $ARGS < tfile.in

echo "************** Executing tfundisp with filter2 **************"
echo " "
tfundisp $ARGS -b "(pha=5:7||pi=6:8)&&" < tregions.in

echo "************** Executing tfundisp with filter3 **************"
echo " "
tfundisp $ARGS -b "(pha=5:7,pi=6:8)&&" < tregions.in

echo "************** Executing tfunimage with sections **************"
echo " "
if [ x"$TXT" = x0 ]; then
  tfunimage $ARGS < tsections.in
else
  F2=`echo "$ARGS" | awk '{print $3}'`  
  F1=`echo $T | awk -F. '{print $1}'`.fits
  tfunimage -f $F1 $F2 < tsections.in
fi

echo "************** Executing tevread with regions **************"
echo " "
tevread $ARGS < tregions.in

echo "************** Executing tevread with column filters **************"
echo " "
tevread $ARGS < tcols.in

