diff --git a/frappy_psi/picontrol.py b/frappy_psi/picontrol.py index 73e84c16..ee50bf4c 100644 --- a/frappy_psi/picontrol.py +++ b/frappy_psi/picontrol.py @@ -160,7 +160,7 @@ class PImixin(HasOutputModule, Writable): output = omax if overflow: # fit a straight line - (slope, beg), cov = np.polyfit(range(self._overflow), self._overflow, 1, cov=True) + (slope, beg), cov = np.polyfit(range(len(self._overflow)), self._overflow, 1, cov=True) sign = np.copysign(1, overflow) end = beg + slope * len(self._overflow) # reduce the absolute value of overflow by the minimum distance of the fitted