Closedown
This commit is contained in:
@@ -22,8 +22,8 @@ def fit(ydata, xdata = None, draw_plot = True):
|
||||
if gaussians[0] is None:
|
||||
if draw_plot and (p is not None):
|
||||
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)
|
||||
print "Fitting error"
|
||||
return (None, None, None)
|
||||
|
||||
(norm, mean, sigma) = gaussians[0]
|
||||
if draw_plot:
|
||||
@@ -51,5 +51,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) + " - returning maximum: " + str(max_x)
|
||||
return (None, max_x, None)
|
||||
print "Invalid gaussian fit: " + str(mean)
|
||||
return (None, None, None)
|
||||
|
||||
@@ -39,9 +39,9 @@ def rock(axis = th1, tt = 0.2, seti0 = False, dx = None, noref = False):
|
||||
mono_beam_ref.write(br)
|
||||
print 'rock_success new mono beam at ' + str(br) + ' at' + str(e) + ' keV'
|
||||
return True
|
||||
else:
|
||||
print 'fit failed - centering on maximum'
|
||||
else:
|
||||
max_x= xdata[ydata.index(max(ydata))]
|
||||
print 'fit failed - centering on maximum: ' + str(max_x)
|
||||
axis.move(max_x)
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user