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

chisqr1, out1, cov1=engine.fit(pars,qmin,qmax)
fit(q=None, handler=None, curr_thread=None, ftol=1.49012e-008)

Perform the fit

get_model(id)

return list of data

get_problem_to_fit(id)

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

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

remove fitarrange in id

select_problem_for_fit(id, value)

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(data, id, smearer=None, qmin=None, qmax=None)

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(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, id, pars=[], constraints=[])

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

Table Of Contents

Previous topic

AbstractFitEngine

Next topic

ParkFitting

This Page