mirror of https://gitlab.com/pamhyr/pamhyr2
again
parent
bf95b7f7e6
commit
990d44dd07
|
|
@ -160,8 +160,6 @@ class TableModel(PamhyrTableModel):
|
||||||
self._lst = _river.reachs
|
self._lst = _river.reachs
|
||||||
elif self._opt_data == "profile" or self._opt_data == "raw_data":
|
elif self._opt_data == "profile" or self._opt_data == "raw_data":
|
||||||
self._lst = _river.reach(reach).profiles
|
self._lst = _river.reach(reach).profiles
|
||||||
# self._lst = list(compress(_river.reach(reach).profiles,
|
|
||||||
# _river.reach(reach).profile_mask))
|
|
||||||
elif self._opt_data == "solver":
|
elif self._opt_data == "solver":
|
||||||
self._lst = self._parent._solvers
|
self._lst = self._parent._solvers
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1234,29 +1234,51 @@ class ResultsWindow(PamhyrWindow):
|
||||||
if filename == "":
|
if filename == "":
|
||||||
return
|
return
|
||||||
|
|
||||||
|
sep = " "
|
||||||
with open(filename, 'r', newline='') as f:
|
with open(filename, 'r', newline='') as f:
|
||||||
lines=f.readlines()
|
lines = f.readlines()
|
||||||
x = []
|
x = []
|
||||||
y = []
|
y = []
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if line[0] != "*" and line[0] != "#" and line[0] != "$":
|
if line[0] != "*" and line[0] != "#" and line[0] != "$":
|
||||||
row = line.split(" ")
|
row = line.split(sep)
|
||||||
print(row)
|
print(row)
|
||||||
if len(row) > 1:
|
if len(row) >= 2:
|
||||||
x.append(float(row[0]))
|
try:
|
||||||
y.append(float(row[1]))
|
x.append(float(row[0]))
|
||||||
data_type_lst =['Q(t)', 'Z(x)']
|
y.append(float(row[1]))
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
print(x)
|
||||||
|
print(y)
|
||||||
|
|
||||||
|
# with open(filename, 'r', newline='') as f:
|
||||||
|
# reader = csv.reader(f, delimiter=sep, quotechar='|',
|
||||||
|
# quoting=csv.QUOTE_NONNUMERIC)
|
||||||
|
# for row in reader:
|
||||||
|
# print(row)
|
||||||
|
# if len(row) == 2:
|
||||||
|
# x.append(float(row[0]))
|
||||||
|
# y.append(float(row[1]))
|
||||||
|
|
||||||
|
data_type_lst = ['Q(t)', 'Z(t)', 'Z(x)']
|
||||||
data_type, ok = QInputDialog.getItem(
|
data_type, ok = QInputDialog.getItem(
|
||||||
self, 'Data type', 'Chose the type of data:', data_type_lst)
|
self, 'Data type', 'Chose the type of data:', data_type_lst)
|
||||||
|
|
||||||
if not ok:
|
if not ok:
|
||||||
return
|
return
|
||||||
|
|
||||||
print(x)
|
|
||||||
print(y)
|
|
||||||
if data_type == 'Z(x)':
|
if data_type == 'Z(x)':
|
||||||
self.canvas_2.axes.scatter(x, y, marker="+")
|
self.canvas_2.axes.scatter(x, y, marker="+")
|
||||||
self.plot_rkc.idle()
|
self.plot_rkc.idle()
|
||||||
if data_type == 'Q(t)':
|
if data_type == 'Q(t)':
|
||||||
self.canvas_4.axes.scatter(x, y, marker="+")
|
self.canvas_4.axes.scatter(x, y, marker="+")
|
||||||
self.plot_h.idle()
|
self.plot_h.idle()
|
||||||
|
if data_type == 'Z(t)':
|
||||||
|
for plot in self._additional_plot:
|
||||||
|
x_key = plot.split(": ")[0]
|
||||||
|
y_key = plot.split(": ")[1].split(",")
|
||||||
|
if 'time' in x_key and 'water_elevation' in y_key:
|
||||||
|
self._additional_plot[plot].canvas.axes.scatter(
|
||||||
|
x, y, marker="+")
|
||||||
|
self._additional_plot[plot].idle()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue