mirror of https://gitlab.com/pamhyr/pamhyr2
debug rubarBE format
parent
02db91f3d7
commit
c1905aa7e1
|
|
@ -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")
|
||||||
for d0, d1 in bc.data:
|
if bc.bctype == "ZD":
|
||||||
f.write(f"{d1} {d0}\n")
|
for d0, d1 in bc.data:
|
||||||
|
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()
|
||||||
return tuple(map(float, line))
|
if len(line) > 3:
|
||||||
|
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
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue