Use the SOFA library to calculate the coordinate directions of a source as a function of time, accounting for parallax and proper motion.
Anthony G.A. Brown brown@strw.leidenuniv.nl
The skypath.c
programme uses a few functions from the SOFA ANSI-C library to
calculate as a function of time the coordinate directions, as seen from the observers position, for a source with given
astrometric catalogue parameters and radial velocity. This results in the well-known helix- or wave-like motions of sources
on the sky. The output of the programme is directed to stdout, where it is picked up by the python script
plotskypath.py
for making a plot of the source path. The plot of the source path is
done using so-called local plane coordinates which are defined by equation 1.2.22 in section 1.2 of the
Hipparcos documentation (see this
link
for the PDF document). These local plane coordinates are also calculated by the skypath.c
programme.
This primitive Python to C interfacing was a lazy option to quickly make a plot. The main purpose of this exercise was to learn more about using SOFA.
NOTE that the SOFA library is also used in Astropy (in derived form, see Astropy ERFA), but the calculation of coordinate directions including parallax and proper motion effects is not yet implemented as far as I can tell.
The SOFA ANSI-C library should be installed. The makefile that is included should be modified up to the point indicated in the file. Suggestions:
INSTALL_DIR = $(HOME)
CFLAGF = -c -pedantic -Wall -W -O -fPIC
In the latter line the -fPIC
flag was added which is needed for the creation of a shared object library (libsofa_c.so
).
If you do this remember to create the .so
file with
ld -G -z text -o libsofa_c.so *.o
and copy it by hand to the installation folder ($(HOME)/lib
in this example).
After installation of the SOFA library do make skypath
to create the skypath
executable. Modify the makefile
if needed.
The skypath
command can be invoked directly or through the python script. In both cases use the -h
flag for usage
information. Note that the python script expects comma-separated lists of numbers between quotes as input for the
--astrometry
or --phaseSpace
command line arguments.
The folder PythonVersion contains a python-only implementation of the calculation of
the topocentric coordinate direction to a source. The corresponding
notebook shows how to use the skypathtools
module.
To run the python code Astropy is required and the notebook requires cartopy in addition.