
{ Practical astronomy | Computing | Solar system ephemeris }
Solar system ephemeris
Here we combine the computing environment, the software design principles and the insights about the movement of Sun, Moon, planets, minor planets and comets into software to do some calculations for us. The result are the modules Planets, Moon, MinorPlanet and Comet. The division into these four modules is due to the similarities, or otherwise, of algorithms.
Calculations of any planet is similar to that of another planet, and any of these requires calculation of the Sun (or the Earth revolving around the Sun) to convert between helio- and geocentric coordinates. The Moon poses a very different physical problem than the planets, requiring rather different algorithms. Comets and minor planets are so numerous and their orbits subject to occasionally drastic change, that a different algorithm is used for these objects. Further, the file formats for the orbit parameters is different for minor planets on one hand and comet on the other.
Sun and planets
We use a hidden file to identify the planet we are interested in.
.CL4_PLA- Stores the name of a planet or "Sun". Values can be Sun (not Earth), Mercury, Venus, Mars, Jupiter, Saturn, Uranus or Neptune.
We have these user utilities to show the information for the chosen object. They require Python scripts to invoke from the Bash shell and to convert input parameters, and Python functions to do the work:
PlanetSet.py
PlanetSet(aName)- Store the planet name in
.CL4_PLA. PlanetShow.py
PlanetShow(aFile)- Show the sky position of the planet named in
.CL4_PLA. PlanetPhys.py
PlanetPhys(aFile)- Show the physical ephemeris of the planet named in
.CL4_PLA. PlanetRise.py alt
PlanetRise(aFile, alt)- Show the next rise and set times for the planet. The given parameter is the altitude in degrees that defines the "rise" or "set". Give 0 for the mathematical horizon or −0.6° to compensate for average atmospheric refraction. If the object is the Sun, give −0.8° to compensate for average atmospheric refraction and to define the event as the upper limb coinciding with the horizon. Further, twilight is defined by the Sun being at altitudes −6° (civil), −12° (nautical) or −18° (astronomical).
The Planets module supports three alternative orbit integrations:
Helio(aTT, 3, aNp)is the perturbed orbit after Simon et al. (1994a).Helio(aTT, 2, aNp)is an elliptical orbit.Helio(aTT, 1, aNp)is a circular orbit.
Here is an example use from the Bash shell for the Sun. The time is set from the computer's clock, then the observatory and object selected. Five output routines show time, observatory, position ephemeris, physical ephemeris, and finally, when the Sun will set below −18° altitude (astronomical twilight).
$ TimSetSys.py
$ LocSet.py -70.417 -24.667 2635 "Cerro Paranal"
$ PlanetSet.py Sun
$ TimShow.py
JD [d] 2461179.192199
Gregorian Date and UT 2026-05-18T16:36:46.0
Julian Date and UT 2026-05-05T16:36:46.0
TT - UT [s] 76.38
TAI - UTC [s] 44.19
$ LocShow.py
Observatory Cerro Paranal
Geographic longitude [deg] -70.4170
Geographic latitude [deg] -24.6670
Geocentric latitude [deg] -24.5216
Elevation [m] 2635.0
Sidereal time [deg] 55.1514 03:40:36
$ PlanetShow.py
Object Sun
lII,bII 168.7266 -27.9011 151.321
RA,Dec B1950 54.3888 19.4130 151.321 03:37:33 +19:24:47
RA,Dec J2000 55.1099 19.5734 151.321 03:40:26 +19:34:24
lam,bet EOD 57.7563 -0.0031 151.321
RA,Dec EOD 55.4909 19.6568 151.321 03:41:58 +19:39:25
HA,Dec topo 359.6604 19.6585 151.316 23:58:39 +19:39:31
A,h topo 0.4577 45.6733 151.316
PA of zenith -179.56
$ PlanetPhys.py
Object Sun
V -26.68
Radius [arcsec] 948.7
Elongation [deg] 0.00
Phase angle [deg] 180.00
Illuminated fraction 1.000
Position angle [deg] -20.04
Inclination [deg] -2.28
Central meridian [deg] 283.59
$ PlanetRise.py -18
Object Sun
altitude [deg] -18.0
next set 2026-05-18T23:23:29.1
next rise 2026-05-19T09:52:56.9
Here the corresponding output for Mercury:
$ PlanetSet.py Mercury
$ PlanetShow.py
Object Mercury
lII,bII 171.0184 -23.2724 194.748
RA,Dec B1950 59.3956 21.3281 194.748 03:57:35 +21:19:41
RA,Dec J2000 60.1305 21.4681 194.748 04:00:31 +21:28:05
lam,bet EOD 62.7537 0.8466 194.748
RA,Dec EOD 60.5188 21.5406 194.748 04:02:05 +21:32:26
HA,Dec topo 354.6324 21.5420 194.743 23:38:32 +21:32:31
A,h topo 6.8891 43.4976 194.743
PA of zenith -173.27
$ PlanetPhys.py
Object Mercury
V -1.83
Radius [arcsec] 2.6
Elongation [deg] 5.07
Phase angle [deg] 16.90
Illuminated fraction 0.978
Position angle [deg] -18.23
Inclination [deg] 0.85
Central meridian [deg] 196.68
$ PlanetRise.py -0.6
Object Mercury
altitude [deg] -0.6
next set 2026-05-18T22:20:14.5
next rise 2026-05-19T11:42:09.4
Moon
There is only one Moon and we need no hidden file to choose it as being of interest. We have these user utilities to show the information for the Moon. They require Python scripts to invoke from the Bash shell and to convert input parameters, and Python functions to do the work:
MoonShow.py
MoonShow(aFile)- Show the sky position of the Moon.
MoonPhys.py
MoonPhys(aFile)- Show the physical ephemeris of the Moon.
MoonRise.py alt
MoonRise(aFile, alt)- Show the next rise and set times for the Moon. The given parameter is the altitude in degrees that defines the "rise" or "set". Give −0.8° to compensate for average atmospheric refraction and to define the event as the upper limb coinciding with the horizon.
The Moon module contains three alternative orbit integrations:
MoonCircle(aTT)is a circular orbit, but with motion of the nodes.MoonKepler(aTT)is an elliptical orbit, but with motion of the nodes and of the perigee.MoonMeeus(aTT)is an elliptical orbit with perturbation after Meeus (1982a).
Using the same time and location as for Sun and Mercury above, here the corresponding output for the Moon, where the rise and set are for the upper limb of the Moon:
$ MoonShow.py
Object Moon
lII,bII 179.2146 -2.9586 0.359243
RA,Dec B1950 82.2932 27.9881 0.359243 05:29:10 +27:59:17
RA,Dec J2000 83.0806 28.0235 0.359243 05:32:19 +28:01:25
lam,bet EOD 84.2427 4.7312 0.359243
RA,Dec EOD 83.4962 28.0406 0.359243 05:33:59 +28:02:26
HA,Dec topo 331.1493 28.8020 0.356022 22:04:36 +28:48:07
A,h topo 29.1495 29.7633 0.356022
PA of zenith -149.66
$ MoonPhys.py
Object Moon
V -6.89
Radius [arcsec] 1006.9
Elongation [deg] 27.47
Phase angle [deg] 152.46
Illuminated fraction 0.057
Terminator PA [deg] -13.01
Axis PA [deg] -3.08
Inclination [deg] -6.95
Central meridian [deg] 2.49
$ MoonRise.py -0.8
Object Moon
altitude [deg] -0.8
next set 2026-05-18T23:51:52.5
next rise 2026-05-19T14:24:09.4
Minor planets
We use a hidden file to hold the contemporary orbit parameters of the minor planet that we are interested in. Such parameters can be obtained from https://www.ap-i.net/pub/skychart/mpc/mpc5000.dat (Chevalley 2019a) for the 5000 lowest-numbered minor planets, or from https://www.minorplanetcenter.net/iau/MPCORB/MPCORB.DAT (MPC 2025a) for all minor planets.
.CL4_MPL- Stores the contemporary details of a minor planet as listed in
MPCORB.DAT. The single relevant line can be extracted with a Bash command like
grep "(134340) Pluto" MPCORB.DAT > .CL4_MPL
We have these user utilities to show the information for the chosen minor planet. They require Python scripts to invoke from the Bash shell and to convert input parameters, and Python functions to do the work:
MPlShow.py
MPlShow(aFile)- Show the sky position of the comet or asteroid specified
in
.CL4_COM. MPlPhys.py
MPlPhys(aFile)- Show the physical ephemeris of the comet or asteroid specified
in
.CL4_COM. MPlRise.py
MPlRise(aFile, alt)- Show the next rise and set times for the comet or asteroid
specified in
.CL4_COM.
Using the same time and location as for Sun and Mercury above, here the corresponding output for a minor planet:
$ MPlShow.py
Object (134340) Pluto
lII,bII 21.6631 -32.2044 5254.091
RA,Dec B1950 307.7999 -23.1372 5254.091 20:31:12 -23:08:14
RA,Dec J2000 308.5337 -22.9655 5254.091 20:34:08 -22:57:56
lam,bet EOD 305.4730 -4.0993 5254.091
RA,Dec EOD 308.9201 -22.8738 5254.091 20:35:41 -22:52:26
HA,Dec topo 106.2313 -22.8738 5254.091 07:04:56 -22:52:26
A,h topo 242.4898 -4.1181 5254.091
PA of zenith 118.98
$ MPlPhys.py
Object (134340) Pluto
V 15.14
Elongation [deg] -112.22
Phase angle [deg] -1.51
$ MPlRise.py -0.6
Object (134340) Pluto
altitude [deg] -0.6
next rise 2026-05-19T02:42:34.3
next set 2026-05-19T16:15:34.1
Comets
We use a hidden file to hold the contemporary orbit parameters of the comet that we are interested in. Such parameters can be obtained from https://www.minorplanetcenter.net/iau/MPCORB/CometEls.txt for the most relevant comets, or https://www.minorplanetcenter.net/iau/MPCORB/AllCometEls.txt for all comets. (MPC 2025a)
.CL4_COM- Stores the contemporary details of a comet as listed in
AllCometEls.txt. The single relevant line can be extracted with a Bash command like
grep "13P/Olbers" AllCometEls.txt > .CL4_COM
grep "C/2024 E1 (Wierzchos)" AllCometEls.txt > .CL4_COM
etc.
We have these user utilities to show the information for the chosen comet. They require Python scripts to invoke from the Bash shell and to convert input parameters, and Python functions to do the work:
CometShow.py
CometShow(aFile)- Show the sky position of the comet specified
in
.CL4_COM. CometPhys.py
CometPhys(aFile)- Show the physical ephemeris of the comet specified
in
.CL4_COM. CometRise.py
CometRise(aFile, alt)- Show the next rise and set times for the comet
specified in
.CL4_COM.
Using the same time and location as for Sun and Mercury above, here the corresponding output for a comet. 10° is chosen as minimum altitude for any observation of the comet:
$ CometShow.py
Object 24P/Schaumasse
lII,bII 344.3531 53.9620 153.422
RA,Dec B1950 215.1286 -1.1432 153.422 14:20:31 -01:08:36
RA,Dec J2000 215.7730 -1.3695 153.422 14:23:06 -01:22:10
lam,bet EOD 214.3001 12.1538 153.422
RA,Dec EOD 216.1132 -1.4882 153.422 14:24:27 -01:29:18
HA,Dec topo 199.0375 -1.4872 153.427 13:16:09 -01:29:14
A,h topo 142.0406 -57.9866 153.427
PA of zenith -146.00
$ CometPhys.py
Object 24P/Schaumasse
V 16.97
Elongation [deg] 153.74
Phase angle [deg] 13.04
$ CometRise.py 10.
Object 24P/Schaumasse
altitude [deg] 10.0
next rise 2026-05-18T22:00:48.6
next set 2026-05-19T08:36:25.3
