wcs_to_celestial_frame¶
-
astropy.wcs.utils.wcs_to_celestial_frame(wcs)[source]¶ For a given WCS, return the coordinate frame that matches the celestial component of the WCS.
Parameters: - wcs :
WCSinstance The WCS to find the frame for
Returns: - frame :
BaseCoordinateFramesubclass instance An instance of a
BaseCoordinateFramesubclass instance that best matches the specified WCS.
Notes
To extend this function to frames not defined in astropy.coordinates, you can write your own function which should take a
WCSinstance and should return either an instance of a frame, orNoneif no matching frame was found. You can register this function temporarily with:>>> 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(...)
- wcs :