Possible bug in skyfield (new almanac module)

137 views
Skip to first unread message

Tomasz Lewicki

unread,
Oct 15, 2025, 4:05:52 AMOct 15
to weewx-user
Dear group.

Yesterday I upgraded two of my three stations to Weewx 5.2 and encountered strange problem (bug?) with new almanac module. On first glance everything works good, data are presented as before but I've noticed that moonrise is incorrectly calculated. I use timeanddate.com to check my calculations. I provide data for one of the two stations from Weewx 5.2, as they are located approximately 3 km apart.

Now the numbers:

Station 1: latitude = 50.70737, longitude = 16.22252. Weewx 5.2 with weewx-skyfield-almanac installed and enabled shows for today (15.10.2025) moonrise at 01:20:49, moonset at 16:10:39. Station 2, approx. 20 km NE from station 1. Weewx 5.2 with weewx-skyfield-almanac installed and enabled shows for today (15.10.2025) moonrise at 01:19:32, moonset at 16:10:19. timeanddate.com for nearby bigger city (approx. 10 km north) shows accordingly 00:00 and 16:10. Culmination, sunrise and sunset are OK for both stations.

Third station cannot be upgraded because OS there couldn't find source for python3-skyfield module and this station is still working with Weewx 5.1 and PyEphem. Moonrise and moonset for this location are as follows: 00:00:07 and 16:10:38 - and this is correct.

I'm sure that for station 1 and 2 (Weewx 5.2) skyfield module does the calculations because solstices and equinoxes are perfectly equal up to single second but third station (Weewx 5.1 and PyEphem) shows differences of a few seconds.

Karen K

unread,
Oct 16, 2025, 2:57:11 AMOct 16
to weewx-user
I will look into it the next days. 

Tomasz Lewicki

unread,
Oct 16, 2025, 3:17:25 AMOct 16
to weewx-user

Strange! I checked the data for today and now everything looks fine for all three stations - moonrise between 01:19 and 01:21, moonset between 16:26 and 16:27 local time. Perhaps the problem occurs when a phenomenon takes place very close to midnight (I remind you that yesterday the moon was rising a few seconds after midnight in my location). The rises and sets of the planets and the sun are fine.

As before, equinoxes and solstices are calculated at the same moment for stations with Weewx 5.2 and the SkyField module, and differ by exactly 3 seconds from what is shown by stations with Weewx 5.1 and PyEphem. Another interesting fact: according to all three stations, the Moon is 24% illuminated. Weewx 5.1 describes it as a "third quarter" while Weewx 5.2 describes it as a "waning crescent". 

Karen K

unread,
Oct 27, 2025, 1:14:26 PM (10 days ago) Oct 27
to weewx-user
Tomasz Lewicki schrieb am Donnerstag, 16. Oktober 2025 um 09:17:25 UTC+2:

Strange! I checked the data for today and now everything looks fine for all three stations - moonrise between 01:19 and 01:21, moonset between 16:26 and 16:27 local time. Perhaps the problem occurs when a phenomenon takes place very close to midnight (I remind you that yesterday the moon was rising a few seconds after midnight in my location). The rises and sets of the planets and the sun are fine.

If you think so, you may want to open an issue with Skyfield. The Skyfield almanac extension works like a wrapper around the Skyfield module. The calculation is done within Skyfield.
 

Tomasz Lewicki

unread,
Oct 29, 2025, 4:57:36 AM (8 days ago) Oct 29
to weewx-user

I don't know if that's necessary. The error only occurred once. Maybe it was some kind of artifact from the weewx.sdb database? I don't know. It hasn't happened again.

Reply all
Reply to author
Forward
0 new messages