Results: PlotXY: Use table Z to display max elevation.

opt-result
Pierre-Antoine 2026-06-26 14:39:34 +02:00
parent 21d2e6ad20
commit 4bab4580ad
1 changed files with 11 additions and 11 deletions

View File

@ -20,9 +20,10 @@ import logging
from functools import reduce
import numpy as np
from tools import timer, trace, logger_exception
from View.Tools.PamhyrPlot import PamhyrPlot
import numpy as np
from matplotlib import collections
from PyQt5.QtCore import (
@ -239,14 +240,20 @@ class PlotXY(PamhyrPlot):
)
def draw_water_elevation_max(self, reach):
result = self.results[self._current_res_id]
l_x, l_y, r_x, r_y = [], [], [], []
overflow = []
for profile in reach.profiles:
z_max = max(profile.get_key("Z"))
zs = result.get("table")["Z"][
:, profile.global_index
]
z_max = np.max(zs)
z_max_ts = 0
for ts in self._timestamps:
z = profile.get_ts_key(ts, "Z")
for i, ts in enumerate(self._timestamps):
z = zs[i]
if z == z_max:
z_max_ts = ts
break
@ -304,10 +311,6 @@ class PlotXY(PamhyrPlot):
poly_l_x, poly_l_y, poly_r_x, poly_r_y = [], [], [], []
for profile in reach.profiles:
# water_z = profile.get_ts_key(
# self._current_timestamp, "Z"
# )
pt_left, pt_right = profile.get_ts_key(
self._current_timestamp,
"water_limits"
@ -435,9 +438,6 @@ class PlotXY(PamhyrPlot):
poly_l_x, poly_l_y, poly_r_x, poly_r_y = [], [], [], []
for profile in reach.profiles:
water_z = profile.get_ts_key(
self._current_timestamp, "Z"
)
pt_left, pt_right = profile.get_ts_key(
self._current_timestamp,
"water_limits"