[AstroPy] POLL: vision for a common Astronomy package

Prasanth oneaufs at gmail.com
Fri Jul 1 03:38:43 EDT 2011


> I am, however, a little concerned that the current vision statement
> seems to exclude the use of existing officially sanctioned (i.e. by the
> IAU) routines that are written in other languages.

I am not sure if anyone is against such libraries, it is just that we
haven't reached a stage where we debate on how to include C/Fortan
extensions in the common package.

> For instance, the Standards of Fundamental Astronomy
> (http://www.iausofa.org/) package contains IAU-sanctioned routines for
> very common tasks (Calendards, Time Scales, Sidereal times, Ephemerids,
> star motion, star catalog conversion, etc).  This package is written in
> C and is quite easily wrapped using SWIG (see the pysofa package
> http://pypi.python.org/pypi/pysofa).  If the interface layer is
> implemented correctly, the function calls have minimal overhead and, in
> some circumstances, can benefit from being implemented in lower-level
> languages.

I have found put that Cython is much better than SWIG when it comes to
implementing interfaces to C packages. I was able to come up with a
much more pythonic and easier to use interface for PyTPM and COORDS,
using Cython. The speed gain was also noticeable. The pysofa package,
mentioned above, is written using ctypes and I haven't played around
with it. Writing the interface itself is very easy; I have code that
interfaces with NOVAS and SOFA, to varying degrees of completeness.
The challenge is in reducing the time of execution while handling
multiple input values and providing a pythonic interface.

I have a suggestion that while the common plan is being developed,
sub-groups can be formed and these groups can have their own
discussions on how to choose libraries and so on. Of-course the exact
nature of the products can wait till the common dependencies are
sorted out, but considerable progress can be achieved in the mean
time. Also these discussions can provide feedback on what should go
into the common package.


More information about the AstroPy mailing list