如何使用 Astropy 将坐标从 J2000 转换为纬度、经度和高度

问题描述 投票:0回答:1

我已按照本网站上与此问题相关的问题中的说明进行操作,但代码似乎全部关闭。一方面,海拔似乎太低了,而且我设置的时间似乎并没有对位置产生重大影响,但据我了解 J2000 框架对时间敏感,所以应该如此。

这是我在 VSCODE 中运行的代码:

from astropy import coordinates as coord
from astropy import units as u
from astropy import time
from astropy.time import Time

now = Time("2024-03-07 00:46:00.000", scale='utc')
xyz = [1155.746046202530, -6632.420367726780, 953.533229633281]
cartrep = coord.CartesianRepresentation(*xyz, unit=u.m)



gcrs = coord.GCRS(cartrep, obstime = now)
itrs = gcrs.transform_to(coord.ITRS(obstime = now))
loc = coord.EarthLocation(*itrs.cartesian.xyz)

print(loc.lat, loc.lon, loc.height)

这将返回 -1d21m45.24750203s 103d26m20.83691865s -6371417.547754194 m,我不确定这是否正确。海拔接近地球表面时应高出近500公里。而且时间似乎并没有太大影响。这些坐标和时间均基于国际空间站轨迹数据:https://spotthestation.nasa.gov/trajectory_data.cfm

python coordinate-systems astropy
1个回答
0
投票

您的单位不正确。应该是公里:

cartrep = coord.CartesianRepresentation(*xyz, unit=u.km)

这会给你

8d07m57.90049783s 103d26m20.84968463s 421.84457018512904 km

来自链接的网页与星历表(强调我的):

标题后,以四分钟为间隔列出 J2000 (J2K) 参考系平均值中的 ISS 状态向量,总长度为 15 天。在重新启动(平移操作)期间,状态向量以两秒的间隔报告。每个状态向量列出了 UTC 时间;位置 X、Y 和 Z 以 km 为单位;以及速度 X、Y 和 Z(单位为 km/s)。


真正的问题是您从哪里获取 2024-03-07 00:46:00.000 的数据;我只能看到当天午夜 (UTC) 时间戳后 44 和 48 分钟的数据。查看 X、Y、Z 数据并进行猜测插值,我在午夜时间戳过后 46 分钟内没有获得接近您的输入值。

© www.soinside.com 2019 - 2024. All rights reserved.