mirror of https://gitlab.com/pamhyr/pamhyr2
compare_results: debug timestamps
parent
4e87135bf4
commit
589b8dcd23
|
|
@ -66,6 +66,7 @@ class CustomPlot(PamhyrPlot):
|
||||||
self._profile = profile
|
self._profile = profile
|
||||||
self._timestamp = timestamp
|
self._timestamp = timestamp
|
||||||
self._current_res_id = res_id
|
self._current_res_id = res_id
|
||||||
|
self._parent = parent
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Create custom plot for: " +
|
"Create custom plot for: " +
|
||||||
|
|
@ -628,8 +629,7 @@ class CustomPlot(PamhyrPlot):
|
||||||
self._axes[ax].spines['right'].set_position(('outward', shift))
|
self._axes[ax].spines['right'].set_position(('outward', shift))
|
||||||
shift += 60
|
shift += 60
|
||||||
|
|
||||||
ts = list(results.get("timestamps"))
|
ts = self._parent._timestamps
|
||||||
ts.sort()
|
|
||||||
|
|
||||||
q = profile.get_key("Q")
|
q = profile.get_key("Q")
|
||||||
z = profile.get_key("Z")
|
z = profile.get_key("Z")
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,11 @@ class PlotAC(PamhyrPlot):
|
||||||
parent=parent
|
parent=parent
|
||||||
)
|
)
|
||||||
|
|
||||||
self._current_timestamp = max(results[res_id].get("timestamps"))
|
|
||||||
self._current_reach_id = reach_id
|
self._current_reach_id = reach_id
|
||||||
self._current_profile_id = profile_id
|
self._current_profile_id = profile_id
|
||||||
self._current_res_id = res_id
|
self._current_res_id = res_id
|
||||||
|
self._timestamps = parent._timestamps
|
||||||
|
self._current_timestamp = max(self._timestamps)
|
||||||
|
|
||||||
self.label_x = self._trad['x']
|
self.label_x = self._trad['x']
|
||||||
self.label_y = self._trad["unit_elevation"]
|
self.label_y = self._trad["unit_elevation"]
|
||||||
|
|
@ -63,7 +64,7 @@ class PlotAC(PamhyrPlot):
|
||||||
@results.setter
|
@results.setter
|
||||||
def results(self, results):
|
def results(self, results):
|
||||||
self.data = results
|
self.data = results
|
||||||
self._current_timestamp = max(results[self._current_res_id].get("timestamps"))
|
self._current_timestamp = max(self._timestamps)
|
||||||
|
|
||||||
@timer
|
@timer
|
||||||
def draw(self, highlight=None):
|
def draw(self, highlight=None):
|
||||||
|
|
|
||||||
|
|
@ -47,10 +47,11 @@ class PlotH(PamhyrPlot):
|
||||||
|
|
||||||
self._mode = "time"
|
self._mode = "time"
|
||||||
|
|
||||||
self._current_timestamp = max(results[res_id].get("timestamps"))
|
|
||||||
self._current_reach_id = reach_id
|
self._current_reach_id = reach_id
|
||||||
self._current_profile_id = profile_id
|
self._current_profile_id = profile_id
|
||||||
self._current_res_id = res_id
|
self._current_res_id = res_id
|
||||||
|
self._timestamps = parent._timestamps
|
||||||
|
self._current_timestamp = max(self._timestamps)
|
||||||
|
|
||||||
self.label_x = self._trad["unit_time_s"]
|
self.label_x = self._trad["unit_time_s"]
|
||||||
self.label_y = self._trad["unit_discharge"]
|
self.label_y = self._trad["unit_discharge"]
|
||||||
|
|
@ -71,7 +72,7 @@ class PlotH(PamhyrPlot):
|
||||||
@results.setter
|
@results.setter
|
||||||
def results(self, results):
|
def results(self, results):
|
||||||
self.data = results
|
self.data = results
|
||||||
self._current_timestamp = max(results[self._current_res_id].get("timestamps"))
|
self._current_timestamp = max(self._timestamps)
|
||||||
|
|
||||||
@timer
|
@timer
|
||||||
def draw(self, highlight=None):
|
def draw(self, highlight=None):
|
||||||
|
|
@ -104,10 +105,8 @@ class PlotH(PamhyrPlot):
|
||||||
self._init = True
|
self._init = True
|
||||||
|
|
||||||
def draw_data(self, reach, profile):
|
def draw_data(self, reach, profile):
|
||||||
self.ts = list(self.results[self._current_res_id].get("timestamps"))
|
|
||||||
self.ts.sort()
|
|
||||||
|
|
||||||
x = self.ts
|
x = self._timestamps
|
||||||
y = profile.get_key("Q")
|
y = profile.get_key("Q")
|
||||||
|
|
||||||
self._line, = self.canvas.axes.plot(
|
self._line, = self.canvas.axes.plot(
|
||||||
|
|
@ -128,10 +127,8 @@ class PlotH(PamhyrPlot):
|
||||||
)
|
)
|
||||||
|
|
||||||
def draw_max(self, reach):
|
def draw_max(self, reach):
|
||||||
self.ts = list(self.results[self._current_res_id].get("timestamps"))
|
|
||||||
self.ts.sort()
|
|
||||||
|
|
||||||
x = self.ts
|
x = self._timestamps
|
||||||
y = []
|
y = []
|
||||||
for ts in x:
|
for ts in x:
|
||||||
ts_y = -9999
|
ts_y = -9999
|
||||||
|
|
@ -178,7 +175,7 @@ class PlotH(PamhyrPlot):
|
||||||
reach = results.river.reach(self._current_reach_id)
|
reach = results.river.reach(self._current_reach_id)
|
||||||
profile = reach.profile(self._current_profile_id)
|
profile = reach.profile(self._current_profile_id)
|
||||||
|
|
||||||
x = self.ts
|
x = self._timestamps
|
||||||
y = profile.get_key("Q")
|
y = profile.get_key("Q")
|
||||||
|
|
||||||
self._line.set_data(x, y)
|
self._line.set_data(x, y)
|
||||||
|
|
|
||||||
|
|
@ -42,12 +42,11 @@ class PlotRKC(PamhyrPlot):
|
||||||
parent=parent
|
parent=parent
|
||||||
)
|
)
|
||||||
|
|
||||||
self._timestamps = results[res_id].get("timestamps")
|
|
||||||
self._current_timestamp = max(results[res_id].get("timestamps"))
|
|
||||||
self._current_timestamp = max(self._timestamps)
|
|
||||||
self._current_reach_id = reach_id
|
self._current_reach_id = reach_id
|
||||||
self._current_profile_id = profile_id
|
self._current_profile_id = profile_id
|
||||||
self._current_res_id = res_id
|
self._current_res_id = res_id
|
||||||
|
self._timestamps = parent._timestamps
|
||||||
|
self._current_timestamp = max(self._timestamps)
|
||||||
|
|
||||||
self.label_x = self._trad["unit_rk"]
|
self.label_x = self._trad["unit_rk"]
|
||||||
self.label_y = self._trad["unit_elevation"]
|
self.label_y = self._trad["unit_elevation"]
|
||||||
|
|
@ -65,7 +64,7 @@ class PlotRKC(PamhyrPlot):
|
||||||
@results.setter
|
@results.setter
|
||||||
def results(self, results):
|
def results(self, results):
|
||||||
self.data = results
|
self.data = results
|
||||||
self._current_timestamp = max(results[self._current_res_id].get("timestamps"))
|
self._current_timestamp = max(self._timestamps)
|
||||||
|
|
||||||
@timer
|
@timer
|
||||||
def draw(self, highlight=None):
|
def draw(self, highlight=None):
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ class PlotXY(PamhyrPlot):
|
||||||
self.line_gl = []
|
self.line_gl = []
|
||||||
self.overflow = []
|
self.overflow = []
|
||||||
|
|
||||||
self._timestamps = results[res_id].get("timestamps")
|
self._timestamps = parent._timestamps
|
||||||
self._current_timestamp = max(self._timestamps)
|
self._current_timestamp = max(self._timestamps)
|
||||||
self._current_reach_id = reach_id
|
self._current_reach_id = reach_id
|
||||||
self._current_profile_id = profile_id
|
self._current_profile_id = profile_id
|
||||||
|
|
@ -137,7 +137,7 @@ class PlotXY(PamhyrPlot):
|
||||||
@results.setter
|
@results.setter
|
||||||
def results(self, results):
|
def results(self, results):
|
||||||
self.data = results
|
self.data = results
|
||||||
self._current_timestamp = max(results[self._current_res_id].get("timestamps"))
|
self._current_timestamp = max(self._timestamps)
|
||||||
|
|
||||||
@timer
|
@timer
|
||||||
def draw(self, highlight=None):
|
def draw(self, highlight=None):
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,8 @@ class ResultsWindow(PamhyrWindow):
|
||||||
profile_id=0,
|
profile_id=0,
|
||||||
res_id=self._current_results,
|
res_id=self._current_results,
|
||||||
trad=self._trad,
|
trad=self._trad,
|
||||||
toolbar=self.toolbar_2
|
toolbar=self.toolbar_2,
|
||||||
|
parent=self
|
||||||
)
|
)
|
||||||
self.plot_rkc.draw()
|
self.plot_rkc.draw()
|
||||||
|
|
||||||
|
|
@ -240,7 +241,8 @@ class ResultsWindow(PamhyrWindow):
|
||||||
profile_id=0,
|
profile_id=0,
|
||||||
res_id=self._current_results,
|
res_id=self._current_results,
|
||||||
trad=self._trad,
|
trad=self._trad,
|
||||||
toolbar=self.toolbar_3
|
toolbar=self.toolbar_3,
|
||||||
|
parent=self
|
||||||
)
|
)
|
||||||
self.plot_ac.draw()
|
self.plot_ac.draw()
|
||||||
|
|
||||||
|
|
@ -264,7 +266,8 @@ class ResultsWindow(PamhyrWindow):
|
||||||
profile_id=0,
|
profile_id=0,
|
||||||
res_id=self._current_results,
|
res_id=self._current_results,
|
||||||
trad=self._trad,
|
trad=self._trad,
|
||||||
toolbar=self.toolbar_4
|
toolbar=self.toolbar_4,
|
||||||
|
parent=self
|
||||||
)
|
)
|
||||||
self.plot_h.draw()
|
self.plot_h.draw()
|
||||||
|
|
||||||
|
|
@ -577,6 +580,7 @@ class ResultsWindow(PamhyrWindow):
|
||||||
self._get_current_timestamp(),
|
self._get_current_timestamp(),
|
||||||
data=self._results,
|
data=self._results,
|
||||||
canvas=canvas,
|
canvas=canvas,
|
||||||
|
res_id=self._current_results,
|
||||||
toolbar=toolbar,
|
toolbar=toolbar,
|
||||||
parent=self,
|
parent=self,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue