Closedown
This commit is contained in:
@@ -15,6 +15,12 @@ def fit(ydata, xdata = None, draw_plot = True):
|
||||
print " y:" + str(max_y)
|
||||
|
||||
gaussians = fit_gaussians(ydata, xdata, [index_max,])
|
||||
if gaussians[0] is None:
|
||||
if draw_plot:
|
||||
p.addMarker(max_x, None, "Max="+str(round(max_x,4)), Color.GRAY)
|
||||
print "Fitting error - returning maximum: " + str(max_x)
|
||||
return (None, max_x, None)
|
||||
|
||||
(norm, mean, sigma) = gaussians[0]
|
||||
if draw_plot:
|
||||
plots = plot([ydata],["data"],[xdata], title="Fit" )
|
||||
@@ -43,5 +49,5 @@ def fit(ydata, xdata = None, draw_plot = True):
|
||||
else:
|
||||
if draw_plot:
|
||||
p.addMarker(max_x, None, "Max="+str(round(max_x,4)), Color.GRAY)
|
||||
print "Invalid gaussian fit: " + str(mean)
|
||||
return (None, None, None)
|
||||
print "Invalid gaussian fit: " + str(mean) " - returning maximum: " + str(max_x)
|
||||
return (None, max_x, None)
|
||||
|
||||
Reference in New Issue
Block a user