mirror of https://gitlab.com/pamhyr/pamhyr2
Results: PlotXY: Use table Z to display max elevation.
parent
21d2e6ad20
commit
4bab4580ad
|
|
@ -20,9 +20,10 @@ import logging
|
||||||
|
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
from tools import timer, trace, logger_exception
|
from tools import timer, trace, logger_exception
|
||||||
from View.Tools.PamhyrPlot import PamhyrPlot
|
from View.Tools.PamhyrPlot import PamhyrPlot
|
||||||
import numpy as np
|
|
||||||
from matplotlib import collections
|
from matplotlib import collections
|
||||||
|
|
||||||
from PyQt5.QtCore import (
|
from PyQt5.QtCore import (
|
||||||
|
|
@ -239,14 +240,20 @@ class PlotXY(PamhyrPlot):
|
||||||
)
|
)
|
||||||
|
|
||||||
def draw_water_elevation_max(self, reach):
|
def draw_water_elevation_max(self, reach):
|
||||||
|
result = self.results[self._current_res_id]
|
||||||
|
|
||||||
l_x, l_y, r_x, r_y = [], [], [], []
|
l_x, l_y, r_x, r_y = [], [], [], []
|
||||||
overflow = []
|
overflow = []
|
||||||
|
|
||||||
for profile in reach.profiles:
|
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
|
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:
|
if z == z_max:
|
||||||
z_max_ts = ts
|
z_max_ts = ts
|
||||||
break
|
break
|
||||||
|
|
@ -304,10 +311,6 @@ class PlotXY(PamhyrPlot):
|
||||||
poly_l_x, poly_l_y, poly_r_x, poly_r_y = [], [], [], []
|
poly_l_x, poly_l_y, poly_r_x, poly_r_y = [], [], [], []
|
||||||
|
|
||||||
for profile in reach.profiles:
|
for profile in reach.profiles:
|
||||||
# water_z = profile.get_ts_key(
|
|
||||||
# self._current_timestamp, "Z"
|
|
||||||
# )
|
|
||||||
|
|
||||||
pt_left, pt_right = profile.get_ts_key(
|
pt_left, pt_right = profile.get_ts_key(
|
||||||
self._current_timestamp,
|
self._current_timestamp,
|
||||||
"water_limits"
|
"water_limits"
|
||||||
|
|
@ -435,9 +438,6 @@ class PlotXY(PamhyrPlot):
|
||||||
poly_l_x, poly_l_y, poly_r_x, poly_r_y = [], [], [], []
|
poly_l_x, poly_l_y, poly_r_x, poly_r_y = [], [], [], []
|
||||||
|
|
||||||
for profile in reach.profiles:
|
for profile in reach.profiles:
|
||||||
water_z = profile.get_ts_key(
|
|
||||||
self._current_timestamp, "Z"
|
|
||||||
)
|
|
||||||
pt_left, pt_right = profile.get_ts_key(
|
pt_left, pt_right = profile.get_ts_key(
|
||||||
self._current_timestamp,
|
self._current_timestamp,
|
||||||
"water_limits"
|
"water_limits"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue