mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Solver: Mage: Add data np table to results.
This commit is contained in:
1 parent
4d014d5a1d
commit
388368adad
1 file changed
+14
-1
+14
-1
@@ -1124,6 +1124,7 @@ class Mage8(Mage):
|
|||||||
# Data
|
# Data
|
||||||
newline()
|
newline()
|
||||||
|
|
||||||
|
@timer
|
||||||
def ip_to_r(i): return iprofiles[
|
def ip_to_r(i): return iprofiles[
|
||||||
next(
|
next(
|
||||||
filter(
|
filter(
|
||||||
@@ -1132,6 +1133,7 @@ class Mage8(Mage):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
@timer
|
||||||
def ip_to_ri(r, i): return i - reach_offset[r]
|
def ip_to_ri(r, i): return i - reach_offset[r]
|
||||||
|
|
||||||
# check results and geometry consistency
|
# check results and geometry consistency
|
||||||
@@ -1144,6 +1146,8 @@ class Mage8(Mage):
|
|||||||
return
|
return
|
||||||
|
|
||||||
ts = set()
|
ts = set()
|
||||||
|
tmp_table = {}
|
||||||
|
|
||||||
end = False
|
end = False
|
||||||
while not end:
|
while not end:
|
||||||
n = read_int(1)[0]
|
n = read_int(1)[0]
|
||||||
@@ -1152,7 +1156,10 @@ class Mage8(Mage):
|
|||||||
f, dtype=np.byte, count=1)).decode()
|
f, dtype=np.byte, count=1)).decode()
|
||||||
data = read_float(n)
|
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)
|
ts.add(timestamp)
|
||||||
|
|
||||||
if key in ["Z", "Q"]:
|
if key in ["Z", "Q"]:
|
||||||
@@ -1176,6 +1183,11 @@ class Mage8(Mage):
|
|||||||
endline()
|
endline()
|
||||||
end = newline().size <= 0
|
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)
|
results.set("timestamps", ts)
|
||||||
ts_list = sorted(ts)
|
ts_list = sorted(ts)
|
||||||
logger.info(f"compute tab...")
|
logger.info(f"compute tab...")
|
||||||
@@ -1322,6 +1334,7 @@ class Mage8(Mage):
|
|||||||
newline()
|
newline()
|
||||||
npts = read_int(n)
|
npts = read_int(n)
|
||||||
endline()
|
endline()
|
||||||
|
|
||||||
sum_npts = sum(npts)
|
sum_npts = sum(npts)
|
||||||
logger.debug(f"read_gra: Number of points: {sum_npts}")
|
logger.debug(f"read_gra: Number of points: {sum_npts}")
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user