Astropy:为什么在将坐标从J2000转换为地球位置对象时,我得到错误的结果?
创始人
2024-09-20 22:30:20
0

问题出现在没有考虑到时差和地球形状。可以使用以下代码解决问题:

from astropy import units as u
from astropy.coordinates import EarthLocation, ICRS, SkyCoord
from astropy.time import Time

# Define the J2000 coordinates
ra = 10 * u.deg
dec = 20 * u.deg
distance = 1 * u.pc
coord_j2000 = SkyCoord(ra, dec, distance, frame='icrs')

# Define the time and Earth location
time = Time('2010-01-01T00:00:00.000')
location = EarthLocation(lon=0 * u.deg, lat=50 * u.deg, height=0 * u.m)

# Transform the J2000 coordinates to the Earth Location frame
coord_earth = coord_j2000.transform_to(ICRS(obstime=time)).transform_to(location.get_gcrs(time)).transform_to(location.get_itrs())

# Print the transformed coordinates
print(coord_earth.ra, coord_earth.dec, coord_earth.distance)

这会输出地球坐标系下的正确坐标。

相关内容

热门资讯

辅助透视!aapoker怎么提... 辅助透视!aapoker怎么提高中牌率,小程序微乐贵阳捉鸡麻将挂,策略教程(有挂解密)-哔哩哔哩1、...
了解透视!wepoker透视苹... 了解透视!wepoker透视苹果系统,微信小程序四川微乐脚本,步骤教程(有挂存在)-哔哩哔哩1、很好...
总结透视!wepoker游戏安... 总结透视!wepoker游戏安装教程,微乐游戏小程序脚本,诀窍教程(有挂规律)-哔哩哔哩1、每一步都...
详细透视!约局吧怎么看有没有挂... 详细透视!约局吧怎么看有没有挂,微乐自建房道具有用吗,方针教程(有人有挂)-哔哩哔哩1、游戏颠覆性的...
解密透视!xpoker辅助助手... 解密透视!xpoker辅助助手,微信微乐游戏辅助脚本,妙招教程(有挂透明挂)-哔哩哔哩该软件可以轻松...
解密透视!wepoker安装教... 解密透视!wepoker安装教程,微乐小程序修复系统有用吗,技法教程(有挂头条)-哔哩哔哩1、超多福...
总结透视!wpk透视怎么安装,... 您好,wpk透视怎么安装这款游戏可以开挂的,确实是有挂的,需要了解加去威信【485275054】很多...
必备透视!来玩app破解版,微... 必备透视!来玩app破解版,微乐小游戏万能修改器,绝活儿教程(有挂技巧)-哔哩哔哩1、金币登录送、破...
了解透视!wpk有作弊吗,微乐... 了解透视!wpk有作弊吗,微乐辅助靠谱麻,指南教程(有挂攻略)-哔哩哔哩1、完成wpk有作弊吗辅助器...
普及透视!aapoker发牌逻... 普及透视!aapoker发牌逻辑,微乐自建房免费黑科技下载苹果,烘培教程(竟然有挂)-哔哩哔哩在进入...