This commit is contained in:
david rice
2026-04-09 09:17:42 +01:00
parent 2385fc6878
commit be7658b54d
5 changed files with 51 additions and 27 deletions

View File

@@ -127,7 +127,11 @@ def _read_csv(path: Path) -> tuple[np.ndarray, np.ndarray]:
volts.append(float(row[1]))
except ValueError:
pass # skip any header row
return np.array(times, dtype=np.float64), np.array(volts, dtype=np.float64)
t = np.array(times, dtype=np.float64)
v = np.array(volts, dtype=np.float64)
if len(t) < 2:
raise ValueError(f"Insufficient samples in {path.name} ({len(t)} rows parsed)")
return t, v
def _zero_crossings(times: np.ndarray, volts: np.ndarray) -> np.ndarray: