Closedown

This commit is contained in:
2016-04-20 14:48:39 +02:00
parent 794cba78b2
commit 0d6e09f6a5
2 changed files with 6 additions and 6 deletions

View File

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

View File

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