EPSFBuildResult#
- class photutils.psf.EPSFBuildResult(epsf: ImagePSF, fitted_stars: EPSFStars, iterations: int, converged: bool, final_center_accuracy: float, n_excluded_stars: int, excluded_star_indices: list)[source]#
Bases:
objectContainer for ePSF building results.
This class provides structured access to the results of the ePSF building process, including convergence information and diagnostic data that can help users understand and validate the building process.
- Attributes:
- epsf
ImagePSFobject The final constructed ePSF model.
- fitted_stars
EPSFStarsobject The input stars with updated centers and fluxes derived from fitting the final ePSF.
- iterationsint
The number of iterations performed during the building process. This will be <= maxiters specified in EPSFBuilder.
- convergedbool
Whether the building process converged based on the center accuracy criterion.
Trueif star centers moved less than the specified accuracy between the final iterations.- final_center_accuracyfloat
The maximum center displacement in the final iteration, in pixels. This indicates how much the star centers changed in the last iteration and can be used to assess convergence quality.
- n_excluded_starsint
The number of individual stars (including those from linked stars) that were excluded from fitting due to repeated fit failures.
- excluded_star_indiceslist
Indices of stars that were excluded from fitting during the building process. These correspond to positions in the flattened star list (stars.all_stars).
- epsf
Notes
This result object maintains backward compatibility by implementing tuple unpacking, so existing code like:
epsf, stars = epsf_builder(stars)
will continue to work unchanged. The additional information is available as attributes for users who want more detailed results.
Examples
>>> from photutils.psf import EPSFBuilder >>> epsf_builder = EPSFBuilder(oversampling=4) >>> result = epsf_builder(stars) >>> print(result.iterations) >>> print(result.final_center_accuracy) >>> print(result.n_excluded_stars)