How to calculate the equinox / solstice?

What algorithms or formulas are available for calculating the equinoxes and solstices? I found one of them a few years ago and realized it, but the accuracy was not great: the time of day seemed to be expected at 00:00, 06:00, 12:00 and 18:00 UTC, depending on which equinox or solstice. Wikipedia gives these calculations for a minute, so there must be something more accurate. Libraries for my favorite programming language are also coming out of these tough times, so I guess they use the same or similar algorithm as the one I implemented.

I also once tried to use a library that gave me solar longitude and performed a search procedure to zero at 0, 90, 180, and 270 degrees; it worked until the second, but didn’t agree with the time on Wikipedia, so I assume that something is wrong with this approach. However, I am pleasantly surprised to find that Maimonides (a medieval Jewish scholar) proposed an algorithm that uses the same idea a millennium ago.

+7
astronomy equinox
source share
5 answers

I'm not sure if this is a fairly accurate solution for you, but I found a NASA site that has some snippets for calculating the vernal equinox, as well as some other astronomical data. I also found some links to a book called Astronomical Algorithms , which may have the answers you need if the information is somehow not available on the Internet.

+1
source share

I know that you are looking for something that will be inserted in the answer here, but I have to mention SPICE , the prepared NAIF toolkit in JPL, funded by NASA. This may be redundant for Farmer Almanac material, but you mentioned the interest in accuracy, and this toolkit is commonly used in planetary science.

0
source share

Using PyMeeus and the code below, you can get, for example, an answer

winter solstice for 2018 in Terrestrial Time is at: (2018, 12, 21, 22, 23, 52.493725419044495) winter solstice for 2018 in UTC, if last leap second was (2016, 12): (2018, 12, 21, 22, 22, 43.30972542127711) winter solstice for 2018 in local time, if last leap second was (2016, 12) and local time offset is -7.00 hours: (2018, 12, 21, 15, 22, 43.30973883232218) ie 2018-12-21T15:22:43.309725-07:00 

Of course, the answer is not accurate accurate to microseconds, but I also wanted to show how to perform high-precision conversions with arrow .

The code:

 from pymeeus.Sun import Sun from pymeeus.Epoch import Epoch year = 2018 target="winter" # Get terrestrial time of given solstice for given year solstice_epoch = Sun.get_equinox_solstice(year, target=target) print("%s solstice for %d in Terrestrial Time is at:\n %s" % (target, year, solstice_epoch.get_full_date())) print("%s solstice for %d in UTC, if last leap second was %s:\n %s" % (target, year, Epoch.get_last_leap_second()[:2], solstice_epoch.get_full_date(utc=True))) solstice_local = (solstice_epoch + Epoch.utc2local()/(24*60*60)) print("%s solstice for %d in local time, if last leap second was %s\n" " and local time offset is %.2f hours:\n %s" % (target, year, Epoch.get_last_leap_second()[:2], Epoch.utc2local() / 3600., solstice_local.get_full_date(utc=True))) 

Using a very cool Arrow module with lots of ISO and TZ : the best dates and times for Python that you can print more beautifully:

 import arrow import math slutc = solstice_epoch.get_full_date(utc=True) frac, whole = math.modf(slutc[5]) print("ie %s" % arrow.get(*slutc[:5], int(whole), round(frac * 1e6)).to('local')) 
0
source share

I implemented Jean Meeus (author of the above Astronomical Algorithms), the equinox and solstice algorithm in C and Java, if you're interested.

-one
source share

This library implements C ++ implementations of the Meeus algorithm major . It includes a clean code for calculating the solstice.

-one
source share

All Articles