I’ve just published Astro 2.0. Being a new major release there are some breaking changes and some important enhancements. The biggest changes are documented below, see the changelog for complete details.
Core Algorithm Upgrade
The biggest change is a shift from NOAA/Meeus analytical polynomial series to JPL DE440s numerical ephemeris for sunrise/sunset calculations. Astro.sunrise/3 and Astro.sunset/3 now use a scan-and-bisect solver with positions computed directly from the JPL DE440s ephemeris file, and bisection tolerance tightened from 1.0s to 0.01s (sub-second precision).
Improved Delta-T
Variable ΔT based on IERS observations (1972–2025) and Meeus polynomials replaces the previous fixed value. This shifts computed times for equinoxes, solstices, and lunar phases by up to ~22 seconds vs 1.x.
New Features
- Moonrise/moonset:
Astro.moonrise/3, Astro.moonset/3, and Astro.Lunar.MoonRiseSet (fully topocentric, correcting the ~2–3 min RA-parallax error in Meeus Ch.15)
Astro.date_time_new_moon_nearest/1
Astro.Coordinates module for coordinate system conversions
Astro.Time.date_from_julian_days/1
- Improved and more consistent documentation.
Accuracy
With the new numerical engine, accuracy has improved. The main comparison is with Skyfield a well-regarded Astronomy library for Python. Other comparisons are against timeanddate.com and USNO.
A more complete version of the comparison data is here.
Sunrise / Sunset
Both Astro and Skyfield use JPL DE440s ephemerides, which explains their near-exact agreement. timeanddate.com agrees with both to within ±1 minute.
| Comparison |
Max diff |
Mean diff |
Within ±1 min |
| Astro vs Skyfield |
7 s |
3.8 s |
310/310 (100%) |
| Astro vs timeanddate.com |
61 s |
~29 s |
308/310 (99.4%) |
| timeanddate.com vs Skyfield |
61 s |
28.5 s |
308/310 (99.4%) |
Moonrise / Moonset
Both Astro and Skyfield use JPL DE440s ephemerides, which explains their near-exact agreement again. timeanddate.com agrees with both to within ±1 minute.
The ~16s mean difference against USNO is explained by two factors: USNO uses DE430 (vs the JPL DE440s that Astro uses), and USNO rounds to the nearest minute. Skyfield shows the same ~16s offset against USNO, suggesting this is an ephemeris version difference rather than an
algorithmic error.
| Comparison |
Max diff |
Mean diff |
Within ±1 min |
| Astro vs Skyfield |
6 s |
2.5 s |
240/240 (100%) |
| Astro vs USNO |
32 s |
15.5 s |
67/67 (100%) |
| Skyfield vs USNO |
35 s |
15.6 s |
67/67 (100%) |
Migration from Astro 1.x
The public API in the Astro module is compatible with that in Astro 1.x with any differences being due to the improved numerical engine. Functions in other modules have changed and are documented in the changelog.
In Astro 2.x, the JPL ephemeris needs to be installed. A new mix astro.download_ephemeris is provided to make this easier.
What’s next?
Some of the motivation for this update was to finally deliver moonrise and moonset which are required to support the upcoming implementations of the Islamic Umm al-Qura calendar and the Hebrew calendar.
Feature requests and contributions
Astro welcomes feature requests and contributions no matter how big or small. Just head on over to the github repo.