#!/bin/sh # ##1 fk45 - Convert the ra and dec columns of an starbase data table from FK4 to FK5. # # fk45 < file rcol dcol # # DESCRIPTION # Convert B1950.0 FK4 star data form the starbase data table # read from the standard input to J2000.0 FK5 assuming zero # proper motion in an inertial frame (double precision) # # Stars positions are converted from the old, Bessel-Newcomb, FK4 # system to the new, IAU 1976, FK5, Fricke system, in such a # way that the FK5 proper motion is zero. Because such a star # has, in general, a non-zero proper motion in the FK4 system, # the routine requires the epoch at which the position in the # FK4 system was determined. # # Convert a J2000.0 FK5 star position form 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 initial 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 # *<@fk45.src@> Source text of #fk45. # *<#@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. # *<#@fk54#> Convert the ra and dec columns of an starbase data table from FK5 to FK4. # export TABLEFUNCTIONS TABLEFUNCTIONS="" while [ $# -ge 1 ] ; do case "$1" in -i) shift; ifile="$1" ;; -o) shift; ofile="$1" ;; -*) echo "fk45: 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("fk45", "rcol|dcol|bepoch") } !Init { __r = table_colnum(rcol) __d = table_colnum(dcol) if ( !__r ) printf("fk45: no column \"%s\".\n", rcol) > "/dev/stderr" if ( !__d ) printf("fk45: no column \"%s\".\n", dcol) > "/dev/stderr" if ( !__r || !__d ) { exit 1 } Init = 1 } { [ $__r, $__d ] = fk45($__r, $__d, bepoch); print } include(../tablefun/paramcheck) include(../tablefun/table_colnum) ' $argv