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 the input
dataimage will not be extracted.- Parameters:
- data
NDDataor list ofNDData A
NDDataobject or a list ofNDDataobjects containing the 2D image(s) from which to extract the stars. If the inputcatalogscontain only the sky coordinates (i.e., not the pixel coordinates) of the stars then each of theNDDataobjects must have a validwcsattribute.- 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
NDDataobject), they are assumed to correspond to the list ofNDDataobjects 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 (inxandycolumns) or sky coordinates (in askycoordcolumn containing aSkyCoordobject). If both are specified, then the pixel coordinates will be used.If a single source catalog is input with multiple
NDDataobjects, 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 aSkyCoordobject contained in a column calledskycoord. EachNDDataobject in the inputdatamust also have a validwcsattribute. Pixel coordinates (inxandycolumns) will be ignored.Optionally, each catalog may also contain an
idcolumn representing the ID/name of stars. If this column is not present then the extracted stars will be given anidnumber corresponding the table row number (starting at 1). Any other columns present in the inputcatalogswill be ignored.- sizeint or array_like (int), optional
The extraction box size along each axis. If
sizeis a scalar then a square box of sizesizewill be used. Ifsizehas two elements, they must be in(ny, nx)order.sizemust have odd values and be greater than or equal to 3 for both axes.
- data
- Returns: