EPSFModel¶

class
photutils.psf.
EPSFModel
(data, flux=1.0, x_0=0.0, y_0=0.0, normalize=True, normalization_correction=1.0, origin=None, oversampling=1, fill_value=0.0, norm_radius=5.5, shift_val=0.5, **kwargs)[source]¶ Bases:
photutils.psf.FittableImageModel
A class that models an effective PSF (ePSF).
The EPSFModel is normalized such that the sum of the PSF over the (undersampled) pixels within the the input
norm_radius
is 1.0. This means that when the EPSF is fit to stars, the resulting flux corresponds to aperture photometry within a circular aperture of radiusnorm_radius
.While this class is a subclass of
FittableImageModel
, it is very similar. The primary differences/motivation are a few additional parameters necessary specifically for ePSFs. Parameters
 oversamplingint or tuple of two int, optional
The oversampling factor(s) of the model in the
x
andy
directions. Ifoversampling
is a scalar it will be treated as being the same in both x and y; otherwise a tuple of two floats will be treated as(x_oversamp, y_oversamp)
. norm_radiusfloat, optional
The radius inside which the ePSF is normalized by the sum over undersampled integer pixel values inside a circular aperture.
 shift_valfloat, optional
The fractional undersampled pixel amount (equivalent to an integer oversampled pixel value) at which to evaluate the asymmetric ePSF centroid corrections.
Attributes Summary
A tuple of
x
andy
coordinates of the origin of the coordinate system in terms of pixels of model’s image.Methods Summary
compute_interpolator
(**kwargs)Compute/define the interpolating spline.
evaluate
(x, y, flux, x_0, y_0)Evaluate the model on some input variables and provided model parameters.
Overloaded dummy function that also returns self._data, as the normalization occurs within _compute_normalization in EPSFModel, and as such self._data will sum, accounting for under/oversampled pixels, to 1/self._normalization_correction.
Attributes Documentation

origin
¶ A tuple of
x
andy
coordinates of the origin of the coordinate system in terms of pixels of model’s image.When setting the coordinate system origin, a tuple of two
int
orfloat
may be used. If origin is set toNone
, the origin of the coordinate system will be set to the middle of the data array ((npix1)/2.0
).Warning
Modifying
origin
will not adjust (modify) model’s parametersx_0
andy_0
.
Methods Documentation

compute_interpolator
(**kwargs)[source]¶ Compute/define the interpolating spline.
This function can be overriden in a subclass to define custom interpolators.
 Parameters
 kwargsdict, optional
Additional optional keyword arguments:
 degreeint, tuple, optional
Degree of the interpolating spline. A tuple can be used to provide different degrees for the X and Yaxes. Default value is degree=3.
 sfloat, optional
Nonnegative smoothing factor. Default value s=0 corresponds to interpolation. See
RectBivariateSpline
for more details.
Notes
When subclassing
FittableImageModel
for the purpose of overridingcompute_interpolator()
, theevaluate()
may need to overriden as well depending on the behavior of the new interpolator. In addition, for improved future compatibility, make sure that the overriding method stores keyword argumentskwargs
by calling_store_interpolator_kwargs
method.Use caution when modifying interpolator’s degree or smoothness in a computationally intensive part of the code as it may decrease code performance due to the need to recompute interpolator.