mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
compare_results: debug timestamps
This commit is contained in:
1 parent
4e87135bf4
commit
589b8dcd23
6 files changed
+23
-22
No files matched your search
@@ -66,6 +66,7 @@ class CustomPlot(PamhyrPlot):
|
||||
self._profile = profile
|
||||
self._timestamp = timestamp
|
||||
self._current_res_id = res_id
|
||||
self._parent = parent
|
||||
|
||||
logger.debug(
|
||||
"Create custom plot for: " +
|
||||
@@ -628,8 +629,7 @@ class CustomPlot(PamhyrPlot):
|
||||
self._axes[ax].spines['right'].set_position(('outward', shift))
|
||||
shift += 60
|
||||
|
||||
ts = list(results.get("timestamps"))
|
||||
ts.sort()
|
||||
ts = self._parent._timestamps
|
||||
|
||||
q = profile.get_key("Q")
|
||||
z = profile.get_key("Z")
|
||||
|
||||
@@ -39,10 +39,11 @@ class PlotAC(PamhyrPlot):
|
||||
parent=parent
|
||||
)
|
||||
|
||||
self._current_timestamp = max(results[res_id].get("timestamps"))
|
||||
self._current_reach_id = reach_id
|
||||
self._current_profile_id = profile_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_y = self._trad["unit_elevation"]
|
||||
@@ -63,7 +64,7 @@ class PlotAC(PamhyrPlot):
|
||||
@results.setter
|
||||
def results(self, results):
|
||||
self.data = results
|
||||
self._current_timestamp = max(results[self._current_res_id].get("timestamps"))
|
||||
self._current_timestamp = max(self._timestamps)
|
||||
|
||||
@timer
|
||||
def draw(self, highlight=None):
|
||||
|
||||
@@ -47,10 +47,11 @@ class PlotH(PamhyrPlot):
|
||||
|
||||
self._mode = "time"
|
||||
|
||||
self._current_timestamp = max(results[res_id].get("timestamps"))
|
||||
self._current_reach_id = reach_id
|
||||
self._current_profile_id = profile_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_y = self._trad["unit_discharge"]
|
||||
@@ -71,7 +72,7 @@ class PlotH(PamhyrPlot):
|
||||
@results.setter
|
||||
def results(self, results):
|
||||
self.data = results
|
||||
self._current_timestamp = max(results[self._current_res_id].get("timestamps"))
|
||||
self._current_timestamp = max(self._timestamps)
|
||||
|
||||
@timer
|
||||
def draw(self, highlight=None):
|
||||
@@ -104,10 +105,8 @@ class PlotH(PamhyrPlot):
|
||||
self._init = True
|
||||
|
||||
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")
|
||||
|
||||
self._line, = self.canvas.axes.plot(
|
||||
@@ -128,10 +127,8 @@ class PlotH(PamhyrPlot):
|
||||
)
|
||||
|
||||
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 = []
|
||||
for ts in x:
|
||||
ts_y = -9999
|
||||
@@ -178,7 +175,7 @@ class PlotH(PamhyrPlot):
|
||||
reach = results.river.reach(self._current_reach_id)
|
||||
profile = reach.profile(self._current_profile_id)
|
||||
|
||||
x = self.ts
|
||||
x = self._timestamps
|
||||
y = profile.get_key("Q")
|
||||
|
||||
self._line.set_data(x, y)
|
||||
|
||||
@@ -42,12 +42,11 @@ class PlotRKC(PamhyrPlot):
|
||||
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_profile_id = profile_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_y = self._trad["unit_elevation"]
|
||||
@@ -65,7 +64,7 @@ class PlotRKC(PamhyrPlot):
|
||||
@results.setter
|
||||
def results(self, results):
|
||||
self.data = results
|
||||
self._current_timestamp = max(results[self._current_res_id].get("timestamps"))
|
||||
self._current_timestamp = max(self._timestamps)
|
||||
|
||||
@timer
|
||||
def draw(self, highlight=None):
|
||||
|
||||
@@ -52,7 +52,7 @@ class PlotXY(PamhyrPlot):
|
||||
self.line_gl = []
|
||||
self.overflow = []
|
||||
|
||||
self._timestamps = results[res_id].get("timestamps")
|
||||
self._timestamps = parent._timestamps
|
||||
self._current_timestamp = max(self._timestamps)
|
||||
self._current_reach_id = reach_id
|
||||
self._current_profile_id = profile_id
|
||||
@@ -137,7 +137,7 @@ class PlotXY(PamhyrPlot):
|
||||
@results.setter
|
||||
def results(self, results):
|
||||
self.data = results
|
||||
self._current_timestamp = max(results[self._current_res_id].get("timestamps"))
|
||||
self._current_timestamp = max(self._timestamps)
|
||||
|
||||
@timer
|
||||
def draw(self, highlight=None):
|
||||
|
||||
@@ -217,7 +217,8 @@ class ResultsWindow(PamhyrWindow):
|
||||
profile_id=0,
|
||||
res_id=self._current_results,
|
||||
trad=self._trad,
|
||||
toolbar=self.toolbar_2
|
||||
toolbar=self.toolbar_2,
|
||||
parent=self
|
||||
)
|
||||
self.plot_rkc.draw()
|
||||
|
||||
@@ -240,7 +241,8 @@ class ResultsWindow(PamhyrWindow):
|
||||
profile_id=0,
|
||||
res_id=self._current_results,
|
||||
trad=self._trad,
|
||||
toolbar=self.toolbar_3
|
||||
toolbar=self.toolbar_3,
|
||||
parent=self
|
||||
)
|
||||
self.plot_ac.draw()
|
||||
|
||||
@@ -264,7 +266,8 @@ class ResultsWindow(PamhyrWindow):
|
||||
profile_id=0,
|
||||
res_id=self._current_results,
|
||||
trad=self._trad,
|
||||
toolbar=self.toolbar_4
|
||||
toolbar=self.toolbar_4,
|
||||
parent=self
|
||||
)
|
||||
self.plot_h.draw()
|
||||
|
||||
@@ -577,6 +580,7 @@ class ResultsWindow(PamhyrWindow):
|
||||
self._get_current_timestamp(),
|
||||
data=self._results,
|
||||
canvas=canvas,
|
||||
res_id=self._current_results,
|
||||
toolbar=toolbar,
|
||||
parent=self,
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user