extract_stars#
- photutils.psf.extract_stars(data, catalogs, *, size=(11, 11))[source]#
Extract cutout images centered on stars defined in the input catalog(s).
Stars where the cutout array bounds partially or completely lie outside of the input
data
image will not be extracted.- Parameters:
- data
NDData
or list ofNDData
A
NDData
object or a list ofNDData
objects containing the 2D image(s) from which to extract the stars. If the inputcatalogs
contain only the sky coordinates (i.e., not the pixel coordinates) of the stars then each of theNDData
objects must have a validwcs
attribute.- catalogs
Table
, list ofTable
A catalog or list of catalogs of sources to be extracted from the input
data
. To link stars in multiple images as a single source, you must use a single source catalog where the positions defined in sky coordinates.If a list of catalogs is input (or a single catalog with a single
NDData
object), they are assumed to correspond to the list ofNDData
objects input indata
(i.e., a separate source catalog for each 2D image). For this case, the center of each source can be defined either in pixel coordinates (inx
andy
columns) or sky coordinates (in askycoord
column containing aSkyCoord
object). If both are specified, then the pixel coordinates will be used.If a single source catalog is input with multiple
NDData
objects, then these sources will be extracted from every 2D image in the inputdata
. In this case, the sky coordinates for each source must be specified as aSkyCoord
object contained in a column calledskycoord
. EachNDData
object in the inputdata
must also have a validwcs
attribute. Pixel coordinates (inx
andy
columns) will be ignored.Optionally, each catalog may also contain an
id
column representing the ID/name of stars. If this column is not present then the extracted stars will be given anid
number corresponding the table row number (starting at 1). Any other columns present in the inputcatalogs
will be ignored.- sizeint or array_like (int), optional
The extraction box size along each axis. If
size
is a scalar then a square box of sizesize
will be used. Ifsize
has two elements, they must be in(ny, nx)
order.size
must have odd values and be greater than or equal to 3 for both axes.
- data
- Returns: