For a given WCS, return the coordinate frame that matches the celestial component of the WCS.
Parameters: | wcs : WCS instance
|
---|---|
Returns: | frame : BaseCoordinateFrame subclass instance
|
Notes
To extend this function to frames not defined in astropy.coordinates, you can write your own function which should take a WCS instance and should return either an instance of a frame, or None if no matching frame was found. You can register this function temporarily with:
>>> from astropy.wcs.utils import wcs_to_celestial_frame, custom_frame_mappings
>>> with custom_frame_mappings(my_function):
... wcs_to_celestial_frame(...)