-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprecess
executable file
·63 lines (51 loc) · 1.18 KB
/
precess
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
#!/bin/sh
#
# precess - Precess the ra and dec columns from one equinox to another.
#
# Starbase Data Tables - An Ascii Database for UNIX
#
# copyright 1991, 1993, 1995, 1999 John B. Roll jr.
#
PATH=.:/bin:/usr/bin; export PATH
TABLELIB=$TABLELIB; export TABLELIB
TABLEFUN=""; export TABLEFUN
while [ $# -ge 1 ] ; do
case $1 in
-o) shift; ifile=$1 ;;
-o) shift; ofile=$1 ;;
-*) echo "preces: unknown option"; exit 1 ;;
*) argv="$argv $1" ;;
esac
shift
done
if [ "$ifile" != "" ] ; then
exec < $ifile
fi
if [ "$ofile" != "" ] ; then
exec > $ofile
fi
table -p $argv '
BEGIN {
Init = 0
sys = "FK4"
rcol = "ra"
dcol = "dec"
eq0 = 1950
eq1 = 2000
paramcheck("preces", "sys|eq0|eq1|rcol|dcol")
}
!Init { __r = table_colnum(rcol)
__d = table_colnum(dcol)
paramrange("preces", "sys", "s", sys, "FK4|fk4|FK5|fk5|FK5nut")
if ( !__r ) printf("preces: no column \"%s\".\n", rcol)
if ( !__d ) printf("preces: no column \"%s\".\n", dcol)
if ( !__r || !__d ) {
exit 1
}
Init = 1
}
{ [ $__r, $__d ] = precess(sys, eq0, eq1, $__r, $__d); print }
include ../tablefun/paramcheck
include ../tablefun/paramrange
include ../tablefun/table_colnum
'