Compare commits

..

2 Commits

Author SHA1 Message Date
Theophile Terraz c1905aa7e1 debug rubarBE format 2025-11-14 11:48:02 +01:00
Theophile Terraz 02db91f3d7 debug 2025-11-06 15:13:20 +01:00
3 changed files with 14 additions and 7 deletions

View File

@ -575,8 +575,12 @@ class Rubar3(CommandLineSolver):
for bc in bcs: for bc in bcs:
f.write(f"{len(bc)}\n") f.write(f"{len(bc)}\n")
if bc.bctype == "ZD":
for d0, d1 in bc.data: for d0, d1 in bc.data:
f.write(f"{d1} {d0}\n") f.write(f"{d1} {d0}\n")
else:
for d0, d1 in bc.data:
f.write(f"{d0} {d1}\n")
def read_profil(self, study, fname, results, qlog=None, name="0"): def read_profil(self, study, fname, results, qlog=None, name="0"):
logger.info(f"read: profil.{name}") logger.info(f"read: profil.{name}")
@ -590,7 +594,10 @@ class Rubar3(CommandLineSolver):
def read_data_line(f): def read_data_line(f):
line = f.readline().split() line = f.readline().split()
if len(line) > 3:
return tuple(map(float, line)) return tuple(map(float, line))
else:
return (0.0, 0.0, 0.0, 0.0)
def set_and_compute_limites(reach, ind, z, q, s): def set_and_compute_limites(reach, ind, z, q, s):
reach.set(ind, timestamp, "Z", z) reach.set(ind, timestamp, "Z", z)
@ -628,9 +635,9 @@ class Rubar3(CommandLineSolver):
h, s, q, z = read_data_line(f) h, s, q, z = read_data_line(f)
set_and_compute_limites( set_and_compute_limites(
reach, ind, reach, ind,
(ph + pz + ph + h) / 2, (pz + z + ph + h) / 2,
(pz + s) / 2, (pq + q) / 2,
(pq + q) / 2 (ps + s) / 2
) )
ph = h ph = h

View File

@ -718,7 +718,7 @@ class ResultsWindow(PamhyrWindow):
select_file="AnyFile", select_file="AnyFile",
callback=lambda f: self.export_to(f[0], x, y, envelop, solver_id), callback=lambda f: self.export_to(f[0], x, y, envelop, solver_id),
default_suffix=".csv", default_suffix=".csv",
file_filter=[self._dict["file_csv"]], file_filter=[self._trad["file_csv"]],
) )
def export_to(self, filename, x, y, envelop, solver_id): def export_to(self, filename, x, y, envelop, solver_id):