subtract_psf

photutils.psf.subtract_psf(data, psf, posflux, subshape=None)[source]

Subtract PSF/PRFs from an image.

Parameters
dataNDData or array (must be 2D)

Image data.

psfastropy.modeling.Fittable2DModel instance

PSF/PRF model to be subtracted from the data.

posfluxArray-like of shape (3, N) or Table

Positions and fluxes for the objects to subtract. If an array, it is interpreted as (x, y, flux) If a table, the columns ‘x_fit’, ‘y_fit’, and ‘flux_fit’ must be present.

subshapelength-2 or None

The shape of the region around the center of the location to subtract the PSF from. If None, subtract from the whole image.

Returns
subdatasame shape and type as data

The image with the PSF subtracted