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)

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

相关内容

热门资讯

透视辅助"竞技联盟透... 透视辅助"竞技联盟透视"详细辅助2025新版教程(透视app下载辅助);致您一封信;亲爱竞技联盟透视...
透视私人局"佛手大菠... 1、透视私人局"佛手大菠萝13道挂哪里"详细辅助玩家教你(可以开辅助攻略)。2、佛手大菠萝13道挂哪...
透视安卓版"aapo... 透视安卓版"aapoker怎么开辅助器"详细辅助可靠技巧(可以提高运气神器);支持多人共享记分板与复...
透视黑科技"wepo... 透视黑科技"wepoker怎么挂飞机"详细辅助规律教程(游戏安装教程辅助)是一款可以让一直输的玩家,...
透视计算"智星德州插... 1、透视计算"智星德州插件最新版本更新内容详解"详细辅助解说技巧(开挂透明);详细教程。2、智星德州...
透视中牌率"wepo... 透视中牌率"wepoker的辅助器"详细辅助黑科技教程(有辅助透视);最新版2024是一款经典耐玩的...
透视黑科技"wepo... 透视黑科技"wepoker有辅助插件吗"详细辅助曝光教程(透视有用透明)准备好在wepoker有辅助...
透视线上"hhpok... 透视线上"hhpoker辅助挂是真的吗"详细辅助2025版教程(有插件神器)1、不需要AI权限,帮助...
透视规律"uupok... 透视规律"uupoker透视"详细辅助微扑克教程(有挂软件);最新版2024是一款经典耐玩的益智游戏...
透视攻略"wepok... 透视攻略"wepoker私人局透视方法"详细辅助wpk教程(私人局俱乐部可以进技巧);原来确实真的有...