PointSpreadFunction.fit

giant.point_spread_functions.psf_meta:

abstract classmethod PointSpreadFunction.fit(x, y, z)[source]

This function fits the defined PSF to the input data and returns an initialize version of the class based on the fit.

The fit assumes that z = f(x, y) where f is the PSF (and thus z is the “height” of the PSF).

If the fit is unsuccessful then this should set the attributes of the PSF to NaN to indicate to the rest of GIANT that the fit failed.

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:

An instance of the PSF that best fits the provided data

Return type:

PointSpreadFunction