mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Compare commits
4
Commits
58e3da8942
...
bf6d40f398
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf6d40f398 | ||
|
|
03299db99a | ||
|
|
a0886d900e | ||
|
|
97fe038d9b |
No files matched your search
@@ -109,12 +109,8 @@ class PlotRKC(PamhyrPlot):
|
||||
table = results.get("table")["zfd"]
|
||||
ts = results.get_timestamp_id(self._current_timestamp)
|
||||
|
||||
zfd = list(
|
||||
map(
|
||||
lambda p: table[ts, p.global_index],
|
||||
reach.profiles
|
||||
)
|
||||
)
|
||||
gi_0, gi_1 = reach.global_index
|
||||
water_z = table[ts, gi_0 : gi_1 + 1]
|
||||
|
||||
self.line_bottom, = self.canvas.axes.plot(
|
||||
rk, zfd,
|
||||
@@ -178,14 +174,8 @@ class PlotRKC(PamhyrPlot):
|
||||
table = result.get("table")["Z"]
|
||||
ts = result.get_timestamp_id(self._current_timestamp)
|
||||
|
||||
water_z = list(
|
||||
map(
|
||||
lambda p: table[
|
||||
ts, p.global_index
|
||||
],
|
||||
reach.profiles
|
||||
)
|
||||
)
|
||||
gi_0, gi_1 = reach.global_index
|
||||
water_z = table[ts, gi_0 : gi_1 + 1]
|
||||
|
||||
self.water = self.canvas.axes.plot(
|
||||
rk, water_z,
|
||||
@@ -209,16 +199,8 @@ class PlotRKC(PamhyrPlot):
|
||||
table = result.get("table")["Z"]
|
||||
ts = result.get_timestamp_id(self._current_timestamp)
|
||||
|
||||
water_z = list(
|
||||
map(
|
||||
lambda p: np.max(
|
||||
table[
|
||||
:, p.global_index
|
||||
]
|
||||
),
|
||||
reach.profiles
|
||||
)
|
||||
)
|
||||
gi_0, gi_1 = reach.global_index
|
||||
water_z = table[ts, gi_0 : gi_1 + 1]
|
||||
|
||||
self.canvas.axes.plot(
|
||||
rk, water_z, lw=1.,
|
||||
@@ -354,14 +336,8 @@ class PlotRKC(PamhyrPlot):
|
||||
table = result.get("table")["Z"]
|
||||
ts = result.get_timestamp_id(self._current_timestamp)
|
||||
|
||||
water_z = list(
|
||||
map(
|
||||
lambda p: table[
|
||||
ts, p.global_index
|
||||
],
|
||||
reach.profiles
|
||||
)
|
||||
)
|
||||
gi_0, gi_1 = reach.global_index
|
||||
water_z = table[ts, gi_0 : gi_1 + 1]
|
||||
|
||||
self.water[0].set_data(
|
||||
rk, water_z
|
||||
@@ -402,10 +378,7 @@ class PlotRKC(PamhyrPlot):
|
||||
table = results.get("table")["zfd"]
|
||||
ts = results.get_timestamp_id(self._current_timestamp)
|
||||
|
||||
zfd = list(map(
|
||||
lambda p: table[ts, p.global_index],
|
||||
reach.profiles
|
||||
))
|
||||
zfd = table[ts, reach.global_index]
|
||||
|
||||
self.line_bottom.remove()
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ class PlotRKCEnsemble(PamhyrPlot):
|
||||
self.draw_current(reach)
|
||||
self.draw_profiles_hs(reach)
|
||||
|
||||
# self.enable_legend()
|
||||
self.enable_legend()
|
||||
|
||||
self.idle()
|
||||
self._init = True
|
||||
@@ -160,19 +160,14 @@ class PlotRKCEnsemble(PamhyrPlot):
|
||||
table = result.get("table")[t]
|
||||
ts = result.get_timestamp_id(self._current_timestamp)
|
||||
|
||||
water_z = list(
|
||||
map(
|
||||
lambda p: table[
|
||||
ts, p.global_index
|
||||
],
|
||||
reach.profiles
|
||||
)
|
||||
)
|
||||
gi_0, gi_1 = reach.global_index
|
||||
water_z = table[ts, gi_0 : gi_1 + 1]
|
||||
|
||||
self.water = self.canvas.axes.plot(
|
||||
rk, water_z,
|
||||
lw=1., color=color,
|
||||
linestyle='dotted',
|
||||
label=f"Elevation: {t} (m)",
|
||||
)
|
||||
|
||||
def draw_additional_data(self, run_id):
|
||||
@@ -271,27 +266,13 @@ class PlotRKCEnsemble(PamhyrPlot):
|
||||
table = result.get("table")["Z"]
|
||||
ts = result.get_timestamp_id(self._current_timestamp)
|
||||
|
||||
water_z = list(
|
||||
map(
|
||||
lambda p: table[
|
||||
ts, p.global_index
|
||||
],
|
||||
reach.profiles
|
||||
)
|
||||
)
|
||||
gi_0, gi_1 = reach.global_index
|
||||
water_z = table[ts, gi_0 : gi_1 + 1]
|
||||
|
||||
self.water[0].set_data(
|
||||
rk, water_z
|
||||
)
|
||||
|
||||
self.water_fill.remove()
|
||||
self.water_fill = self.canvas.axes.fill_between(
|
||||
rk, self._river_bottom, water_z,
|
||||
where=[rb <= wz for rb, wz in zip(self._river_bottom, water_z)],
|
||||
color=self.color_plot_river_water_zone,
|
||||
alpha=0.7, interpolate=True
|
||||
)
|
||||
|
||||
def update_additional_data(self):
|
||||
self.draw_additional_data(0)
|
||||
self.update_idle()
|
||||
|
||||
@@ -565,7 +565,25 @@ class SolverLogEnsWindow(SolverLogWindow):
|
||||
)
|
||||
|
||||
results.set("table", table)
|
||||
results.set("timestamps", tables["timestamps"])
|
||||
|
||||
# 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_index = {}
|
||||
for i, t in enumerate(sorted(ts)):
|
||||
ts_index[t] = i
|
||||
|
||||
results.set("timestamps", ts)
|
||||
results.set_timestamp_index(ts_index)
|
||||
|
||||
return results
|
||||
|
||||
|
||||
Reference in new issue
Block a user