How to get earth-inertial or earth-centered coordinates of objects from PyEphem?

南楼画角 提交于 2019-12-10 18:38:57

问题


I would like to get coordinates of objects in various XYZ coordinates, not where they appear in the sky. I'm interested in:

  1. ECE: "Earth Centered Inertial" (not rotation with the earth)

  2. ECEF: "Earth Centered Earth-Fixed" (not inertial, also called "Earth Centered Rotational"

  3. and some kind of solar system or ecliptic coordinates (sun or barycenter centered).

I've installed PyEphem, run a few examples, and have started to understand what's under the hood, but so far the examples I've found seem to focus on how things appear in the sky.

Either a link to a useful "how to" or a simple example would be helpful. Right now I don't see where to go with the standard options:

In [55]: mars.
mars.a_dec              mars.g_dec              mars.radius
mars.a_epoch            mars.g_ra               mars.rise_az
mars.a_ra               mars.hlat               mars.rise_time
mars.alt                mars.hlon               mars.set_az
mars.az                 mars.hlong              mars.set_time
mars.circumpolar        mars.mag                mars.size
mars.compute            mars.name               mars.sun_distance
mars.copy               mars.neverup            mars.transit_alt
mars.dec                mars.parallactic_angle  mars.transit_time
mars.earth_distance     mars.phase              mars.writedb
mars.elong              mars.ra

In [55]: mars.

回答1:


The old C library that PyEphem is a wrapper around does not, alas, always use (x, y, z) coordinates internally, and when it does it does not expose them so that Python can see what they were — the (x, y, z) coordinates are discarded once the angles have been computed.

For a newer astronomy library by the same author (as it happens, me!) that has been completely rewritten so that (x, y, z) coordinates are indeed available every step of the way, try taking a look at Skyfield:

http://rhodesmill.org/skyfield/

In particular, look at how attributes like .position.km and .position.au let you get any position and decompose it into (x, y, z) Cartesian coordinates:

http://rhodesmill.org/skyfield/positions.html



来源:https://stackoverflow.com/questions/34530288/how-to-get-earth-inertial-or-earth-centered-coordinates-of-objects-from-pyephem

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!