InitialGuessIterativeNonlinearLSTSQPSF

In addition to the methods and attributes from PointSpreadFunction and IterativeNonlinearLSTSQPSF, InitialGuessIterativeNonlinearLSTSQPSF implements the following

class giant.point_spread_functions.psf_meta.InitialGuessIterativeNonlinearLSTSQPSF[source]

Bases: IterativeNonlinearLSTSQPSF

This class provides a fit class method which generates the initial guess from a subclass and then converges to a better solution using iterative Nonlinear LSTSQ.

This class is designed to work where you have a non-iterative but biased class for estimating the defined PSF (as is done with Gaussian PSFs by using a logarithmic transformation). If that is the case, and the unbiased estimator class uses the same attributes and the biased estimator class, then you can use this as is to add the ability to get the biased estimate and then correct it. Otherwise you will need to do things yourself and shouldn’t bother with this class.

To use this class, override the fit() method, and then call super().fit_lstsq(x, y, z)

This also adds 2 instance attributes _residuals and _covariance which store the covariance and residuals of the fit if requested.

_covariance: Sequence | ndarray | None

The covariance of the fit as a nxn array (for n state elements) or None, depending on if save_residuals is True.

_residuals: Sequence | ndarray | None

The residuals of the fit as a length m array (for m observations) or None, depending on if save_residuals is True.

Summary of Added/Modified Methods

fit_lstsq

This fits a PSF to a surface using iterative non-linear least squares estimation.