Results for Observer() seemingly not accounting for elevation effects in PyEphem

陌路散爱 提交于 2019-12-05 03:42:52

The elevation of an observer means the elevation above sea level of their location — like the altitude of Flagstaff, Arizona, for example. But it is presumed that not only the observer and their telescope or binoculars is this distance above sea level; it is presumed that the ground — and thus the horizon — are also at this altitude. So an increased elevation gives you no advantage relative to the horizon, because the horizon moves with you when you move to a higher-altitude city.

After a few minutes with a pencil and yellow pad of paper, it looks like the angle down to the horizon hza is related to the earth's radius r and your height above the ground h as follows:

hza = - acos(r / (h + r))

So following on from your example above:

import math
height = 10000
hza = - math.acos(ephem.earth_radius / (height + ephem.earth_radius))
emphemObj.horizon = hza
print "Sunrise time @ 10000m: " + str(emphemObj.previous_rising(ephemResult))

I get the output:

Sunrise time @ 10000m: 2011/8/8 04:08:18

(Note that "sunrise" goes with previous_rising() and "sunset" goes with next_setting()!)

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