Sun & Moon Rise and Set Accuracy Comparisons

Copy Markdown View Source

Comparisons of of Astro.sunrise/3, Astro.sunset/3, Astro.moonrise/3, and Astro.moonset/3 against Skyfield (JPL DE440s), USNO (DE430), and timeanddate.com were run to confirm accuracy.

Sunrise / Sunset

Both Astro and Skyfield use JPL DE440s ephemerides, which explains their near-exact agreement. The timeanddate.com data (used in the CSV test files) agrees with both to within ±1 minute, with the 2 boundary cases at 61 seconds being a minute-rounding artefact.

The comparison uses test dates from December 2019 across 5 cities (Sydney, Moscow, NYC, São Paulo, Beijing) for a total of 310 comparisons.

Overall

ComparisonMax diffMean diffWithin ±1 min
Astro vs Skyfield7 s3.8 s310/310 (100%)
Astro vs timeanddate.com (CSV)61 s~29 s308/310 (99.4%)
timeanddate.com vs Skyfield61 s28.5 s308/310 (99.4%)

Per-city (Astro vs Skyfield)

CityRise maxRise avgSet maxSet avg
Sydney4 s2.8 s7 s4.9 s
Moscow5 s3.1 s6 s4.7 s
NYC5 s3.2 s6 s4.5 s
São Paulo4 s3.0 s6 s4.6 s
Beijing5 s3.3 s6 s4.3 s

Moonrise / Moonset

The ~16 s 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 ~16 s offset against USNO, suggesting this is an ephemeris version difference rather than an algorithmic error.

The comparison uses test dates from March 2026 across 4 cities (NYC, London, Sydney, Tokyo) for a total of 70 comparisons.

Overall

ComparisonMax diffMean diffWithin ±1 min
Astro vs Skyfield6 s2.5 s240/240 (100%)
Astro vs USNO32 s15.5 s67/67 (100%)
Skyfield vs USNO35 s15.6 s67/67 (100%)

Per-city (Astro vs Skyfield)

CityMax diffAvg diff
NYC5 s2.1 s
London6 s2.8 s
Sydney6 s3.2 s
Tokyo5 s2.1 s

Per-city (Astro vs USNO)

CityMax diffAvg diff
NYC32 s16.3 s
London30 s16.4 s
Sydney28 s11.8 s
Tokyo28 s17.7 s