IterativeNonlinearLSTSQwBackground.fit_bg

giant.point_spread_functions.psf_meta:

classmethod IterativeNonlinearLSTSQwBackground.fit_bg(x, y, z)[source]

This method tries to fit the background using linear least squares without worrying about any PSF included.

This is useful if you need to subtract off a rough estimate of the background before attempting to fit the PSF for an initial guess. The results of the fit are stored in the bg_b_coef, bg_c_coef, and bg_d_coef.

Parameters:
  • x (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]) – The x values underlying the data the background is to be fit to

  • y (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]) – The y values underlying the data the background is to be fit to

  • z (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]) – The z or “height” values for the background

Returns:

The initialized BG PSF with values according to the fit for the background only

Return type:

Self