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:
coordsSkyCoord

The coordinates to convert.

wcsWCS

The WCS transformation to use.

originint

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 that xp corresponds to longitude and yp to latitude (False, the historical behavior). If None (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.

Returns:
xp, ypnumpy.ndarray

The pixel coordinates