fitsmgmt.wcs.center_radec

fitsmgmt.wcs.center_radec(
    ccd_or_header,
    center_of_image=True,
    ra_key='RA',
    dec_key='DEC',
    equinox=None,
    frame=None,
    equinox_key='EPOCH',
    frame_key='RADECSYS',
    ra_unit=u.hourangle,
    dec_unit=u.deg,
    mode='all',
    verbose=True,
    plain=False,
)

Returns the central ra/dec from header or ~astropy.wcs.WCS.

Notes

Even though RA or DEC is in sexagesimal, e.g., “20 53 20”, astropy correctly reads it in such a form, so no worries.

Parameters

ccd_or_header : ~astropy.nddata.CCDData or ~astropy.io.fits.Header

The CCDData or header to extract central RA/DEC from keywords or ~astropy.wcs.WCS.

center_of_image : bool = True

If True, ~astropy.wcs.WCS information will be extracted from the ccd or header, rather than relying on the ra_key and dec_key keywords directly. If False, ra_key and dec_key from the header will be understood as the “center” and the RA, DEC of that location will be returned.

equinox : str = None

The equinox and frame for SkyCoord. Default (None) will use the default of SkyCoord. Important only if center_of_image=False. Default: None.

frame : str = None

The equinox and frame for SkyCoord. Default (None) will use the default of SkyCoord. Important only if center_of_image=False. Default: None.

ra_key : str = 'RA'

Header keys used when center_of_image=False.

dec_key : str = 'RA'

Header keys used when center_of_image=False.

equinox_key : str = 'RA'

Header keys used when center_of_image=False.

frame_key : str = 'RA'

Header keys used when center_of_image=False.

ra_unit : ~astropy.units.Unit = u.hourangle

Units of RA and DEC values read from header keywords when center_of_image=False.

dec_unit : ~astropy.units.Unit = u.hourangle

Units of RA and DEC values read from header keywords when center_of_image=False.

mode : all or wcs = 'all'

Whether to do the transformation including distortions ('all') or only including only the core ~astropy.wcs.WCS transformation ('wcs'). Important only if center_of_image=True. Default: 'all'.

plain : bool, optional. = False

If True, only the values of RA/DEC in degrees will be returned. Otherwise (default), a ~astropy.coordinates.SkyCoord object will be returned. Default: False.