* Bug fixes and documentation update.

This commit is contained in:
Wirawan Purwanto
2015-05-28 17:20:34 -04:00
parent 56b5d9ed05
commit 78c638a371
4 changed files with 12 additions and 5 deletions

View File

@@ -11,10 +11,13 @@
wpylib.math.fitting.funcs_pec module
A library of simple f(x) functions for PEC fitting
For use with OO-style x-y curve fitting interface.
For use with the OO-style x-y curve fitting interface
(fit_func_base).
"""
import numpy
from wpylib.math.fitting import fit_func_base
from wpylib.math.fitting.funcs_simple import fit_harm
class harm_fit_func(fit_func_base):
@@ -99,7 +102,7 @@ class morse2_fit_func(fit_func_base):
imin = numpy.argmin(y)
harm_params = fit_harm(x[0], y)
if self.debug >= 10:
print "Initial guess by fit_harm gives: ", harm_params
print("Initial guess by fit_harm gives: %s" % (harm_params,))
self.guess_params = (y[imin], harm_params[0][1], x[0][imin], 0.01 * harm_params[0][1])
return self.guess_params
def Guess_xy_old(self, x, y):
@@ -134,7 +137,7 @@ class ext3Bmorse2_fit_func(fit_func_base):
imin = numpy.argmin(y)
harm_params = fit_harm(x[0], y)
if self.debug >= 10:
print "Initial guess by fit_harm gives: ", harm_params
print("Initial guess by fit_harm gives: %s " % (harm_params,))
self.guess_params = (y[imin], harm_params[0][1], x[0][imin], 0.01 * harm_params[0][1], 0)
return self.guess_params