<p>I believe the differences here are caused by the different timescales that are being used by SkyField vs NASA. </p>

<p>It seems that SkyField uses the proleptic Gregorian calendar for dates in the past. However, NASA used the Julian Calendar for dates before 1582, so for example, the eclipse on 0150-12-06 (Julian) falls on 0150-12-05 in Gregorian. Also, I would use <code>ts.ut1</code> instead of <code>ts.utc</code>, as ut1 is the timescale used by NASA. </p>

<p>Using the geocenter can be a efficient way to check for eclipses worldwide. When observing from the geocenter, the penumbral shadow cone touches the Earth when the following condition is true:
$$\mu ≤ arcsin(\frac{r_m + r_e}{d_m}) + arcsin(\frac{R_s - r_e}{D_s})$$
Where $\mu$ is the angular separation between the Sun and the Moon, $D_s$ is the distance of the Sun, $d_m$ the distance of the Moon, and the three constant radii are:</p>

<p>Sun: $R_s = 695700 km$</p>

<p>Earth: $r_e = 6378 km$</p>

<p>Moon: $r_m = 1737.4 km$</p>

<p>This indicates that an eclipse, at least partial, is occuring somewhere on the Earth. The formula uses a spherical Earth as an approximation of its shape, so in some rare cases it can detect very near-misses by 20-25 km, but overall it is a good way to narrow down the search. Also, it is unnecessary to test this when the angular separation is outside the range 1.3° - 1.7°, since values below 1.3° always produce an eclipse, and values above 1.7° never produce one.</p>

<p>I would also like to point out that uncertainties, mostly in Earth's rotation speed, make it very difficult to know where eclipses occured on the surface of the Earth for dates in the far past. The uncertainty becomes very large outside the range BC2000 - AD3000. This is the reason why NASA hasn't computed eclipse paths outside that range. According to research, the uncertainty could be as large as over 4 hours (several thousands of kilometers for eclipse paths) for dates before BC4000. See <a href="https://eclipse.gsfc.nasa.gov/SEcat5/uncertainty.html" rel="nofollow noreferrer">this</a> explanation on NASA's Eclipse Web Site.</p>

CC BY-SA 4.0
2020-10-22T17:10:05.013Z
Note that you can tell SkyField to switch over to Julian at a date of your choosing. The usual date is even given as a constant: `ts.julian_calendar_cutoff = GREGORIAN_START` You do have to load that constant, though: `from skyfield.api import GREGORIAN_START`
L. Scott Johnson
CC BY-SA 3.0
2017-11-24T05:29:57.807Z
2017-11-25T13:09:44.797Z
2017-11-25T13:09:44.797Z
FSimardGIS
<p>I'm trying to compute solar eclipses for a long period of time, see <a href="https://astronomy.stackexchange.com/questions/21402/back-predicting-solar-eclipses">Back-predicting solar eclipses</a></p>

<p>Initially, I wanted at several points on Earth whether an eclipse was visible at some point in time.
I have since changed the approach and I will now compute whether an eclipse could be seen from the center of the Earth at a given moment. Later, after knowing roughly the time of the eclipse, I will iterate over a grid on Earth to check where it could be actually seen.
So far, my first question is: is it right to check for eclipses at the center of the Earth?</p>

<p>Secondly, I wrote a small code in Python to test how good I am at predicting eclipses, checking against <a href="https://eclipse.gsfc.nasa.gov/SEsearch/SEsearchmap.php?Ecl=01501207" rel="nofollow noreferrer">https://eclipse.gsfc.nasa.gov/SEsearch/SEsearchmap.php?Ecl=01501207</a>
for these coordinates:</p>

<p>Lat.: 27.4782° N
Long.: 109.9299° W</p>

<pre><code>#!/usr/bin/python

from skyfield.api import load, Topos
from skyfield.positionlib import ICRF

planets = load('Ephemerides/de422.bsp')
ts = load.timescale()

earth = planets['earth']
sun = planets['sun']
moon = planets['moon']

time = ts.utc(150,12,06,23,49,21.9)
place = earth + Topos('27.4782 N','109.9299 W')

observe_moon = place.at(time).observe(moon).apparent().position.au
observe_sun = place.at(time).observe(sun).apparent().position.au
distance = ICRF(observe_moon).separation_from(ICRF(observe_sun))
distance = distance.degrees

print distance
</code></pre>

<p>The distance I obtain is above 10 degrees, while at the time provided, if I did things correctly, the eclipse was at its maximum at those coordinates. What is wrong in my code or my understanding?</p>

<solar-eclipse><python>
Eclipses with SkyField
Keizer
# Eclipses with SkyField

(Asked by: username_0 on 2017-10-03)

I'm trying to compute solar eclipses for a long period of time, see Back-predicting solar eclipses
Initially, I wanted at several points on Earth whether an eclipse was visible at some point in time.
I have since changed the approach and I will now compute whether an eclipse could be seen from the center of the Earth at a given moment. Later, after knowing roughly the time of the eclipse, I will iterate over a grid on Earth to check where it could be actually seen.
So far, my first question is: is it right to check for eclipses at the center of the Earth?
Secondly, I wrote a small code in Python to test how good I am at predicting eclipses, checking against https://eclipse.gsfc.nasa.gov/SEsearch/SEsearchmap.php?Ecl=01501207
for these coordinates:
Lat.: 27.4782° N
Long.: 109.9299° W
#!/usr/bin/python

from skyfield.api import load, Topos
from skyfield.positionlib import ICRF

planets = load('Ephemerides/de422.bsp')
ts = load.timescale()

earth = planets['earth']
sun = planets['sun']
moon = planets['moon']

time = ts.utc(150,12,06,23,49,21.9)
place = earth + Topos('27.4782 N','109.9299 W')

observe_moon = place.at(time).observe(moon).apparent().position.au
observe_sun = place.at(time).observe(sun).apparent().position.au
distance = ICRF(observe_moon).separation_from(ICRF(observe_sun))
distance = distance.degrees

print distance

The distance I obtain is above 10 degrees, while at the time provided, if I did things correctly, the eclipse was at its maximum at those coordinates. What is wrong in my code or my understanding?

**Tags:** solar-eclipse, python


---

## 1 answers

### Answer by username_1 on 2017-11-24. Score: 3 | Accepted answer

I believe the differences here are caused by the different timescales that are being used by SkyField vs NASA.

It seems that SkyField uses the proleptic Gregorian calendar for dates in the past. However, NASA used the Julian Calendar for dates before 1582, so for example, the eclipse on 0150-12-06 (Julian) falls on 0150-12-05 in Gregorian. Also, I would use `ts.ut1` instead of `ts.utc`, as ut1 is the timescale used by NASA.

Using the geocenter can be a efficient way to check for eclipses worldwide. When observing from the geocenter, the penumbral shadow cone touches the Earth when the following condition is true:
$$\mu ≤ arcsin(\frac{r\_m + r\_e}{d\_m}) + arcsin(\frac{R\_s - r\_e}{D\_s})$$
Where $\mu$ is the angular separation between the Sun and the Moon, $D\_s$ is the distance of the Sun, $d\_m$ the distance of the Moon, and the three constant radii are:

Sun: $R\_s = 695700 km$

Earth: $r\_e = 6378 km$

Moon: $r\_m = 1737.4 km$

This indicates that an eclipse, at least partial, is occuring somewhere on the Earth. The formula uses a spherical Earth as an approximation of its shape, so in some rare cases it can detect very near-misses by 20-25 km, but overall it is a good way to narrow down the search. Also, it is unnecessary to test this when the angular separation is outside the range 1.3° - 1.7°, since values below 1.3° always produce an eclipse, and values above 1.7° never produce one.

I would also like to point out that uncertainties, mostly in Earth's rotation speed, make it very difficult to know where eclipses occured on the surface of the Earth for dates in the far past. The uncertainty becomes very large outside the range BC2000 - AD3000. This is the reason why NASA hasn't computed eclipse paths outside that range. According to research, the uncertainty could be as large as over 4 hours (several thousands of kilometers for eclipse paths) for dates before BC4000. See [this](https://eclipse.gsfc.nasa.gov/SEcat5/uncertainty.html) explanation on NASA's Eclipse Web Site.

> **Comments:**
> **username_2**: Note that you can tell SkyField to switch over to Julian at a date of your choosing. The usual date is even given as a constant: `ts.julian_calendar_cutoff = GREGORIAN_START` You do have to load that constant, though: `from skyfield.api import GREGORIAN_START`  

---

