InitialGuessIterativeNonlinearLSTSQPSF.fit_lstsq

giant.point_spread_functions.psf_meta:

classmethod InitialGuessIterativeNonlinearLSTSQPSF.fit_lstsq(x, y, z)[source]

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

The estimation in this function is performed iteratively. First, a non-iterative fit is performed using the super class’s fit method. This initial fit is then refined using iterative non-linear least squares to remove biases that might have been introduced in the non-iterative fit..

If the fit is unsuccessful due to a rank deficient matrix then update_states() will be called which will likely result in the state parameters being set to NaN.

Parameters:
  • x (Sequence | ndarray) – The x values underlying the surface the PSF is to be fit to

  • y (Sequence | ndarray) – The y values underlying the surface the PSF is to be fit to

  • z (Sequence | ndarray) – The z or “height” values of the surface the PSF is to be fit to

Returns:

The initialized PSF with values according to the fit

Return type:

InitialGuessIterativeNonlinearLSTSQPSF