mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Ensemble: Results: PlotRKC: Fix table access.
This commit is contained in:
1 parent
a0886d900e
commit
03299db99a
2 files changed
+15
-2
No files matched your search
@@ -160,7 +160,8 @@ class PlotRKCEnsemble(PamhyrPlot):
|
|||||||
table = result.get("table")[t]
|
table = result.get("table")[t]
|
||||||
ts = result.get_timestamp_id(self._current_timestamp)
|
ts = result.get_timestamp_id(self._current_timestamp)
|
||||||
|
|
||||||
water_z = table[ts, :]
|
gi_0, gi_1 = reach.global_index
|
||||||
|
water_z = table[ts, gi_0 : gi_1 + 1]
|
||||||
|
|
||||||
self.water = self.canvas.axes.plot(
|
self.water = self.canvas.axes.plot(
|
||||||
rk, water_z,
|
rk, water_z,
|
||||||
@@ -264,7 +265,8 @@ class PlotRKCEnsemble(PamhyrPlot):
|
|||||||
table = result.get("table")["Z"]
|
table = result.get("table")["Z"]
|
||||||
ts = result.get_timestamp_id(self._current_timestamp)
|
ts = result.get_timestamp_id(self._current_timestamp)
|
||||||
|
|
||||||
water_z = table[ts, :]
|
gi_0, gi_1 = reach.global_index
|
||||||
|
water_z = table[ts, gi_0 : gi_1 + 1]
|
||||||
|
|
||||||
self.water[0].set_data(
|
self.water[0].set_data(
|
||||||
rk, water_z
|
rk, water_z
|
||||||
|
|||||||
@@ -566,6 +566,17 @@ class SolverLogEnsWindow(SolverLogWindow):
|
|||||||
|
|
||||||
results.set("table", table)
|
results.set("table", table)
|
||||||
|
|
||||||
|
# Compute global index for reaches and profiles
|
||||||
|
gi = 0
|
||||||
|
for reach in results.river.reachs:
|
||||||
|
gi_start = gi
|
||||||
|
|
||||||
|
for profile in reach.profiles:
|
||||||
|
gi += 1
|
||||||
|
|
||||||
|
reach.set_global_index(range(gi_start, gi))
|
||||||
|
|
||||||
|
# Compute timestamps index table
|
||||||
ts = tables["timestamps"]
|
ts = tables["timestamps"]
|
||||||
ts_index = {}
|
ts_index = {}
|
||||||
for i, t in enumerate(sorted(ts)):
|
for i, t in enumerate(sorted(ts)):
|
||||||
|
|||||||
Reference in new issue
Block a user