#!/bin/sh # ##1 fk54 - Convert the ra and dec columns of an starbase data table from FK5 to FK4. # # fk54 < file rcol dcol # # DESCRIPTION # Convert a J2000.0 FK5 star position from the starbase data table # read from the standard input to B1950.0 FK4 assuming # zero proper motion and parallax. # # Star positions are converted from the new, IAU 1976, # FK5, Fricke system to the old, Bessel-Newcomb, FK4 system. # # PARAMETERS # *rcol The column name of the ra column defaults to "ra". The # column should contain RA coordinate values in hours. # *dcol The column name of the dec column defaults to "dec". The # column should contain Dec coordinate values in degrees. # *bepoch The converted position in the B1950 # reference frame but at Besselian epoch bepoch. For # comparison with catalogues the bepoch argument will # frequently be 1950.0 and is the default. # # SEE ALSO # *<@fk54.src@> Source text of #fk54. # *<#@slalink.1#> programs available with the slalink extensions to #tawk. # *<#@slalink.4#> functions available with the slalink extensions to #tawk. # *<#@precess#> Precess the ra and dec columns from one equinox to another. # *<#@fk45#> Convert the ra and dec columns of an starbase data table from FK4 to FK5. # export TABLEFUNCTIONS TABLEFUNCTIONS="" while [ $# -ge 1 ] ; do case $1 in -i) shift; ifile=$1 ;; -o) shift; ofile=$1 ;; -*) echo "fk54: unknown option"; exit 1 ;; *) argv="$argv $1" ;; esac shift done if [ "$ifile" != "" ] ; then exec < $ifile fi if [ "$ofile" != "" ] ; then exec > $ofile fi table -p ' BEGIN { Init = 0 rcol = "ra" dcol = "dec" bepoch = 1950 paramcheck("fk54", "rcol|dcol|bepoch") } !Init { __r = table_colnum(rcol) __d = table_colnum(dcol) if ( !__r ) printf("fk54: no column \"%s\".\n", rcol) > "/dev/stderr" if ( !__d ) printf("fk54: no column \"%s\".\n", dcol) > "/dev/stderr" if ( !__r || !__d ) { exit 1 } Init = 1 } { [ $__r, $__d ] = fk54($__r, $__d, bepoch); print } include(../tablefun/paramcheck) include(../tablefun/table_colnum) ' $argv