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(engine='scipy')

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,Uid)
engine.set_param( model,model.name, pars)
engine.set_model(model,Uid)

chisqr1, out1, cov1=engine.fit(pars,qmin,qmax)
fit(q=None, handler=None, curr_thread=None)
Perform the fit
get_model(Uid)
return list of data
get_problem_to_fit(Uid)

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

Parameters:
  • Uid – the Uid of the problem
remove_Fit_Problem(Uid)
remove fitarrange in Uid
select_problem_for_fit(Uid, value)

select a couple of model and data at the Uid 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(data, Uid, smearer=None, qmin=None, qmax=None)

Store data to fit at the psotion Uid 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(word)

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(model, Uid, pars=[], constraints=[])
store a model model to fit at the position Uid of the fit engine

Table Of Contents

Previous topic

AbstractFitEngine

Next topic

ParkFitting

This Page