Commit ac42fc7c authored by Arnaud WATLET's avatar Arnaud WATLET
Browse files

updates select samples to avoid pulse not recorded due to Rpi lag

Showing with 3 additions and 3 deletions
+3 -3
......@@ -296,9 +296,9 @@ class OhmPiHardware:
x = []
for pulse in range(int(max(self.readings[:, 1]))):
v = np.where((self.readings[:, 1] == pulse))[0]
t_start_pulse = min(self.readings[v, 0])
x.append(np.where((self.readings[:, 0] >= t_start_pulse + delay) & (self.readings[:, 2] != 0) & (
if len(v) > 0: # to avoid pulse not recorded due to Raspberry Pi lag...
t_start_pulse = min(self.readings[v, 0])
x.append(np.where((self.readings[:, 0] >= t_start_pulse + delay) & (self.readings[:, 2] != 0) & (
self.readings[:, 1] == pulse))[0])
x = np.concatenate(np.array(x, dtype='object'))
return x
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment