我已经在 astropy 网站上尝试过一些东西,但仍然需要帮助。有人知道吗?
https://docs.astropy.org/en/stable/time/index.html 上的文档是一个很好的起点。在那里您将了解时间格式(如 MJD)和时间比例(如 UTC)之间的区别。
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()