mirror of https://gitlab.com/pamhyr/pamhyr2
Solver: Mage: Add data np table to results.
parent
4d014d5a1d
commit
388368adad
|
|
@ -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}")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue