Fork me on GitHub

libTheSky     libTheSky home page     Get libTheSky at Fast, secure and Free Open Source software downloads

The package libTheSky provides a Fortran library to compute the positions of celestial bodies (Sun, Moon, planets, stars, asteroids, comets) and events (e.g. lunar phases) with great accuracy. libTheSky can use different reference frames (heliocentric, geocentric, topocentric) and coordinate systems (ecliptic, equatorial, galactic; spherical, rectangular). Much of the code is based on Meeus, Astronomical Algorithms, 1998; however, the user has the choice between his low-accuracy, cheap calculations for Sun and Moon, and the full and highly accurate VSOP87 and ELP 2000-82B theories. This package, together with libSUFR, has been developed for and forms the core of the software that is used to create the Flemish/Dutch popular-astronomy website (see screenshots on this page). GNU General Public Licence, version 3 Example use of libTheSky can be found in the astroTools package. It can be used under the conditions of version 3 of the GPL. libTheSky has been written by AstroFloyd.


libTheSky is written in Fortran and compiles with gfortran, g95 (both free and open-source) and ifort. In order to compile and run, the package needs the Fortran library libSUFR. The default installer uses CMake, but you can use your own Makefile or compile and install the code by hand.

Data files:

The code needs data files as input for the calculations (planetary and lunar theory, orbital elements, star databases, etc.). The file asteroids.dat only a reduced version of the large original file. The reduced version contains the brightest ~20% of the minor planets from the full database (a<100 AU, H<15; ~85,000 bodies). The complete file can be downloaded from the NASA JPL website. The data files can be found in libthesky-data-<YYYYMMDD>.tar.bz2. Please see the INSTALL file in the regular libTheSky tarball for details.

Getting started with libTheSky:

Before you install libTheSky, you should install libSUFR. Using the links below you can download and install libTheSky. The Doxygen documentation provides technical information on the syntax of the procedures in the library. Example use of libTheSky can be found in the astroTools, in particular in the planetdata program. Hence, I suggest you download and install that package as well.

Similar packages

If you like libTheSky, you may also be interested in the following FOSS packages:
astroTools command-line tools for astronomy and astrophysics
evTools tools to manipulate and display output from the binary stellar-evolution code ev/STARS/TWIN
GWtool a set of simple command-line tools for working with gravitational waves
libSUFR A LIBrary containing Some Useful Fortran Routines
RochePlot schematically plot the key stages in the evolution of a binary star

GNU/Linux distributions

libTheSky is available in the following Linux distributions:
Arch Linux: package libthesky in AUR
Gentoo Linux: package sci-astronomy/libthesky in the Science overlay

libTheSky has been used by:


You can contact AstroFloyd through or SourceForge.


(produced by codes using libTheSky)
Conjunction of the Moon and Jupiter, computed with libTheSky

Total lunar eclipse, computed with libTheSky

Venus transit, computed with libTheSky

Occultation by the Moon, computed with libTheSky

Opposition of the minor planet Vesta, computed with libTheSky

Moon-phase calendar, computed with libTheSky
© 2002–2015   by Astro Floyd,  –  Planet Earth