รองรับทั้ง Python 2 และ Python 3
ใช้ License: LGPL
ติดตั้งได้ด้วยคำสั่ง
pip install pyephemตัวอย่างการใช้งาน
>>> import ephem
>>> mars = ephem.Mars()
>>> mars.compute('2008/1/1')
>>> print mars.ra, mars.dec
5:59:27.35 26:56:27.4
เรามาคำนวณหาวันเวลาพระจันทร์เต็มดวงและดับด้วยกันครับ
import ephem
d1 = ephem.next_full_moon('2017') # คำนวณในปี 2017
print(d1)
d2 = ephem.next_new_moon(d1)
print(d2)
ผลลัพธ์
2017/1/12 11:33:58 2017/1/28 00:07:02
อ่านเอกสารการใช้งานได้ที่ http://rhodesmill.org/pyephem/

0 ความคิดเห็น:
แสดงความคิดเห็น
แสดงความคิดเห็นได้ครับ :)