diff --git a/script/fit.py b/script/fit.py index 9e2fad8..8748bfa 100644 --- a/script/fit.py +++ b/script/fit.py @@ -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) diff --git a/script/rock.py b/script/rock.py index 2913590..a1cab84 100644 --- a/script/rock.py +++ b/script/rock.py @@ -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 \ No newline at end of file