wcs_to_celestial_frame#

astropy.wcs.utils.wcs_to_celestial_frame(wcs)[源代码]#

对于给定的WCS,返回与WCS的天体分量匹配的坐标系。

参数:
wcs : WCS 实例WCS实例

要为其查找帧的WCS

返回:
frame : BaseCoordinateFrame 子类实例BaseCoordinateFrame子类实例

对象的一个实例 BaseCoordinateFrame 与指定WCS最匹配的子类实例。

笔记

将此函数扩展到中未定义的帧天文坐标,您可以编写自己的函数 WCS 实例并应返回框架的实例,或 None 如果没有找到匹配的帧。您可以将此函数临时注册到:

>>> from astropy.wcs.utils import wcs_to_celestial_frame, custom_wcs_to_frame_mappings
>>> with custom_wcs_to_frame_mappings(my_function):
...     wcs_to_celestial_frame(...)