Add new model for customized fit function
This commit is contained in:
parent
85fdcac992
commit
f5e0c46bba
@ -224,6 +224,19 @@ class TwoGaussian2dModel(Model):
|
|||||||
return pars
|
return pars
|
||||||
|
|
||||||
|
|
||||||
|
class NewFitModel(Model):
|
||||||
|
|
||||||
|
def __init__(self, func, independent_vars=['x'], prefix='', nan_policy='raise',
|
||||||
|
**kwargs):
|
||||||
|
kwargs.update({'prefix': prefix, 'nan_policy': nan_policy,
|
||||||
|
'independent_vars': independent_vars})
|
||||||
|
|
||||||
|
super().__init__(func, **kwargs)
|
||||||
|
|
||||||
|
def guess(self, *args, **kwargs):
|
||||||
|
return self.make_params()
|
||||||
|
|
||||||
|
|
||||||
lmfit_models = {'Constant': ConstantModel,
|
lmfit_models = {'Constant': ConstantModel,
|
||||||
'Complex Constant': ComplexConstantModel,
|
'Complex Constant': ComplexConstantModel,
|
||||||
'Linear': LinearModel,
|
'Linear': LinearModel,
|
||||||
|
2515
Example.ipynb
2515
Example.ipynb
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user