pyephem计算当前太阳时间 [英] Pyephem calculate current solar time

查看:161
本文介绍了pyephem计算当前太阳时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试根据UTC小时和经度来计算当地的太阳时间.我已经浏览过ephem包,但是无法确定这样做的直接方法.关于此问题的类似问题可能会引起对固定位置(日出,月亮,日落)的计算(例如来自UTC和经度的本地太阳时间函数).除了上述解决方案,还有其他选择吗?

I am trying to calculate the local solar time based on UTC hour and longitude. I have looked through the ephem package but was not able to identify a direct method to do so. Similar questions on this matter either evoke the calculation of fixed positions (sunrise, moon, sunset) (e.g. Calculating dawn and sunset times using PyEphem) or receive suggestions of simplified methods (e.g. Local solar time function from UTC and longitude). Is there any alternative to the aforementioned solutions?

预先感谢

推荐答案

要计算当地的太阳时间,我认为您可以直接请求该位置正下方的点(其最低点)的当前右上角,然后减去正确地了解太阳到当地午夜有多远的正确提升:

To compute local solar time, I think that you can just ask for the current right ascension of the point directly beneath the location (its nadir point), and subtract the right ascension of the Sun to learn exactly how far from local midnight it is:

from ephem import Sun, Observer, pi, hours

dt = '2016/08/27 19:19'

sun = Sun()
sun.compute(dt)

boston = Observer()
boston.lat = '42.37'
boston.lon = '-71.03'
boston.date = dt
ra, dec = boston.radec_of('0', '-90')

print 'Sun right ascension:', sun.ra
print 'Boston nadir right ascension:', ra
print 'Solar time:', hours((ra - sun.ra) % (2 * pi)), 'hours'

您能尝试一下这种方法,看看它是否能给您期望的数字以合理的精度?

Could you try out this approach and see whether it gives the numbers you expect to reasonable precision?

这篇关于pyephem计算当前太阳时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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