Commit 78b16f64 authored by Guillaume Blanchy's avatar Guillaume Blanchy
Browse files

Fix colored() and add np.median() for MN

No related merge requests found
Showing with 5 additions and 5 deletions
+5 -5
...@@ -1339,7 +1339,7 @@ class OhmPi(object): ...@@ -1339,7 +1339,7 @@ class OhmPi(object):
if len(baddic) > 0: if len(baddic) > 0:
print(baddic) print(baddic)
else: else:
print(colored('Everything OK')) print(colored('Everything OK', 'green'))
else: else:
print('aborted') print('aborted')
...@@ -1373,7 +1373,7 @@ class OhmPi(object): ...@@ -1373,7 +1373,7 @@ class OhmPi(object):
n = m n = m
self._hw.switch_mux([m, n], roles=['M', 'N'], state='on', bypass_check=True) self._hw.switch_mux([m, n], roles=['M', 'N'], state='on', bypass_check=True)
self._hw._vab_pulse(duration=0.2, vab=5) self._hw._vab_pulse(duration=0.2, vab=5)
vmn = self._hw.readings[-2, 4] vmn = np.median(np.abs(self._hw.readings[:, 4]))
self._hw.switch_mux([m, n], roles=['M', 'N'], state='off', bypass_check=True) self._hw.switch_mux([m, n], roles=['M', 'N'], state='off', bypass_check=True)
ok = 'FAILED' ok = 'FAILED'
if vmn <= vmn_threshold: if vmn <= vmn_threshold:
...@@ -1388,7 +1388,7 @@ class OhmPi(object): ...@@ -1388,7 +1388,7 @@ class OhmPi(object):
if len(baddic) > 0: if len(baddic) > 0:
print(baddic) print(baddic)
else: else:
print(colored('Everything OK')) print(colored('Everything OK', 'green'))
else: else:
print('aborted') print('aborted')
...@@ -1438,7 +1438,7 @@ class OhmPi(object): ...@@ -1438,7 +1438,7 @@ class OhmPi(object):
n = b n = b
self._hw.switch_mux([a, b, m, n], roles=['A', 'B', 'M', 'N'], state='on', bypass_check=True) self._hw.switch_mux([a, b, m, n], roles=['A', 'B', 'M', 'N'], state='on', bypass_check=True)
self._hw._vab_pulse(duration=injection_duration, vab=vab) self._hw._vab_pulse(duration=injection_duration, vab=vab)
vmn = self._hw.readings[-2, 4] vmn = np.median(self._hw.readings[:, 4])
# import matplotlib.pyplot as plt # import matplotlib.pyplot as plt
# fig, ax = plt.subplots() # fig, ax = plt.subplots()
# ax.plot(self._hw.readings[:, 0], self._hw.readings[:, 4]) # ax.plot(self._hw.readings[:, 0], self._hw.readings[:, 4])
...@@ -1456,7 +1456,7 @@ class OhmPi(object): ...@@ -1456,7 +1456,7 @@ class OhmPi(object):
if len(baddic) > 0: if len(baddic) > 0:
print(baddic) print(baddic)
else: else:
print(colored('Everything OK')) print(colored('Everything OK', 'green'))
else: else:
print('aborted') print('aborted')
......
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