mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
add zfd in results
This commit is contained in:
1 parent
242df7f648
commit
5b497d61f0
5 files changed
+113
-75
No files matched your search
@@ -19,6 +19,7 @@
|
||||
import os
|
||||
import logging
|
||||
import numpy as np
|
||||
from functools import reduce
|
||||
|
||||
from itertools import chain
|
||||
from tools import timer, trace, logger_exception
|
||||
@@ -1366,6 +1367,40 @@ class Mage8(Mage):
|
||||
)
|
||||
end = newline().size <= 0
|
||||
|
||||
ts_list = sorted(ts)
|
||||
|
||||
logger.info(f"compute river bed elevation...")
|
||||
|
||||
for r in reachs:
|
||||
z_min = reach.geometry.get_z_min()
|
||||
sls = list(map(
|
||||
lambda p: p.get_ts_key(ts_list[0], "sl")[0],
|
||||
r.profiles
|
||||
))
|
||||
z_br = list(map(
|
||||
lambda z, sl: reduce(
|
||||
lambda z, h: z - h[0],
|
||||
sl, z
|
||||
),
|
||||
z_min, # Original geometry
|
||||
sls # Original sediment layers
|
||||
))
|
||||
for t in ts_list:
|
||||
sls = list(map(
|
||||
lambda p: p.get_ts_key(t, "sl")[0],
|
||||
r.profiles
|
||||
))
|
||||
zfd = list(map(
|
||||
lambda z, sl: reduce(
|
||||
lambda z, h: z + h[0],
|
||||
sl, z
|
||||
),
|
||||
z_br, # bedrock
|
||||
sls # Original sediment layers
|
||||
))
|
||||
for i, p in enumerate(r.profiles):
|
||||
r.set(i, t, "zfd", zfd[i])
|
||||
|
||||
results.set("sediment_timestamps", ts)
|
||||
logger.info(f"read_gra: ... end with {len(ts)} timestamp read")
|
||||
|
||||
|
||||
Reference in new issue
Block a user