EOT


Equation of time & solar clock program

eot.c is a command line program for Unix-like systems, developed by Ellie Neills.

It is free software, released under the GPLv3 license.

It gives the difference between Local Mean Time and Apparent Solar Time.

The program also gives various other parameters of the sun.

It can also function as a clock, displaying 8 different kinds of time.

Equations were sourced from The Astronomical Almanac.

The latest version of the program can be obtained from GitHub: https://github.com/esm88/eot

Fig 1: GNU Octave displaying the Equation of Time for the year AD 2024

To install:

First, you should change the LONGITUDE constant in eot.c to your own longitude. The clock mode uses this to calculate the local times.

You can then compile, install, and run with:

% make
# make install
% eot

Sample output:

% ./eot -a 2024-7-18
Date: 2024-7-18
Day: J2000.0 +8965.000
JD: 2460510.00000
R.A.= 7h 53m
Dec.= +20deg 53m
Long= 116deg 21m
Dist= 1.0163 AU
Cancer 26deg 21m
EOT is -6m 18s

To get a fancy graph (GNU Octave required):

% ./graph.sh

This will generate a csv file and run an Octave script, placing an '×' on the current date (example image above).

For a live clock:

% ./live.sh

This will give a running clock of the currrent:

  • JD (Julian Day)
  • GMT/LMT (Greenwich/Local Mean Time)
  • GHA/LHA (Greenwich/Local Hour Angle)
  • GAST/LAST (Greenwich/Local Apparent Solar Time)
  • GMST/LMST (Greenwich/Local Mean Sidereal Time)
  • EOT (Equation of Time)

Note: 'local' is based on the longitude as defined by the LONGITUDE constant. Please change to your own value (negative values are west of Greenwich).

Sample output of the live clock mode:

Every 1.0s: ./eot -ntj

JD: 2460509.45384

GHA = 10:47:15 (161deg 49m)
GAST= 22:47:15
GMT = 22:53:32
GMST= 18:38:32

LHA = 10:32:15 (158deg 4m)
LAST= 22:32:15
LMT = 22:38:32
LMST= 18:23:32

EOT is -6m 16s

Free42 version

I have also written an RPN version for the Free42 calculator (eot.42s). To get the sun parameters for today, enter 0 and execute SUN. If you want a specific date, enter the date in YYYY.MMDD format, for example: 2024.0401 for April 1st, 2024. Execute SUN.

The results are displayed in both register X and Y, using CMPLX mode. This allows 4 parameters to be shown at once. Register X shows the right ascension and the angle part shows the declination. Register Y shows the ecliptic longitude and the angle part is the equation of time. Although decimal points are shown, the results are actually in the following units:

R.A.hours.minutes
Dec.degrees.minutes
Longdegrees.minutes
EOTminutes.seconds

Here is an example:

Y: 116.21 ∠-6.18
X: 7.53 ∠20.52

Here, the parameters are 7h 53m right ascension, 20° 52m declination, 116° 21m ecliptic longitude, and the equation of time is -6m 18s

FLAG 10 controls whether the calculations will be for noon (12h) or midnight (00h). For noon, flag 10 should be clear (CF 10). For midnight, flag 10 should be set (SF 10).

Note that the Free42 version uses the built in DDAYS function. The 'current' date will be based on your local time rather than GMT.

The Free42 version will not work with the original HP-42S as it requires the TIME functions. It will however work on a DM42. Make sure you are in degrees mode.

I have also included the binary file eot.raw which can be imported to Free42. This saves having to manually enter the program.

There is also an HP-15C version (eot.15c). This uses a simpler algorithm. Enter the day number (of year) and run LBL A. It is not as accurate as the C and Free42 versions.

Notes:

The program has been tested on:

  • Debian 12 (amd64)
  • Slackware 15 (amd64)
  • IRIX 5.3 (mips)
  • NetBSD 9.1

On IRIX 5.3, the program fails on dates before 1970-01-01 and after 2038-01-19.

The equations used for the sun_calc() function were taken from the 2016 edition of The Astronomical Almanac, page C5 ("Low precision formulas for the Sun").

The claimed precision (for 1950 ~ 2050):

  • better than 3.5s (for EOT)
  • better than 1.0' (for R.A./Dec)
  • better than 0.0003 au (for distance)

Note that the program actually uses UTC, not GMT. The term 'GMT' is often used to mean UTC, but true GMT is actually UT1 . UTC is currently kept within 0.9s of UT1 through the introduction of leap seconds (DUT1 is the difference). This is likely to change as leap seconds are to be abolished by 2035.

Additionally, the modern prime meridian (based on WGS84) is actually 5.3" east of the Airy Transit Circle at Greenwich Royal Observatory.

I consider these inaccuracies negligible. If you require high precision for astronomy, consider other programs such as XEphem∗∗ or Cartes du Ciel.

If you discover any bugs in the program, please report them to me: github@esm.me.uk


Footnotes:

eot is Copyright ©2024 Ellie Neills and is licensed under version 3 of the GNU General Public License. See the included LICENSE file for the full terms and conditions.

∗ UNIX® is a registered trademark of The Open Group.

† OK, it's actually 4 different types of time but I multiplied it by two for GMT/local. The JD could also be considered another type of time.

‡ It is debatable what exactly 'true' GMT means. In the UK, it commonly refers to the UTC+0 timezone.

∗∗ Note that XEphem's user longitude values are positive for west, negative for east.


Hosted by SDF-EU on NetBSD.