Commit d4a36a00 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Changes the way sp is taken into account in R computation within ohmpi

Showing with 3 additions and 3 deletions
+3 -3
...@@ -220,7 +220,7 @@ class OhmPiHardware: ...@@ -220,7 +220,7 @@ class OhmPiHardware:
return np.nan return np.nan
@property @property
def sp(self): # TODO: use a time window within pulses def sp(self): # TODO: allow for different strategies for computing sp (i.e. when sp drift is not linear)
if self.readings.shape == (0,) or len(self.readings[self.readings[:, 2] == 1, :]) < 1 or \ if self.readings.shape == (0,) or len(self.readings[self.readings[:, 2] == 1, :]) < 1 or \
len(self.readings[self.readings[:, 2] == -1, :]) < 1: len(self.readings[self.readings[:, 2] == -1, :]) < 1:
self.exec_logger.warning('Unable to compute sp: readings should at least contain one positive and one ' self.exec_logger.warning('Unable to compute sp: readings should at least contain one positive and one '
......
...@@ -460,8 +460,8 @@ class OhmPi(object): ...@@ -460,8 +460,8 @@ class OhmPi(object):
delay = 0. delay = 0.
x = np.where((self._hw.readings[:, 0] >= delay) & (self._hw.readings[:, 2] != 0)) x = np.where((self._hw.readings[:, 0] >= delay) & (self._hw.readings[:, 2] != 0))
print(f'length of series: {len(x)}') print(f'length of series: {len(x)}')
R = np.mean((self._hw.readings[x, 2] * self._hw.readings[x, 4] - self._hw.sp) / self._hw.readings[x, 3]) R = np.mean((self._hw.readings[x, 2] * (self._hw.readings[x, 4] - self._hw.sp)) / self._hw.readings[x, 3])
R_std = 100. * np.std((self._hw.readings[x, 2] * self._hw.readings[x, 4] - self._hw.sp) / self._hw.readings[x, 3]) / R R_std = 100. * np.std((self._hw.readings[x, 2] * (self._hw.readings[x, 4] - self._hw.sp)) / self._hw.readings[x, 3]) / R
d = { d = {
"time": datetime.now().isoformat(), "time": datetime.now().isoformat(),
"A": quad[0], "A": quad[0],
......
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