From ff2a12cf381c37c16bb897e7e9dcc198b5fa7eae Mon Sep 17 00:00:00 2001 From: Arnaud Watlet <arnaud.watlet@umons.ac.be> Date: Tue, 28 Nov 2023 08:18:06 +0100 Subject: [PATCH] Adds mux_2024_to_mux_2023_takeouts in utils --- ohmpi/utils.py | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/ohmpi/utils.py b/ohmpi/utils.py index 8458e674..bc85aad6 100644 --- a/ohmpi/utils.py +++ b/ohmpi/utils.py @@ -113,7 +113,27 @@ def parse_log(log): session = np.array(session) return time, process_id, tag, msg, session -def mux_2024_to_mux_2023_takeouts(sequence): +def mux_2024_to_mux_2023_takeouts(mux_boards): + + """Updates cabling for mux v2024 so that takeouts are similar to takeouts from mux v2023. + This is only useful when replacing mux v2023 installations or re-using old test circuits." + + Parameters + ---------- + mux_boards: list of class MUX objects. + + Usage + ---------- + k = OhmPi() + mux_2024_to_mux_2023_takeouts(k._hw.mux_boards) + """ + 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 + + for mux in mux_boards: + new_cabling = mux.cabling.copy() + for k, v in mux.cabling.items(): + print(k, v) + new_cabling[k] = (mapper[v[0]], v[1]) + mux.cabling = new_cabling \ No newline at end of file -- GitLab