diff --git a/src/View/Results/PlotRKC.py b/src/View/Results/PlotRKC.py index dc658c65..ca3f005f 100644 --- a/src/View/Results/PlotRKC.py +++ b/src/View/Results/PlotRKC.py @@ -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()