skycoord_to_pixel#
- astropy.wcs.utils.skycoord_to_pixel(coords, wcs, origin=0, mode='all', *, native_pixel_order=None)[source]#
Convert a set of SkyCoord coordinates into pixels.
- Parameters:
- coords
SkyCoord The coordinates to convert.
- wcs
WCS The WCS transformation to use.
- origin
int Whether to return 0 or 1-based pixel coordinates.
- mode‘all’ or ‘wcs’
Whether to do the transformation including distortions (
'all') or only including only the core WCS transformation ('wcs').- native_pixel_orderbool or
None, optional Whether the pixel coordinates are in the native order of the WCS pixel axes (
True) or, for WCS objects in which latitude comes before longitude, swapped such thatxpcorresponds to longitude andypto latitude (False, the historical behavior). IfNone(the default), the historical behavior is used and a deprecation warning is emitted for WCS objects in which latitude comes before longitude. This argument has no effect for WCS objects in which longitude comes before latitude.
- coords
- Returns:
- xp, yp
numpy.ndarray The pixel coordinates
- xp, yp