如何使用 astropy 将 MJD(儒略日期)转换为 UTC?

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

我已经在 astropy 网站上尝试过一些东西,但仍然需要帮助。有人知道吗?

python astropy
2个回答
1
投票

https://docs.astropy.org/en/stable/time/index.html 上的文档是一个很好的起点。在那里您将了解时间格式(如 MJD)和时间比例(如 UTC)之间的区别。


0
投票
看起来这会返回所需的结果。

from astropy.time import Time # Start with some time in modified julian date (MJD) mjd = 58134.09699299725 # Convert to Julian Date jd = mjd + 2400000.5 # Convert to astropy Time object t = Time(jd, format='jd') # Convert to datetime utc = t.to_datetime()
    
© www.soinside.com 2019 - 2024. All rights reserved.