NavList:
A Community Devoted to the Preservation and Practice of Celestial Navigation and Other Methods of Traditional Wayfinding
Re: Skyfield
From: Peter Monta
Date: 2018 Oct 23, 23:19 -0700
From: Peter Monta
Date: 2018 Oct 23, 23:19 -0700
Using the method in skyfield.almanac I get:
2018-Dec-21 22:22:44.1118 UT
I used a generic solver and got a similar result:
$ python solstice.py
2018-12-21T22:22:44.1336Z$
I wasn't aware of the almanac functions, so those may come in handy. Thanks. Here's my quick hack for comparison:
from skyfield.api import load
from scipy.optimize import fsolve
planets = load('de421.bsp')
earth,sun = planets['earth'],planets['sun']
ts = load.timescale()
def sun_ra_resid(dt):
astrometric = earth.at(ts.utc(2018,12,21,0,0,dt[0])).observe(sun)
ra,dec,dist = astrometric.apparent().radec(epoch='date')
return ra.hours - 18
dt_solstice = fsolve(sun_ra_resid,0)
t_solstice = ts.utc(2018,12,21,0,0,dt_solstice[0])
print(t_solstice.utc_iso(places=4))
The small disparity in time, 0.022 second, might be due to the specific ephemeris in the DE4xx family, or the nutation model if that's separate. I'm not 100% sure my code is set up correctly for the conventional definition of solstice.
Cheers,
Peter