Results: Custom plot: Use 'zfd' np table.

opt-result
Pierre-Antoine 2026-07-09 18:05:10 +02:00
parent be865102a8
commit 5327c29641
1 changed files with 17 additions and 20 deletions

View File

@ -91,12 +91,14 @@ class CustomPlot(PamhyrPlot):
self.lines = {} self.lines = {}
def draw_bottom_with_bedload(self, reach): def draw_bottom_with_bedload(self, reach):
results = self.data[self._current_res_id]
table = results.get("table")["zfd"]
ts = results.get_timestamp_id(self._current_timestamp)
rk = reach.geometry.get_rk() rk = reach.geometry.get_rk()
z = list( z = list(
map( map(
lambda p: p.get_ts_key( lambda p: table[ts, p.global_index],
self._current_timestamp, "zfd"
),
reach.profiles reach.profiles
) )
) )
@ -106,7 +108,10 @@ class CustomPlot(PamhyrPlot):
def get_ts_zmin(self, profile, res_id): def get_ts_zmin(self, profile, res_id):
results = self.data[res_id] results = self.data[res_id]
reach = results.river.reach(self._current_reach) reach = results.river.reach(self._current_reach)
zfd = reach.profile(profile).get_key("zfd")
table = results.get("table")["zfd"]
zfd = table[:, reach.profile(profile).global_index]
return zfd return zfd
def _draw_rk(self): def _draw_rk(self):
@ -170,22 +175,14 @@ class CustomPlot(PamhyrPlot):
) )
else: else:
if reach.has_bedload(): if reach.has_bedload():
z_min1 = list( z_min1 = list(map(
map( lambda p: table["zfd"][id_ts, p.global_index],
lambda p: p.get_ts_key( reach1.profiles
self._current_timestamp, "zfd" ))
), z_min2 = list(map(
reach1.profiles lambda p: table["zfd"][id_ts, p.global_index],
) reach2.profiles
) ))
z_min2 = list(
map(
lambda p: p.get_ts_key(
self._current_timestamp, "zfd"
),
reach2.profiles
)
)
else: else:
z_min1 = reach1.geometry.get_z_min() z_min1 = reach1.geometry.get_z_min()
z_min2 = reach2.geometry.get_z_min() z_min2 = reach2.geometry.get_z_min()