From 4bab4580ad0ff4c9c370769ca74e8f2517dcbd81 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby Date: Fri, 26 Jun 2026 14:39:34 +0200 Subject: [PATCH] Results: PlotXY: Use table Z to display max elevation. --- src/View/Results/PlotXY.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/View/Results/PlotXY.py b/src/View/Results/PlotXY.py index 2a916812..2ebfaa5d 100644 --- a/src/View/Results/PlotXY.py +++ b/src/View/Results/PlotXY.py @@ -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"