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, **kwargs)[source]¶
Bases:
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 array_like (int)
The integer oversampling factor(s) of the ePSF relative to the input
stars
along each axis. Ifoversampling
is a scalar then it will be used for both axes. Ifoversampling
has two elements, they must be in(y, x)
order.- norm_radiusfloat, optional
The radius inside which the ePSF is normalized by the sum over undersampled integer pixel values inside a circular aperture.
Attributes Summary
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.
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.
Attributes Documentation
- normalized_data¶
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.
- 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 ((npix-1)/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 overridden 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 Y-axes. Default value is degree=3.
- sfloat, optional
Non-negative 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 overridden 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.