Observer() 的结果似乎没有考虑 PyEphem 中的海拔影响

发布于 2024-12-07 22:51:13 字数 998 浏览 0 评论 0原文

我对 PyEphem 模块给出的与 Observer() 查询相关的结果以及海拔的影响进行了查询。我从几个来源了解到(例如http://curious.astro.cornell.edu/question)。 php?number=388)表明观察者的海拔对日落时间有显着影响。然而,在下面的代码中,我看到几乎没有什么区别:

import ephem

emphemObj = ephem.Observer()
emphemObj.date = '2011/08/09'
emphemObj.lat = '53.4167'
emphemObj.long = '-3'
emphemObj.elevation = 0

ephemResult = ephem.Sun()
ephemResult.compute(emphemObj)
print "Sunset time @ 0m: " + str(emphemObj.previous_rising(ephemResult))

emphemObj.elevation = 10000
ephemResult.compute(emphemObj)
print "Sunset time @ 10000m: " + str(emphemObj.previous_rising(ephemResult))

我得到输出:

Sunset time @ 0m: 2011/8/8 04:38:34
Sunset time @ 10000m: 2011/8/8 04:38:34

我相当确定我做错了什么而不是这是一个错误,但在尝试了多种不同的方法后,我担心我继续以相同的结果结束。有谁知道我在这里做错了什么?

我已经在 https://launchpad.net/pyephem 上发布了此内容,但没有得到回复。我希望我没有从根本上误解海拔函数的目的......

I've a query on the results given by the PyEphem module relating to Observer() queries, and the effects of elevation. I understand from a couple of sources (such as http://curious.astro.cornell.edu/question.php?number=388) that the elevation of the observer has a marked effect on sunset time. However in the following code, I see next to no difference:

import ephem

emphemObj = ephem.Observer()
emphemObj.date = '2011/08/09'
emphemObj.lat = '53.4167'
emphemObj.long = '-3'
emphemObj.elevation = 0

ephemResult = ephem.Sun()
ephemResult.compute(emphemObj)
print "Sunset time @ 0m: " + str(emphemObj.previous_rising(ephemResult))

emphemObj.elevation = 10000
ephemResult.compute(emphemObj)
print "Sunset time @ 10000m: " + str(emphemObj.previous_rising(ephemResult))

I get the output:

Sunset time @ 0m: 2011/8/8 04:38:34
Sunset time @ 10000m: 2011/8/8 04:38:34

I'm fairly sure I'm doing something wrong rather than this being a bug, but having tried a number of different ways, I'm afraid I keep winding up with the same results. Does anyone know what I'm doing wrong here?

I posted this on https://launchpad.net/pyephem already, but I've had no response. I'm hoping I've not fundamentally misunderstood the purpose of the elevation function...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

李不 2024-12-14 22:51:13

观察者的海拔是指其所在位置的海拔高度,例如亚利桑那州弗拉格斯塔夫的海拔。但据推测,不仅观察者和他们的望远镜或双筒望远镜处于这个海拔高度;据推测,地面——以及地平线——也处于这个高度。因此,增加海拔相对于地平线来说并没有任何优势,因为当您移动到海拔更高的城市时,地平线会随着您移动。

用铅笔和黄色纸片几分钟后,看起来与地平线的角度 hza 与地球半径 r 和您距地面的高度有关h 如下:

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

因此,按照上面的示例:

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))

我得到输出:(

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

请注意,“sunrise”与 previous_rising() 一起使用,而“sunset”与next_setting()!)

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()!)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文