python怎样使用各个日期赤纬_科学网—PyEphem基本功能介绍 - 张金龙的博文

本文介绍了Python程序包PyEphem的基本功能,用于进行天文历算。通过实例展示了如何计算火星在2018年的星座、不同天体在1970年的位置信息,以及如何根据观测者位置获取天体的高度和方位。此外,还讨论了日期转换、坐标系转换、天体的升降与中天时刻等天文计算方法。
摘要由CSDN通过智能技术生成

PyEphem为Python下的一个程序包, 用来进行天文历算, 虽然是爱好者编写的, 但是由于使用VOS87行星运动数据, 计算精度达到了很高的精度, 足以满足一般的观测需要。 详情参见 http://rhodesmill.org/pyephem/ 本文是学习该程序包的读书笔记。

火星在2018年的星座import ephem

m = ephem.Mars('2018')

print(ephem.constellation(m))('Lib', 'Libra')

计算不同天体在1970年1月1日0时的位置等信息from ephem import *

mars = Mars('1970') # 火星

print('%s, %s, %.10f' % (mars.name, mars.elong, mars.size))

sun = Sun('1970') # 太阳

print('%s, %s, %.10f' % (sun.name, sun.elong, sun.size))

moon = Moon('1970') # 月亮

print('%s, %s, %.10f' % (moon.name, moon.elong, moon.size))

mercury = Mercury('1970') # 水星

print('%s, %s, %.10f' % (mercury.name, mercury.elong, mercury.size))

venus = Venus('1970') # 金星

print('%s, %s, %.10f' % (venus.name, venus.elong, venus.size))

jupiter = Jupiter('1970') # 木星

print('%s, %s, %.10f' % (jupiter.name, jupiter.elong, jupiter.size))

saturn = Saturn('1970') # 土星

print('%s, %s, %.10f' % (saturn.name, saturn.elong, saturn.size))

uranus = Uranus('1970') # 天王星

print('%s, %s, %.10f' % (uranus.name, uranus.elong, uranus.size))

neptune = Neptune('1970') # 海王星

print('%s, %s, %.10f' % (neptune.name, neptune.elong, neptune.size))

pluto = Pluto('1970') # 冥王星

print('%s, %s , %.10f' % (pluto.name, pluto.elong, pluto.size))Mars, 62:04:48.0, 5.9295825958

Sun, 0:00:00.0, 1951.8359375000

Moon, -89:27:48.3, 1831.0117187500

Mercury, 18:52:17.4, 7.5804867744

Venus, -5:42:32.4, 9.9605798721

Jupiter, -67:50:24.1, 34.2474060059

Saturn, 111:52:32.6, 18.8122367859

Uranus, -91:26:29.1, 3.8586533070

Neptune, -40:17:59.5, 2.1982953548

Pluto, -102:16:48.8 , 0.2606950402### a_ra — Astrometric geocentric right ascension for the epoch specified

### a_dec — Astrometric geocentric declination for the epoch specified

### g_ra and ra — Apparent geocentric right ascension for the epoch-of-date

### g_dec and dec — Apparent geocentric declination for the epoch-of-date

### elong — Elongation (angle to sun)

### mag — Magnitude

### size — Size (diameter in arcseconds)

### radius — Size (radius as an angle)

### circumpolar — whether it stays above the horizon

### neverup — whether is stays

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值