chi and h site logo

{ 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 the Sun and Moon into software to do some calculations for us. The result are the modules Planets and Moon. Currently, Planets supports only the Sun.

We use one hidden file to identify the "planet" we are interested in. Currently this can only be "Sun". The Moon needs no such information, as it is identified by the algorithm used.

.SP4_PLA
Stores the name of a planet or similar object. Value can only be Sun (not Earth).

We have these user utilities to show the sky position of 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()
Store the planet name in .SP4_PLA).
PlanetShow.py
PlanetShow()
Show the sky position of the planet named in .SP4_PLA).
PlanetPhys.py
PlanetPhys()
Show the physical ephemeris of the planet named in .SP4_PLA).
PlanetRise.py alt
PlanetRise(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. For 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).
MoonShow.py
MoonShow()
Show the sky position of the Moon.
MoonPhys.py
MoonPhys()
Show the physical ephemeris of the Moon.
MoonRise.py alt
MoonRise(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 Planets module contains several alternative orbit integrations:

The Moon module contains several alternative orbit integrations:

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]  2459161.991307
      Gregorian Date and UT  2020-11-08T11:47:29.0
         Julian Date and UT  2020-10-26T11:47:29.0
                TT - UT [s]  70.85418564783117
              TAI - UTC [s]  37.0

$ LocShow.py 

                Observatory  Cerro Paranal
 Geographic longitude [deg]  -70.417
  Geographic latitude [deg]  -24.667
  Geocentric latitude [deg]  -24.52155560529307
              Elevation [m]  2635.0
        Sidereal time [deg]  154.58181864931424

$ PlanetShow.py

        Object  Sun
       lII,bII  340.918003295553 36.88846297241486 148.19821672354828
  RA,Dec B1950  223.0874483631932 -16.495278232183864 148.19821672354826
  RA,Dec J2000  223.7852346950211 -16.697029768004015 148.19821672354823
   lam,bet EOD  226.5423816594646 0.0021281863346300114 148.19821672354823
    RA,Dec EOD  224.07670207248796 -16.780486029851804 148.19821672354823
   HA,Dec topo  290.5029221166617 -16.779733162936644 148.19550690269256
      A,h topo  97.77203093662202 25.164954930481066 148.19550690269256

$ PlanetPhys.py

                  Object  Sun
                       V  -26.720412161128476
         Radius [arcsec]  968.7082345647381
        Elongation [deg]  0.0
       Phase angle [deg]  180.0
    Illuminated fraction  1.0
       Inclination [deg]  3.5632020702425025
    Position angle [deg]  23.00746174240958
  Central meridian [deg]  265.3004716149302

$ PlanetRise.py -18

       next set  2020-11-09T00:24:13.9
      next rise  2020-11-09T08:26:31.7
 altitude [deg]  -18.0

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  208.60829404002192 40.62572930466014 0.3816708105593869
  RA,Dec B1950  138.3248763703324 20.563276231327986 0.3816708105593869
  RA,Dec J2000  139.03416785050558 20.35460936719638 0.3816708105593869
   lam,bet EOD  135.5205543707312 4.279680393560237 0.3816708105593869
    RA,Dec EOD  139.3294914686125 20.266910443133813 0.3816708105593869
   HA,Dec topo  15.500453242864637 20.938119185362524 0.3773656215093531
      A,h topo  340.3845630824693 41.96907285027258 0.37736562150935304

$ MoonPhys.py

                  Object  Moon
                       V  -10.176269713195403
         Radius [arcsec]  949.9792248997904
        Elongation [deg]  -91.44367187850128
       Phase angle [deg]  -88.41048590616889
     Terminator PA [deg]  17.43114268045042
    Illuminated fraction  0.5138693480117649
       Inclination [deg]  -6.093415933143147
           Axis PA [deg]  18.36298234013797
  Central meridian [deg]  -7.80905458002411

$ MoonRise.py -0.8

       next set  2020-11-08T16:17:33.2
      next rise  2020-11-09T05:58:39.0
 altitude [deg]  -0.8