如何使用Astropy将MJD(Julian Date)转换为UTC?
我在Astropy网站上尝试了一些东西,但仍然需要帮助。那里有人知道吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我在Astropy网站上尝试了一些东西,但仍然需要帮助。那里有人知道吗?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
是一个很好的起点。在这里,您将了解时间格式之间的区别,例如mjd和time scale ,也像UTC。
The documentation at https://docs.astropy.org/en/stable/time/index.html is a good place to start. There you will learn about the distinction between a time format like MJD and a time scale like UTC.
看起来这返回了所需的结果。
Looks like this returns the desired result.
MJD是日期格式,而UTC是时间尺度,因此我认为您的意思是将MJD转换为ISO等另一种标准格式。
如果您的MJD时间已经达到UTC量表,则可以传递到Astropy Time对象(如上述答案之一),并将其直接称为MJD格式(可以避免使用MJD到JD转换)。此外,如果您的时代处于另一个量表(例如TDB或TT),则可以在传递时间类时指定,并且可以为您转换。默认的比例尺Astropy Time用途是UTC。
对于可以与Astropy Time一起使用的时间格式和秤的完整列表,您可以分别运行命令
time.formats
和time.scales.scales
。MJD is a date format whereas UTC is a time scale, so I assume you mean convert MJD to another standard format like ISO.
If your MJD time is already in UTC scale, you can pass to an astropy Time object (like one of the above answers) and directly call it as a MJD format (can avoid the MJD to JD conversion). Additionally, if your epoch is in another scale (like TDB or TT) you can specify that when passing to the Time class and it will be able to convert for you. The default scale astropy Time uses is UTC.
For a full list of the time formats and scales you can use with astropy Time, you can run the commands
Time.FORMATS
andTime.SCALES
respectively.