fit_background

petrofit.modeling.fit_background(image, model=<Planar2D(slope_x=1., slope_y=1., intercept=0.)>, sigma=3.0, fitter=<class 'astropy.modeling.fitting.LinearLSQFitter'>, calc_uncertainties=False)[source]

Fit sigma clipped background image using a user provided model.

Parameters:
imagearray

2D array to fit.

modelFittableModel

AstroPy model to sample from. Planar2D is used by default.

sigmafloat or None

The sigma value used to determine noise pixels. Once the pixels above this value are masked, the model provided is fit to determine the background.

fitterAstropy Fitter Class

Astropy fitter class (TRFLSQFitter, LevMarLSQFitter, or LinearLSQFitter)

calc_uncertaintiesbool

If the covarience matrix should be computed and set in the fit_info. Default: False

Returns:
fitted_model, fitter
  • fitted_modelFittableModel

    A copy of the input model with parameters set by the fitter.

  • fitterLevMarLSQFitter

    Fitter used to estimate and set model parameters.