Pyephem in WeeWx 5.2

39 views
Skip to first unread message

DR

unread,
Jan 12, 2026, 9:07:09 PM (12 hours ago) Jan 12
to 'Jon Fear' via weewx-user

If I want the various functions that produce more astronomical tables in 5.2, do I need to install pyephem as was necessary in earlier versions of WeeWx?  Or does the new python have the ability to do those calculations?

I see from looking for sources to download pyephem that it  is no longer being supported and a new astronomy package is replacing it. Perhaps I should install that instead?  Does 5.2 make calls to the pyephem, or tests to see if this newer group of routines is available?

I did this:

python3 -m pip list -v

within the weewx-venv  gives me:

ephem     4.2         /home/dale/weewx-venv/lib/python3.13/site-packages pip

I assume since  I'm only going to use this with WeeWx that I install whichever one (if needed) into the Weewx-venv if "ephem 4.2" isn't what I need (not pyephem)?

Dale


John Smith

unread,
Jan 12, 2026, 9:24:12 PM (12 hours ago) Jan 12
to weewx...@googlegroups.com
I see from looking for sources to download pyephem that it  is no longer being supported and a new astronomy package is replacing it. Perhaps I should install that instead?

The Author of pyephem wrote the Skyfield library, and you're right that it no longer gets observed base data updates, but I didn't test so see how much drift there has been since it was last updated in 2018.

However I compared the results from Skyfield to a weather site I frequent and they closely matched, but not exactly.

Or does the new python have the ability to do those calculations?

The Skyfield extension is a drop in replacement for the pyephem extension and the Skyfield extension is preferred according to documentation by the author if both are installed.
 
I assume since  I'm only going to use this with WeeWx that I install whichever one (if needed) into the Weewx-venv if "ephem 4.2" isn't what I need (not pyephem)?

If you want to use Skyfield there is a few math libraries needed as well but I assume pip will pull them in as well.

Vince Skahan

unread,
Jan 12, 2026, 9:43:06 PM (11 hours ago) Jan 12
to weewx-user
The weewx docs are a little unclear on the longterm story if you look at https://www.weewx.com/docs/5.2/custom/cheetah-generator/?h=ephem#almanac which talks about both.  I guess some clarification from Tom on which way is recommended might help on this one.

I use ephem 4.2 via pip which is still available from pypi and in debian for pi as well, FWIW. Sources for the packaged weewx variants do expect python3-ephem for debian-like os.  That one doesn't seem to be available in a package for redhat-ish os from a quick look at the weewx packagers sources.

A pip3 install of skyfield does seem to pull in what it needs....

$ pip3 install skyfield
Collecting skyfield
  Downloading skyfield-1.53-py3-none-any.whl.metadata (2.4 kB)
Collecting certifi>=2017.4.17 (from skyfield)
  Downloading certifi-2026.1.4-py3-none-any.whl.metadata (2.5 kB)
Collecting jplephem>=2.13 (from skyfield)
  Downloading jplephem-2.23-py3-none-any.whl.metadata (23 kB)
Collecting numpy (from skyfield)
  Downloading numpy-2.4.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (6.6 kB)
Collecting sgp4>=2.13 (from skyfield)
  Downloading sgp4-2.25-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (33 kB)
Downloading skyfield-1.53-py3-none-any.whl (366 kB)
Downloading certifi-2026.1.4-py3-none-any.whl (152 kB)
Downloading jplephem-2.23-py3-none-any.whl (49 kB)
Downloading sgp4-2.25-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (235 kB)
Downloading numpy-2.4.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (16.4 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.4/16.4 MB 50.4 MB/s eta 0:00:00
Installing collected packages: sgp4, numpy, certifi, jplephem, skyfield
Successfully installed certifi-2026.1.4 jplephem-2.23 numpy-2.4.1 sgp4-2.25 skyfield-1.53

Karen K

unread,
12:58 AM (8 hours ago) 12:58 AM
to weewx-user
DR schrieb am Dienstag, 13. Januar 2026 um 03:07:09 UTC+1:

If I want the various functions that produce more astronomical tables in 5.2, do I need to install pyephem as was necessary in earlier versions of WeeWx?  Or does the new python have the ability to do those calculations?

You need to install either PyEphem or for the Skyfield based calculations a bunch of modules (Skyfield, numpy, and the weewx-skyfield-almanac) . Both work, if you simply want to get the almanac page of the Seasons skin displayed.

If you want to know, which one is better, discussion starts with your needs regarding accuracy, features, availability etc. There are differences. If your requirements are rather simple and your distribution provides PyEphem, use it. If you want more, then Skyfield steps in.

DR

unread,
8:29 AM (1 hour ago) 8:29 AM
to weewx...@googlegroups.com
Karen:

Thank  you for the summary.  In the past the pyephem needed to be loaded
separately, but I see more recent Rasp OS seem to install it
automatically now (just from having discovered it with some of the
function listings) so I don't have to go looking for nor installing it. 
To me that is new but a welcome change, which I admittedly didn't know
the new Pythons did.

The other part I'm trying to understand is one of the comments was that
skyfield was a direct or even 'drop  in' replacement for pyephem.  To me
that implies that the name of the module and the calls and recognized
functions are named the same or otherwise WeeWx would  have to test to
see which one was installed and then issue the correctly named function
calls.


In any event, it works!  Decades ago we  had a program called Guide 8
which pointed the telescope and tracked for our University's
telescopes.  Very accurate and other than implementing it (on old IBM
PCs!) I didn't have much more to do with it.  The astronomers took care
of updating the ephemeris and it was amazing what it could do.

I just want to know about what time the moon comes up, etc.  so even a
slightly outdated pyephem will do nicely, not that I won't be playing
with the skymap and skyfield stuff since it seems so nice.

Enough for this discussion and I thank all who gave their input. I
understand better now.   Dale

Reply all
Reply to author
Forward
0 new messages