From 405a96fdb29d9e5f844ed4dc8f8cc70762542561 Mon Sep 17 00:00:00 2001
From: awatlet <arnaud.watlet@umons.ac.be>
Date: Fri, 10 Nov 2023 14:41:41 +0100
Subject: [PATCH] Fixes issue in rs_check

---
 ohmpi/ohmpi.py | 6 +++---
 ohmpi/utils.py | 8 ++++++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/ohmpi/ohmpi.py b/ohmpi/ohmpi.py
index de3c520a..ed01e23a 100644
--- a/ohmpi/ohmpi.py
+++ b/ohmpi/ohmpi.py
@@ -790,7 +790,7 @@ class OhmPi(object):
             self._hw.pwr_state = 'on'
             switch_power_off = True
 
-        self._hw.tx.pwr.voltage = float(tx_volt)
+        # self._hw.tx.pwr.voltage = float(tx_volt)
 
         # create custom sequence where MN == AB
         # we only check the electrodes which are in the sequence (not all might be connected)
@@ -821,7 +821,7 @@ class OhmPi(object):
         for i in range(0, quads.shape[0]):
             quad = quads[i, :]  # quadrupole
             self._hw.switch_mux(electrodes=list(quads[i, :2]), roles=['A', 'B'], state='on')
-            self._hw._vab_pulse(duration=0.2)
+            self._hw._vab_pulse(duration=0.2, vab=tx_volt)
             current = self._hw.readings[-1, 3]
             voltage = self._hw.tx.pwr.voltage * 1000
             time.sleep(0.2)
@@ -871,7 +871,7 @@ class OhmPi(object):
             self.switch_mux_off(quad)
 
         self.status = 'idle'
-        
+
         # if power was off before measurement, let's turn if off
         if switch_power_off:
             self._hw.pwr_state = 'off'
diff --git a/ohmpi/utils.py b/ohmpi/utils.py
index 142d4fb4..7e4287be 100644
--- a/ohmpi/utils.py
+++ b/ohmpi/utils.py
@@ -1,8 +1,7 @@
 import io
 import os
 import shutil
-import collections.abc
-import numpy as np
+git import numpy as np
 from numbers import Number
 
 
@@ -112,3 +111,8 @@ def parse_log(log):
     msg = np.array(msg)
     session = np.array(session)
     return time, process_id, tag, msg, session
+
+def mux_2024_to_mux_2023_takeouts(sequence):
+    mapper = {1: 16, 2: 1, 3: 15, 4: 2, 5: 14, 6: 3, 7: 13, 8: 4, 9: 12, 10: 5, 11: 11,
+              12: 6, 13: 10, 14: 7, 15: 9, 16: 8}
+    remapped_sequence = mapper[sequence]
\ No newline at end of file
-- 
GitLab