🤖 AI Summary
This study addresses the limitations of existing open-source tools for planetary position and solar/lunar event computations, which often suffer from heavy dependencies, insufficient accuracy, or lack of lightweight design. To overcome these issues, this work proposes a lightweight, pure-Python astronomical computation library with no external dependencies. Built upon analytical orbital models and coordinate transformation algorithms, the library supports geocentric and heliocentric coordinate calculations, sunrise/sunset and moonrise/moonset times, lunar phases, and conversions among common astronomical coordinate systems, with optional precession corrections for compatibility across reference frames. Validation against JPL DE440 ephemerides shows mean errors of approximately 0.44′ in planetary longitude and 0.16′ in latitude, timing errors of only a few minutes for solar and lunar events, and a lunar illumination error of about 0.2%, demonstrating a favorable balance between high precision and computational efficiency.
📝 Abstract
This paper presents solarsystem, a validated lightweight and dependency-free Python package for planetary positions and solar-lunar event calculations. The package provides heliocentric and geocentric positions for the major planets, selected dwarf planets, the Centaur Chiron, and the Moon, together with sunrise, sunset, moonrise, moonset, and lunar illumination calculations. Additional functionality includes coordinate transformations between commonly used astronomical reference systems.
The implemented algorithms employ analytical models that avoid reliance on external ephemeris datasets, resulting in a portable and computationally efficient solution suitable for a broad range of astronomical applications. An optional precession correction model is included, enabling calculations either in a precession-corrected reference frame or in a fixed epoch framework, depending on user requirements.
The numerical performance of solarsystem was evaluated against the JPL DE440 planetary ephemerides using the Skyfield framework as a reference. Validation experiments spanning multiple bodies and extended temporal intervals demonstrate good agreement with the reference ephemerides, with mean planetary longitude and latitude deviations of approximately 0.44 and 0.16 arcminutes, respectively. Additional validation of solar and lunar event calculations yielded timing differences of only a few minutes relative to the reference solutions, while lunar illumination estimates differed by approximately 0.2%.
The package can be installed directly through PyPI while the source code, documentation, validation notebooks and example workflows are publicly available through the project repository in https://github.com/IoannisNasios/solarsystem.