在日出时,太阳应该在地平线上(即东部海拔 0 度)。但如果我检查黄道经度:
- 日出时的太阳和
- from_altaz() 东零度
我对两者都有不同的价值。但它不应该是一样的吗?
from skyfield import almanac, api
from pytz import timezone
from datetime import datetime, timedelta
ts = api.load.timescale(builtin=True)
eph = api.load('de421.bsp')
earth = eph['EARTH']
sun = eph['SUN']
tz = timezone('UTC')
# 2019-12-23 01:23:58.273000+00:00
testTime = datetime(year=2019, month=12, day=23, hour=1,
minute=23, second=58)
testTime = tz.localize(testTime)
lat = '33.775867N'
lon = '84.39733E'
observer = api.Topos(lat, lon)
t0 = ts.utc(testTime)
t1 = ts.utc(testTime + timedelta(days=1))
t, y = almanac.find_discrete(t0, t1, almanac.sunrise_sunset(eph, observer))
for i, j in zip(t, y):
if j:
print('Sunrise : ', i.utc_datetime().astimezone(tz), j)
observer = earth + api.Topos(lat, lon)
zeroDegreeEast = observer.at(t0).from_altaz(alt_degrees=0, az_degrees=90)
_, lonAtHorizon, _ = zeroDegreeEast.ecliptic_latlon(epoch=t0)
sunAtSunRise = observer.at(t0).observe(sun).apparent()
_, lonSun, _ = sunAtSunRise.ecliptic_latlon(epoch=t0)
print('TestDate: ', testTime.isoformat())
print(lonAtHorizon)
print(lonSun)
Sunrise : 2019-12-23 01:23:58.273000+00:00 True
TestDate: 2019-12-23T01:23:58+00:00
288deg 05' 48.3"
270deg 53' 48.0"
我错过了什么?
我能做些什么来获得相同的值吗?