How to convert Earth Centered Inertial (ECI) coordinates to Earth Centered Earth Fixed (ECEF) AstroPy? Other?

泄露秘密 提交于 2019-12-04 19:14:10
Stuart P Littlefair

There are a number of different Earth Centered Inertial frames, and the answer depends on which one you have your coordinates in.

The most common is so-called J2000; which is defined w.r.t to the orientation of the Earth on Jan 1st 2000. Another common one is GCRF, which is almost the same (to within 80 milli arcseconds).

If it’s either of those two, you should be able to create an astropy EarthLocation object and access the lat, lon and height attributes like so

from astropy import coordinates as coord
from astropy import units as u
from astropy.time import Time
now = Time('2017-09-27 12:22:00')
# position of satellite in GCRS or J20000 ECI:
cartrep = coord.CartesianRepresentation(x=5713846.540659178, 
                                        y=3298890.8383577876,
                                        z=0., unit=u.m)
gcrs = coord.GCRS(cartrep, obstime=now)
itrs = gcrs.transform_to(coord.ITRS(obstime=now))
loc = coord.EarthLocation(*itrs.cartesian.cartrep )
print(loc.lat, loc.lon, loc.height)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!