diff --git a/ohmpi/hardware_system.py b/ohmpi/hardware_system.py index 6c38b4a668ff66b6f297e48fa12cf6a7435a945d..e6ebd5d10a19aa396fb9400c171de4bdf3e87f0e 100644 --- a/ohmpi/hardware_system.py +++ b/ohmpi/hardware_system.py @@ -377,7 +377,7 @@ class OhmPiHardware: fig, ax = plt.subplots(nrows=5, sharex=True) ax[0].plot(self.readings[:, 0], self.readings[:, 3], '-r', marker='.', label='iab') ax[0].set_ylabel('Iab [mA]') - ax[1].plot(self.readings[:, 0], self.readings[:, 2] * (self.readings[:, 4] - self.sp) , '-b', marker='.', label='vmn') + ax[1].plot(self.readings[:, 0], self.readings[:, 4] - self.sp , '-b', marker='.', label='vmn') ax[1].set_ylabel('Vmn [mV]') ax[2].plot(self.readings[:, 0], self.readings[:, 2], '-g', marker='.', label='polarity') ax[2].set_ylabel('polarity [-]') diff --git a/ohmpi/ohmpi.py b/ohmpi/ohmpi.py index e9c49cc7f95aba3fd4141835e888f56b0ca8393d..682b9a2338ffa2f5dc7d7f3d2af1f71f0900bce9 100644 --- a/ohmpi/ohmpi.py +++ b/ohmpi/ohmpi.py @@ -465,12 +465,12 @@ class OhmPi(object): x = np.where((self._hw.readings[:, 0] >= delay) & (self._hw.readings[:, 2] != 0)) 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]) - 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)) I = np.mean(self._hw.readings[x, 3]) I_std = 100. * np.std(self._hw.readings[x, 3]) R = Vmn / I - 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, 4] - self._hw.sp) / self._hw.readings[x, 3]) / R d = { "time": datetime.now().isoformat(),