1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
|
StartDS9 () {
if [ `xpaaccess ds9` = no ]; then
ds9 &
i=1
while [ "$i" -le 30 ]
do
sleep 2
if [ `xpaaccess ds9` = yes ]; then
break
fi
i=`expr $i + 1`
done
fi
}
# which/where/what
which=$1
shift
where=$1
shift
what=$1
shift
save=$1
shift
# slow down?
slow=0
if [ "$1" = "slow" ]; then
slow=1
shift
fi
echo
echo "*** $which ***"
# Command Line
if [ "$1" = "command" -o -z "$1" ]; then
echo "Testing Command Line File"
for f in $where/*
do
echo " ${f#$where/}"
opt="-$what $f -sleep .1"
if [ $slow = "1" ]; then
opt="$opt -sleep 1"
fi
ds9 $opt -exit
done
echo "PASSED"
fi
# Stdin
if [ "$1" = "stdin" -o -z "$1" ]; then
echo "Testing Stdin File"
for f in $where/*
do
echo " ${f#$where/}"
opt="-$what - -sleep .1"
if [ $slow = "1" ]; then
opt="$opt -sleep 1"
fi
cat $f | ds9 $opt -exit
done
echo "PASSED"
fi
# Save
if [ "$1" = "$save" -o -z "$1" ]; then
echo "Testing Command $save"
for f in $where/*
do
echo " ${f#$where/}"
opt="-tile -$what $f"
opt="$opt -$save $what foo.fits"
opt="$opt -frame new -$what foo.fits -sleep .1"
if [ $slow = "1" ]; then
opt="$opt -sleep 1"
fi
opt="$opt -frame delete"
ds9 $opt -exit
done
echo "PASSED"
fi
# XPA
if [ "$1" = "xpa" -o -z "$1" ]; then
echo "Testing XPA File"
StartDS9
for f in $where/*
do
echo " ${f#$where/}"
xpaset -p ds9 $what $f
if [ $slow = "1" ]; then
sleep 1
fi
xpaset -p ds9 frame clear
done
xpaset -p ds9 quit
echo "PASSED"
fi
# XPA stdin
if [ "$1" = "xpastdin" -o -z "$1" ]; then
echo "Testing XPA Stdin"
StartDS9
for f in $where/*
do
echo " ${f#$where/}"
cat $f | xpaset ds9 $what
if [ $slow = "1" ]; then
sleep 1
fi
xpaset -p ds9 frame clear
done
xpaset -p ds9 quit
echo "PASSED"
fi
# XPA stdout
if [ "$1" = "xpastdout" -o -z "$1" ]; then
echo "Testing XPA Stdout"
StartDS9
for f in $where/*
do
echo " ${f#$where/}"
xpaset -p ds9 tile
xpaset -p ds9 $what $f
xpaget ds9 $what > foo.fits
xpaset -p ds9 frame new
xpaset -p ds9 $what foo.fits
if [ $slow = "1" ]; then
sleep 1
fi
xpaset -p ds9 frame delete
xpaset -p ds9 frame clear
done
xpaset -p ds9 quit
echo "PASSED"
fi
rm -f foo.*
echo "DONE"
|