From 307ec845097c8121d3debb1e0f3714a6b9ef2588 Mon Sep 17 00:00:00 2001 From: devicerandom Date: Tue, 30 Sep 2008 16:03:37 +0000 Subject: [PATCH] (generalvclamp.py) fixed crash in autopeak due to too few points available for a fit --- generalvclamp.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/generalvclamp.py b/generalvclamp.py index fb0f793..04271cc 100644 --- a/generalvclamp.py +++ b/generalvclamp.py @@ -500,6 +500,11 @@ class generalvclampCommands: other_fit_point.find_graph_coords(displayed_plot.vectors[1][0], displayed_plot.vectors[1][1]) #do the fit points=[contact_point, peak_point, other_fit_point] + + #Check if we have enough points for a fit. If not, wlc_fit could crash + if abs(peak_point.index-other_fit_point.index) < 2: + continue + params, yfit, xfit = self.wlc_fit(points, displayed_plot.vectors[1][0], displayed_plot.vectors[1][1],pl_value,T) #save wlc values (nm) c_lengths.append(params[0]*(1.0e+9)) -- 2.26.2