Fitting

:mod:` sans.fit.Fitting`

Class Fit contains ScipyFit and ParkFit methods declaration allows to create instance of type ScipyFit or ParkFit to perform either a park fit or a scipy fit.

class sans.fit.Fitting.Fit

Wrap class that allows to select the fitting type.this class can be used as follow :

from sans.fit.Fitting import Fit
fitter= Fit()
fitter.fit_engine('scipy') or fitter.fit_engine('park')
engine = fitter.returnEngine()
engine.set_data(data,id)
engine.set_param( model,model.name, pars)
engine.set_model(model,id)

chisqr1, out1, cov1=engine.fit(pars,qmin,qmax)
__init__()
__module__ = 'sans.fit.Fitting'
fit()

Perform the fit

get_model()

return list of data

get_problem_to_fit()

return the self.selected value of the fit problem of id

Parameters:id – the id of the problem
remove_fit_problem()

remove fitarrange in id

select_problem_for_fit()

select a couple of model and data at the id position in dictionary and set in self.selected value to value

Parameters:value – the value to allow fitting. can only have the value one or zero
set_data()

Store data to fit at the psotion id of the fit engine

Parameters:
  • data – data to fit
  • smearer – smearerobject to smear data
  • qmin – the minimum q range to fit
  • qmax – the minimum q range to fit
set_engine()

Select the type of Fit

Parameters:word – the keyword to select the fit type
Raise :if the user does not enter ‘scipy’ or ‘park’, a valueError is raised
set_model()

store a model model to fit at the position id of the fit engine

Table Of Contents

Previous topic

AbstractFitEngine

Next topic

Loader

This Page