summaryrefslogtreecommitdiffstats
path: root/funtools/funindex.tmpl
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2016-10-26 21:13:00 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2016-10-26 21:13:00 (GMT)
commitda2e3d212171bbe64c1af39114fd067308656990 (patch)
tree9601f7ed15fa1394762124630c12a792bc073ec2 /funtools/funindex.tmpl
parent76b109ad6d97d19ab835596dc70149ef379f3733 (diff)
downloadblt-da2e3d212171bbe64c1af39114fd067308656990.zip
blt-da2e3d212171bbe64c1af39114fd067308656990.tar.gz
blt-da2e3d212171bbe64c1af39114fd067308656990.tar.bz2
rm funtools for update
Diffstat (limited to 'funtools/funindex.tmpl')
-rwxr-xr-xfuntools/funindex.tmpl98
1 files changed, 0 insertions, 98 deletions
diff --git a/funtools/funindex.tmpl b/funtools/funindex.tmpl
deleted file mode 100755
index 0bdbe44..0000000
--- a/funtools/funindex.tmpl
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/bin/sh
-# set -x
-
-# initialize
-doascii=false
-doverbose=true
-gz=cat
-
-# process switches
-while [ x"$1" != x ]; do
- case $1 in
- -a) doascii=true
- shift
- continue;;
-
- -c) gz="gzip -c"
- shift
- continue;;
-
- -f) doascii=false
- shift
- continue;;
-
- -l) doverbose=true
- shift
- continue;;
-
- -s) doverbose=false
- shift
- continue;;
-
- *) break;;
- esac
-done
-
-# check for required arguments
-if [ x"$2" = x ]; then
- echo "usage: $0 [switches] input_fits 'key1 ... keyn' [output]"
- echo "output file is set to root_key.idx for use with funtools processing"
- echo " "
- echo "experimental switches (don't use unless you know what you are doing):"
- echo " -a # ASCII output, ignore -c (default: FITS table)"
- echo " -c # compress output using gzip"
- echo " -f # FITS table output (default: FITS table)"
- echo " -l # long output, i.e. with key value(s) (default: long)"
- echo " -s # short output, i.e. no key value(s) (default: long)"
- echo " "
- echo "output file name can be specified but funtools will not find it"
- exit 1
-fi
-
-# required arguments
-FILE=$1
-KEYS=$2
-if [ x"$3" != x ]; then
- IDX=$3
-fi
-
-# output index file name
-if [ x"$IDX" = x ]; then
- IDX1=`basename $FILE | sed 's/\(.*\)\.[^.]*/\1/g'`
- if [ x"$IDX1" = x ]; then
- IDX1=$FILE
- fi
- IDX2=`echo $KEYS | sed 's/ /_/g'`
- IDX=${IDX1}_${IDX2}.idx
-fi
-
-# input and output rows
-ROWS1="\$N $KEYS"
-if [ $doverbose = true ]; then
- ROWS2="N $KEYS"
-else
- ROWS2='N'
-fi
-
-# remove possible already existing columns named N
-# sort on the key column and output an additional column N
-# output only the key and N columns
-if [ $doascii = true ]; then
- funtable $FILE stdout "-N" | \
- funtable -s "$KEYS" stdin stdout "$ROWS1" | \
- fundisp -T stdin'[1]' "$ROWS2" > $IDX
-else
- funtable $FILE stdout "-N" | \
- funtable -s "$KEYS" stdin stdout "$ROWS1" | \
- funtable stdin'[1]' $IDX "$ROWS2"
-fi
-if [ x"$gz" != x"cat" ]; then
- gzip $IDX
- IDX=$IDX.gz
-fi
-
-if [ -s $IDX ]; then
- echo "Index file $IDX created for data file $FILE"
-else
- echo "ERROR: Index file $IDX not created"
-fi