>>> import Pysolar
>>> import datetime
>>> d = datetime.datetime.utcnow() # create a datetime object for now
>>> Pysolar.GetAltitude(42.206, -71.382, d)
-20.453156227223857
>>> d = datetime.datetime(2007, 2, 18, 20, 13, 1, 130320) # try another date
>>> Pysolar.GetAltitude(42.206, -71.382, d)
19.551710266768644
Pysolar is an implementation in Python that can give you altitude/azimuth. http://pysolar.org/ - I came across it after realizing that the NOVAS system in one of the other answers didn't support Windows.
发布评论
评论(2)
您看过USNO NOVAS例程吗?
Have you looked at the USNO NOVAS routines?
Pysolar 是 Python 中的一个实现,可以为您提供高度/方位角。 http://pysolar.org/ - 我在意识到其他答案之一中的 NOVAS 系统没有不支持Windows。
来自文档(https://github.com/pingswept/pysolar/wiki/examples ):
Pysolar is an implementation in Python that can give you altitude/azimuth. http://pysolar.org/ - I came across it after realizing that the NOVAS system in one of the other answers didn't support Windows.
From the docs (https://github.com/pingswept/pysolar/wiki/examples):