Commit 5fc6a3bb authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Investigates reading times

Showing with 1 addition and 1 deletion
+1 -1
......@@ -240,7 +240,6 @@ class Rx(RxAbstract):
def voltage(self):
""" Gets the voltage VMN in Volts
"""
print(f'Voltage ads: {self._ads_voltage_address}, {ads.P0}')
u0 = AnalogIn(self._ads_voltage, ads.P0).voltage * 1000.
u2 = AnalogIn(self._ads_voltage, ads.P2).voltage * 1000.
u = np.max([u0,u2]) * (np.heaviside(u0-u2, 1.) * 2 - 1.) # gets the max between u0 & u2 and set the sign
......
......@@ -173,6 +173,7 @@ class OhmPiHardware:
sleep_time = self._start_time + datetime.timedelta(seconds=sample * sampling_rate / 1000) - lap
time.sleep(np.max([0., sleep_time.total_seconds()])) # TODO set readings to nan if sleep time <0 and skip the sample (sample +=1)
self.exec_logger.warning(f'pulse {self._pulse}: elapsed time {(lap-self._start_time).total_seconds()} s') # TODO: Set to debug level
self.exec_logger.warning(f'pulse {self._pulse}: total samples {len(_readings)}') # TODO: Set to debug level
self.readings = np.array(_readings)
self._pulse += 1
......
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