mirror of https://gitlab.com/pamhyr/pamhyr2
Results: PlotH: Use np table.
parent
fef2e1a40c
commit
d0a8f369ef
|
|
@ -128,14 +128,19 @@ class PlotH(PamhyrPlot):
|
||||||
self.draw_current()
|
self.draw_current()
|
||||||
self._init = True
|
self._init = True
|
||||||
|
|
||||||
|
@timer
|
||||||
def draw_data(self, res_id):
|
def draw_data(self, res_id):
|
||||||
results = self.results[res_id]
|
results = self.results[res_id]
|
||||||
reach = results.river.reach(self._current_reach_id)
|
reach = results.river.reach(self._current_reach_id)
|
||||||
|
|
||||||
|
q = results.get("table")["Q"]
|
||||||
|
|
||||||
for i, p in enumerate(self._current_profile_id):
|
for i, p in enumerate(self._current_profile_id):
|
||||||
profile = reach.profile(p)
|
profile = reach.profile(p)
|
||||||
|
|
||||||
x = self._timestamps
|
x = self._timestamps
|
||||||
y = profile.get_key("Q")
|
y = q[:, profile.global_index]
|
||||||
|
# y = profile.get_key("Q")
|
||||||
|
|
||||||
if res_id == 2:
|
if res_id == 2:
|
||||||
label = "Δ " + self.label_discharge + f" {profile.name}"
|
label = "Δ " + self.label_discharge + f" {profile.name}"
|
||||||
|
|
@ -187,6 +192,7 @@ class PlotH(PamhyrPlot):
|
||||||
lw=1.,
|
lw=1.,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@timer
|
||||||
def draw_max(self, res_id):
|
def draw_max(self, res_id):
|
||||||
results = self.results[res_id]
|
results = self.results[res_id]
|
||||||
reach = results.river.reach(self._current_reach_id)
|
reach = results.river.reach(self._current_reach_id)
|
||||||
|
|
@ -198,16 +204,21 @@ class PlotH(PamhyrPlot):
|
||||||
x = self._timestamps
|
x = self._timestamps
|
||||||
y = []
|
y = []
|
||||||
|
|
||||||
|
q_table = results.get("table")["Q"]
|
||||||
|
|
||||||
if res_id == 2:
|
if res_id == 2:
|
||||||
label = "Δ " + self.label_discharge_max
|
label = "Δ " + self.label_discharge_max
|
||||||
else:
|
else:
|
||||||
label = self.label_discharge_max
|
label = self.label_discharge_max
|
||||||
|
|
||||||
for ts in x:
|
for i, ts in enumerate(x):
|
||||||
ts_y = -9999
|
ts_y = -9999
|
||||||
|
|
||||||
for profile in reach.profiles:
|
for profile in reach.profiles:
|
||||||
q = profile.get_ts_key(ts, "Q")
|
q = q_table[i, profile.global_index]
|
||||||
|
# q = profile.get_ts_key(ts, "Q")
|
||||||
ts_y = max(ts_y, q)
|
ts_y = max(ts_y, q)
|
||||||
|
|
||||||
y.append(ts_y)
|
y.append(ts_y)
|
||||||
|
|
||||||
m, = self.canvas.axes.plot(
|
m, = self.canvas.axes.plot(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue