From 388368adadffc2dde6a3bbd8e409fca75114006d Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby Date: Thu, 18 Jun 2026 14:29:50 +0200 Subject: [PATCH] Solver: Mage: Add data np table to results. --- src/Solver/Mage.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Solver/Mage.py b/src/Solver/Mage.py index 614a3d05..74f897da 100644 --- a/src/Solver/Mage.py +++ b/src/Solver/Mage.py @@ -1124,6 +1124,7 @@ class Mage8(Mage): # Data newline() + @timer def ip_to_r(i): return iprofiles[ next( filter( @@ -1132,6 +1133,7 @@ class Mage8(Mage): ) ) ] + @timer def ip_to_ri(r, i): return i - reach_offset[r] # check results and geometry consistency @@ -1144,6 +1146,8 @@ class Mage8(Mage): return ts = set() + tmp_table = {} + end = False while not end: n = read_int(1)[0] @@ -1152,7 +1156,10 @@ class Mage8(Mage): f, dtype=np.byte, count=1)).decode() data = read_float(n) - # logger.debug(f"read_bin: timestamp = {timestamp} sec") + if key not in tmp_table: + tmp_table[key] = [] + + tmp_table[key].append(data) ts.add(timestamp) if key in ["Z", "Q"]: @@ -1176,6 +1183,11 @@ class Mage8(Mage): endline() end = newline().size <= 0 + table = {} + for k in tmp_table: + table[k] = np.array(tmp_table[k]) + + results.set("table", table) results.set("timestamps", ts) ts_list = sorted(ts) logger.info(f"compute tab...") @@ -1322,6 +1334,7 @@ class Mage8(Mage): newline() npts = read_int(n) endline() + sum_npts = sum(npts) logger.debug(f"read_gra: Number of points: {sum_npts}")