Observer()的结果似乎无法解决PyEphem中的高程影响 [英] Results for Observer() seemingly not accounting for elevation effects in PyEphem

查看:115
本文介绍了Observer()的结果似乎无法解决PyEphem中的高程影响的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

我得到输出:

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?

我已经在 https://launchpad.net/pyephem 上发布了此消息,但没有任何回应.我希望我不会从根本上误解了标高函数的目的...

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

推荐答案

观察者的elevation表示他们所在位置的海拔高度,例如亚利桑那州弗拉格斯塔夫的海拔.但是可以推测,不仅观察者及其望远镜或双筒望远镜都在海平面以上.假定地面(也就是地平线)在此高度上也是 .因此,增加elevation相对于地平线不会给您带来任何优势,因为当您搬到海拔较高的城市时,地平线会随您一起移动.

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.

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

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

我得到输出:

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

(请注意,日出"与previous_rising()相伴,而日落"与next_setting()相伴!)

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

这篇关于Observer()的结果似乎无法解决PyEphem中的高程影响的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆