BasicGaussianFitter

class glue.core.fitters.BasicGaussianFitter(**params)[source]

Bases: glue.core.fitters.BaseFitter1D

Fallback Gaussian fitter, for astropy < 0.3.

If astropy.modeling is installed, this class is replaced by SimpleAstropyGaussianFitter

Attributes Summary

label

A short label for the fit, used by the GUI

Methods Summary

eval(x, amplitude, mean, stddev)

fit(x, y, dy, constraints)

Fit the model to data.

fit_deriv(x, amplitude, mean, stddev)

Gaussian1D model function derivatives.

predict(fit_result, x)

Evaluate the model at a set of locations.

summarize(fit_result, x, y[, dy])

Return a textual summary of the fit.

Attributes Documentation

label = 'Gaussian'

A short label for the fit, used by the GUI

Methods Documentation

static eval(x, amplitude, mean, stddev)[source]
fit(x, y, dy, constraints)[source]

Fit the model to data.

This must be overriden by a subclass.

Parameters
  • x (numpy.ndarray) – The x values of the data

  • y (numpy.ndarray) – The y values of the data

  • dy (numpy.ndarray) – 1 sigma uncertainties on each datum (optional)

  • constraints – The current value of the constraints property

  • options – kwargs for model hyperparameters.

Returns

An object representing the fit result.

static fit_deriv(x, amplitude, mean, stddev)[source]

Gaussian1D model function derivatives.

predict(fit_result, x)[source]

Evaluate the model at a set of locations.

This must be overridden in a subclass.

Parameters
  • fit_result – The result from the fit method

  • x (numpy.ndarray) – Locations to evaluate model at

Returns

model(x)

Return type

numpy.ndarray

summarize(fit_result, x, y, dy=None)[source]

Return a textual summary of the fit.

Parameters
  • fit_result – The return value from fit()

  • x – The x values passed to fit()

Returns

A description of the fit result

Return type

str