FitModelThread

class specviz.core.threads.FitModelThread(parent=None)[source] [edit on github]

Bases: PyQt5.QtCore.QThread

Asynchronously fit a model to a layer

Parameters:

parent: QtWidget

The parent widget or None

Attributes

model_layer: Spectrum1DRefLayer The layer to fit to.
fitter_name: An `~astropy.modeling` fitter The fitter to use
mask: numpy.ndarray The mask to apply

Attributes Summary

result
status

Methods Summary

__call__(…) <==> x(…)
fit_model(model_layer, fitter_name[, mask, …]) Fit the model
run() Start thread to fit the model

Attributes Documentation

result
status

Methods Documentation

__call__(...) <==> x(...)[source] [edit on github]
fit_model(model_layer, fitter_name, mask=None, kwargs=None)[source] [edit on github]

Fit the model

Parameters:

model_layer: Spectrum1DRefLayer

The layer to fit to.

fitter_name: An `~astropy.modeling` fitter

The fitter to use

mask: numpy.ndarray

The mask to apply

Returns:

(model_layer, fitter_message): Spectrum1DRefLayer, str

The model_layer.model is updated with the fit paramters. The message is from the fitter itself.

run()[source] [edit on github]

Start thread to fit the model