From: devicerandom Date: Tue, 30 Sep 2008 16:03:37 +0000 (+0000) Subject: (generalvclamp.py) fixed crash in autopeak due to too few points available for a fit X-Git-Tag: 0.9.0~70 X-Git-Url: http://git.tremily.us/?p=hooke.git;a=commitdiff_plain;h=307ec845097c8121d3debb1e0f3714a6b9ef2588 (generalvclamp.py) fixed crash in autopeak due to too few points available for a fit --- 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))