Commit 0f7ac258 authored by Arnaud WATLET's avatar Arnaud WATLET
Browse files

Adds Vmn and I readings in ohmpi.py

Showing with 8 additions and 4 deletions
+8 -4
......@@ -465,6 +465,10 @@ class OhmPi(object):
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_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_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 = 100. * np.std(self._hw.readings[x, 3])
d = {
"time": datetime.now().isoformat(),
"A": quad[0],
......@@ -472,8 +476,8 @@ class OhmPi(object):
"M": quad[2],
"N": quad[3],
"inj time [ms]": injection_duration, # NOTE: check this
# "Vmn [mV]": sum_vmn / (2 * nb_stack),
# "I [mA]": sum_i / (2 * nb_stack),
"Vmn [mV]": Vmn,
"I [mA]": I,
"R [ohm]": R,
"R_std [%]": R_std,
"Ps [mV]": self._hw.sp,
......@@ -483,10 +487,10 @@ class OhmPi(object):
"Nb samples [-]": len(self._hw.readings), # TODO: use only samples after a delay in each pulse
"fulldata": self._hw.readings[:, [0, -2, -1]],
# "I_stack [mA]": i_stack_mean,
# "I_std [mA]": i_std,
"I_std [mA]": I_std,
# "I_per_stack [mA]": np.array([np.mean(i_stack[i*2:i*2+2]) for i in range(nb_stack)]),
# "Vmn_stack [mV]": vmn_stack_mean,
# "Vmn_std [mV]": vmn_std,
"Vmn_std [mV]": Vmn_std,
# "Vmn_per_stack [mV]": np.array([np.diff(np.mean(vmn_stack[i*2:i*2+2], axis=1))[0] / 2 for i in range(nb_stack)]),
# "R_stack [ohm]": r_stack_mean,
# "R_std [ohm]": r_stack_std,
......
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