The following Python packages for astronomy coordinate calculations are compared.
astropy.coordinates: Uses erfa for some computations, but re-implements many things using Python / numpy.
kapteyn.celestial: Part of the Kapteyn package.
The Naval Observatory Vector Astrometry Software (NOVAS) version 3.1 exists as a FORTRAN, C and Python edition.
We use the Python edition, which is a ctypes wrapper for the C version. It can be obtained from three locations ... the versions should be identical:
- Official tarball: http://www.usno.navy.mil/USNO/astronomical-applications/software-products/novas/novas-python
- Unofficial, but convenient: http://pypi.python.org/pypi/novas/
- Unofficial, but convenient: https://github.com/brandon-rhodes/python-novas
pyast: A Python interface to the Starlink AST C library.
palpy is a Python interface to the Starlink PAL C library which is a reimplementation of SLALIB using SOFA/ERFA.
pyephem is a Python astrometry package based on the xephem coordinate routines, which are interfaced as C extensions. Currently a re-write using Cython is underway in the version4 branch on github.
f2py and numpy wrappers of the fortran version of the astro library SLALIB
pytpm is Cython interface to the
TPM C library with a high-level
convert.convertv6
function interface. Unmaintained.
We are using the version from github main.
Note that pytpm
is unmaintained and is known to give incorrect results in this case:
phn/pytpm#2
- Package -- Package name
- License -- License of the Python package
- Lib License -- License of the underlying C or Fortran coordinates library (if applicable)
- Array -- Works with arrays of coordinates?
- Alt/Az -- Can compute horizontal coordinates for a given observer?
Package | License | Lib License | Array | Alt/Az |
---|---|---|---|---|
astropy | BSD | --- | No | No |
kapteyn.celestial | BSD | --- | Yes | No |
novas | Public Domain | Public Domain | No | Yes |
palpy | GPL | GPL | Some | Yes |
pyast | LGPL | LGPL | Yes | Yes |
pyephem | LGPL | LGPL | No | Yes |
pyslalib | GPL | GPL | No | Yes |
pysofa | MIT | SOFA | No | Yes |
pytpm | BSD | ??? | No | Yes |
Notes:
- The SOFA License is considered non-free (see discussion here).
Please report any inaccuracies, especially concerning the license status.
The following packages have been removed from the coordinates-benchmark
:
pysofa is a ctypes
wrapper for the SOFA C library.
It does use numpy for 3x3 matrices, but it does not support input numpy arrays of coordinates for it's functions.
It was never added to the coordinates-benchmark
and given that Astropy and some others use SOFA/ERFA
and PySOFA is unmaintained it doesn't seem useful to add it.
astrolib.coords: A Swig wrapper for the TPM C library with a high-level Position class. Unmaintained. We are using the last version coords-0.37 from 2009.
We removed it because we ran into a small issue #44 and didn't feel it's worth tracking it down given that we have enough other packages in the benchmark to compare against.
Note that Skyfield now can do AltAz to RaDec transforms: skyfielders/python-skyfield#13 (comment)
TODO: Give details on the methods used, e.g. for Earth obliquity, precession, nutation, time, ... Probably best to first collect this info in a bullet list and then try to summarize it in a table.
Useful references:
- SOFA C-version Documentation (see Figure 1)
- TPM Specification and TPM diagram
- NOVAS User Guide