mirror of https://gitlab.com/pamhyr/pamhyr2
Solver: Mage: read_bin: Put velocity into np table.
parent
d87db5fd48
commit
32e7413aad
|
|
@ -1175,7 +1175,6 @@ class Mage8(Mage):
|
||||||
for k in tmp_table:
|
for k in tmp_table:
|
||||||
table[k] = np.array(tmp_table[k])
|
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...")
|
||||||
|
|
@ -1185,14 +1184,22 @@ class Mage8(Mage):
|
||||||
|
|
||||||
logger.info(f"compute velocity...")
|
logger.info(f"compute velocity...")
|
||||||
|
|
||||||
for r in reachs:
|
velocity_arr = np.zeros((len(ts), len(iprofiles)))
|
||||||
for t in ts_list:
|
for ti, t in enumerate(ts_list):
|
||||||
for i, p in enumerate(r.profiles):
|
j = 0
|
||||||
|
for r in reachs:
|
||||||
|
for pi, p in enumerate(r.profiles):
|
||||||
v = p.geometry.speed(
|
v = p.geometry.speed(
|
||||||
p.get_ts_key(t, "Q"),
|
p.get_ts_key(t, "Q"),
|
||||||
p.get_ts_key(t, "Z")
|
p.get_ts_key(t, "Z")
|
||||||
)
|
)
|
||||||
r.set(i, t, "V", v)
|
r.set(pi, t, "V", v)
|
||||||
|
velocity_arr[ti, j] = v
|
||||||
|
j += 1
|
||||||
|
|
||||||
|
table["V"] = velocity_arr
|
||||||
|
results.set("table", table)
|
||||||
|
|
||||||
logger.info(f"read_bin: ... end with {len(ts)} timestamp read")
|
logger.info(f"read_bin: ... end with {len(ts)} timestamp read")
|
||||||
|
|
||||||
results.bufferize("Z")
|
results.bufferize("Z")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue