Results: Add hydro. struct. on kpc plot.

setup.py
Pierre-Antoine Rouby 2024-05-15 14:37:31 +02:00
parent 4be43528e3
commit e33c9cb2f0
1 changed files with 29 additions and 0 deletions

View File

@ -79,6 +79,7 @@ class PlotKPC(PamhyrPlot):
self.draw_water_elevation_max(reach)
self.draw_water_elevation_overflow(reach)
self.draw_current(reach)
self.draw_profiles_hs(reach)
# self.enable_legend()
@ -105,6 +106,34 @@ class PlotKPC(PamhyrPlot):
self._river_bottom = z
def draw_profiles_hs(self, reach):
lhs = filter(
lambda hs: hs._input_reach.reach is reach.geometry,
self.results.study.river.hydraulic_structures.lst
)
for hs in lhs:
x = hs.input_kp
z_min = reach.geometry.get_z_min()
z_max = reach.geometry.get_z_max()
self.canvas.axes.plot(
[x, x],
[min(z_min), max(z_max)],
linestyle="solid",
lw=1.,
color=self.color_plot_previous,
)
self.canvas.axes.annotate(
" > " + hs.name,
(x, max(z_max)),
horizontalalignment='left',
verticalalignment='top',
annotation_clip=True,
fontsize=9, color=self.color_plot_previous,
)
def sl_compute_bedrock(self, reach):
z_min = reach.geometry.get_z_min()
sl = self.sl_compute_initial(reach)