Commit 6e94d7a7 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

Results: PlotH: Add current ts line.

Showing with 16 additions and 9 deletions
+16 -9
......@@ -41,9 +41,9 @@ class ICTranslate(MainTranslate):
self._sub_dict["table_headers"] = {
# "name": _translate("InitialCondition", "Name"),
"kp": self._dict["unit_kp"],
"speed": self._dict["unit_speed"],
"discharge": self._dict["unit_discharge"],
"elevation": self._dict["unit_elevation"],
"height": self._dict["unit_height"],
"speed": self._dict["unit_speed"],
# "comment": _translate("InitialCondition", "Comment"),
}
......@@ -112,16 +112,22 @@ class PlotH(PamhyrPlot):
)
def draw_current(self, reach, profile):
y = profile.get_key("Q")
min_y, max_y = reduce(
lambda acc, p: (
acc[0] + [min(p.get_key("Q"))],
acc[1] + [max(p.get_key("Q"))]
),
reach.profiles,
([], [])
)
kargs = self.plot_default_kargs.copy()
kargs["marker"] = "o"
self._current, = self.canvas.axes.plot(
self._current_timestamp,
y[self.ts.index(self._current_timestamp)],
[self._current_timestamp, self._current_timestamp],
[min(min_y), max(max_y)],
# label=self.label_timestamp,
color=self.color_plot_current,
**kargs
color=self.color_plot_river_bottom,
linestyle="dashed",
lw=1.,
)
def draw_max(self, reach):
......@@ -175,7 +181,8 @@ class PlotH(PamhyrPlot):
self._line.set_data(x, y)
_, min_max = self._current.get_data()
self._current.set_data(
self._current_timestamp,
y[self.ts.index(self._current_timestamp)]
min_max
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment