Commit 8917ed5a authored by Arnaud WATLET's avatar Arnaud WATLET
Browse files

Fixing Vmn calculation

Showing with 5 additions and 4 deletions
+5 -4
...@@ -290,7 +290,7 @@ class OhmPiHardware: ...@@ -290,7 +290,7 @@ class OhmPiHardware:
mean_vmn = [] mean_vmn = []
mean_iab = [] mean_iab = []
for i in range(n_pulses + 1): for i in range(n_pulses + 1):
mean_vmn.append(polarity[i] * np.mean(self.readings[self.readings[:, 1] == i, 4])) mean_vmn.append(np.mean(self.readings[self.readings[:, 1] == i, 4]))
mean_iab.append(np.mean(self.readings[self.readings[:, 1] == i, 3])) mean_iab.append(np.mean(self.readings[self.readings[:, 1] == i, 3]))
mean_vmn = np.array(mean_vmn) mean_vmn = np.array(mean_vmn)
mean_iab = np.array(mean_iab) mean_iab = np.array(mean_iab)
......
...@@ -463,12 +463,13 @@ class OhmPi(object): ...@@ -463,12 +463,13 @@ 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
Vmn = np.mean(self._hw.readings[x, 2] * (self._hw.readings[x, 4] - self._hw.sp)) Vmn = np.mean(self._hw.readings[x, 2] * (self._hw.readings[x, 4])) # - self._hw.sp))
Vmn_std = 100. * np.std(self._hw.readings[x, 2] * (self._hw.readings[x, 4] - self._hw.sp)) Vmn_std = 100. * np.std(self._hw.readings[x, 2] * (self._hw.readings[x, 4])) # - self._hw.sp))
I = np.mean(self._hw.readings[x, 3]) I = np.mean(self._hw.readings[x, 3])
I_std = 100. * np.std(self._hw.readings[x, 3]) I_std = 100. * np.std(self._hw.readings[x, 3])
R = Vmn / I
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