Ensemble: Fix open results.

scenario-dev-pa
Pierre-Antoine 2026-09-08 15:08:11 +02:00
parent 58e3da8942
commit 97fe038d9b
2 changed files with 10 additions and 25 deletions

View File

@ -160,14 +160,7 @@ 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 = list( water_z = table[ts, :]
map(
lambda p: table[
ts, p.global_index
],
reach.profiles
)
)
self.water = self.canvas.axes.plot( self.water = self.canvas.axes.plot(
rk, water_z, rk, water_z,
@ -271,27 +264,12 @@ 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 = list( water_z = table[ts, :]
map(
lambda p: table[
ts, p.global_index
],
reach.profiles
)
)
self.water[0].set_data( self.water[0].set_data(
rk, water_z 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): def update_additional_data(self):
self.draw_additional_data(0) self.draw_additional_data(0)
self.update_idle() self.update_idle()

View File

@ -565,7 +565,14 @@ class SolverLogEnsWindow(SolverLogWindow):
) )
results.set("table", table) results.set("table", table)
results.set("timestamps", tables["timestamps"])
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 return results