How to add JulianDate objects or offsets in Skyfield

一笑奈何 提交于 2019-12-01 13:07:05

Reference here,

My solution is as follows:

from skyfield.api import load
import numpy as np

data  = load('de421.bsp')
earth = data['earth']

ts=load.timescale()
t=ts.utc(2016, 1, np.linspace(17.4329,77.4329,61), 22.8, 4, 39.3)

p=earth.at(t)

p0  = p.position.au[:,0]
p60 = p.position.au[:,60]

dot = (p0*p60).sum()

cos_theta = dot / np.sqrt( (p0**2).sum() * (p60**2).sum() )

print (180./np.pi) * np.arccos(cos_theta)
print "should be roughly 60 degrees"

Happy programming.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!