From 1b1f7f0c2574b1d38ebc16ad5037069f0c9fc52c 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