From: W. Trevor King Date: Thu, 2 Aug 2012 16:00:26 +0000 (-0400) Subject: Work around x_contact == x[0] in limited_linear_param_guess. X-Git-Tag: 0.9~14 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=49c5e83313e7c05841419dd429a56ce614da810a;p=calibcant.git Work around x_contact == x[0] in limited_linear_param_guess. --- diff --git a/calibcant/bump_analyze.py b/calibcant/bump_analyze.py index 7601cad..d5e0f9c 100644 --- a/calibcant/bump_analyze.py +++ b/calibcant/bump_analyze.py @@ -234,6 +234,8 @@ def limited_linear_param_guess(x, y): x_high = float(x[i_high]) if x_high == x_contact: # things must be pretty flat x_contact = (x_contact + x[0]) / 2 + if x_high == x_contact: + x_high = x[1] slope = (y_high - y_contact) / (x_high - x_contact) return (x_contact, y_contact, slope)