summaryrefslogtreecommitdiffstats
path: root/funtools/funtest/funcones
diff options
context:
space:
mode:
Diffstat (limited to 'funtools/funtest/funcones')
-rwxr-xr-xfuntools/funtest/funcones61
1 files changed, 61 insertions, 0 deletions
diff --git a/funtools/funtest/funcones b/funtools/funtest/funcones
new file mode 100755
index 0000000..fcf2457
--- /dev/null
+++ b/funtools/funtest/funcones
@@ -0,0 +1,61 @@
+#!/bin/sh
+# fundisp keyfile | funcones [datafile] [radius]
+set -x
+
+# first argument: input file name
+if [ x$1 = x ]; then
+ echo "usage: $0 file < keyfile"
+ exit 1
+else
+ FILE=$1
+ OBASE=`basename $FILE | awk -F. '{x=NF-1;print $x}'`
+ shift
+fi
+
+# second argument: input file's RA column name and units
+if [ x$1 = x ]; then
+ RACOL="RA:h"
+else
+ RACOL=$1
+ shift
+fi
+
+# third argument: input file's DEC column name and units
+if [ x$1 = x ]; then
+ DECCOL="DEC:d"
+else
+ DECCOL=$1
+ shift
+fi
+
+# fourth optional arg: radius
+if [ x$1 = x ]; then
+ RAD=".1d"
+else
+ RAD=$1
+fi
+
+# make sure input file is available
+if [ ! -r $FILE ]; then
+ echo "ERROR: $FILE not found"
+ exit 1
+fi
+
+# read column names
+read COLS
+# skip dashes
+read DASHES
+
+i=1
+# read each line into its column names
+while read $COLS
+do
+# output filename just has a number id
+ OFILE=${OBASE}_${i}.mat
+# display relationship between id and ra, dec
+ echo "${OFILE} ${RA} ${DEC} ${SEP}"
+# specific funcone command line goes here (add unit specifiers, etc.)
+funcone -r ${RACOL} -d ${DECCOL} ${FILE}'[1]' ${OFILE} ${RA}d ${DEC} ${RAD}
+# exit
+ i=`echo "$i+1" | bc`
+done