Closedown

This commit is contained in:
2016-04-20 14:18:26 +02:00
parent 3d365bcf9e
commit 5cb778071e

View File

@@ -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)