frappy_psi.picontrol: fix error in overflow line fit

This commit is contained in:
DIL5
2026-08-11 15:47:15 +02:00
parent 102358b933
commit cfdb637f5d
+1 -1
View File
@@ -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