prepare_psf_model

photutils.psf.prepare_psf_model(psfmodel, *, xname=None, yname=None, fluxname=None, renormalize_psf=True)[source]

Deprecated since version 1.9.0: The prepare_psf_model function is deprecated and may be removed in a future version. Use make_psf_model instead.

Convert a 2D PSF model to one suitable for use with BasicPSFPhotometry or its subclasses.

Note

This function is needed only in special cases where the PSF model does not have x_0, y_0, and flux model parameters. In particular, it is not needed for any of the PSF models provided by photutils (e.g., EPSFModel, IntegratedGaussianPRF, FittableImageModel, GriddedPSFModel, etc).

Parameters:
psfmodelFittable2DModel

The model to assume as representative of the PSF.

xnamestr or None, optional

The name of the psfmodel parameter that corresponds to the x-axis center of the PSF. If None, the model will be assumed to be centered at x=0, and a new parameter will be added for the offset.

ynamestr or None, optional

The name of the psfmodel parameter that corresponds to the y-axis center of the PSF. If None, the model will be assumed to be centered at y=0, and a new parameter will be added for the offset.

fluxnamestr or None, optional

The name of the psfmodel parameter that corresponds to the total flux of the star. If None, a scaling factor will be added to the model.

renormalize_psfbool, optional

If True, the model will be integrated from -inf to inf and rescaled so that the total integrates to 1. Note that this renormalization only occurs once, so if the total flux of psfmodel depends on position, this will not be correct.

Returns:
resultFittable2DModel

A new model ready to be passed into BasicPSFPhotometry or its subclasses.