Results: PlotRKC: Minor change to optimize drawing.

scenario-dev-pa
Pierre-Antoine 2026-09-08 16:04:19 +02:00
parent 97fe038d9b
commit a0886d900e
1 changed files with 9 additions and 36 deletions

View File

@ -109,12 +109,8 @@ class PlotRKC(PamhyrPlot):
table = results.get("table")["zfd"] table = results.get("table")["zfd"]
ts = results.get_timestamp_id(self._current_timestamp) ts = results.get_timestamp_id(self._current_timestamp)
zfd = list( gi_0, gi_1 = reach.global_index
map( water_z = table[ts, gi_0 : gi_1 + 1]
lambda p: table[ts, p.global_index],
reach.profiles
)
)
self.line_bottom, = self.canvas.axes.plot( self.line_bottom, = self.canvas.axes.plot(
rk, zfd, rk, zfd,
@ -178,14 +174,8 @@ class PlotRKC(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( gi_0, gi_1 = reach.global_index
map( water_z = table[ts, gi_0 : gi_1 + 1]
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,
@ -209,16 +199,8 @@ class PlotRKC(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( gi_0, gi_1 = reach.global_index
map( water_z = table[ts, gi_0 : gi_1 + 1]
lambda p: np.max(
table[
:, p.global_index
]
),
reach.profiles
)
)
self.canvas.axes.plot( self.canvas.axes.plot(
rk, water_z, lw=1., rk, water_z, lw=1.,
@ -354,14 +336,8 @@ class PlotRKC(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( gi_0, gi_1 = reach.global_index
map( water_z = table[ts, gi_0 : gi_1 + 1]
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
@ -402,10 +378,7 @@ class PlotRKC(PamhyrPlot):
table = results.get("table")["zfd"] table = results.get("table")["zfd"]
ts = results.get_timestamp_id(self._current_timestamp) ts = results.get_timestamp_id(self._current_timestamp)
zfd = list(map( zfd = table[ts, reach.global_index]
lambda p: table[ts, p.global_index],
reach.profiles
))
self.line_bottom.remove() self.line_bottom.remove()