mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Solver: RubarBE: Fix results reading.
This commit is contained in:
1 parent
df3b3b604d
commit
e640fa1bc0
3 files changed
+29
-14
No files matched your search
+11
-10
@@ -558,9 +558,9 @@ class Rubar3(CommandLineSolver):
|
||||
return tuple(map(float, line))
|
||||
|
||||
def set_and_compute_limites(reach, ind, z, q, s):
|
||||
reach.set(0, timestamp, "Z", z)
|
||||
reach.set(0, timestamp, "Q", q)
|
||||
reach.set(0, timestamp, "V", s)
|
||||
reach.set(ind, timestamp, "Z", z)
|
||||
reach.set(ind, timestamp, "Q", q)
|
||||
reach.set(ind, timestamp, "V", s)
|
||||
|
||||
profile = reach.profile(ind)
|
||||
limits = profile.geometry.get_water_limits(z)
|
||||
@@ -573,21 +573,24 @@ class Rubar3(CommandLineSolver):
|
||||
while True:
|
||||
line = f.readline()
|
||||
if line == "":
|
||||
results.set("timestamps", ts)
|
||||
return
|
||||
|
||||
timestamp = float(line)
|
||||
ts.add(timestamp)
|
||||
|
||||
logger.info(f"read: profil.{name}: timestamp = {timestamp}")
|
||||
|
||||
for reach, lm in reachs:
|
||||
# First profile
|
||||
z, s, q, e = read_data_line(f)
|
||||
e, s, q, z = read_data_line(f)
|
||||
set_and_compute_limites(reach, 0, z, q, s)
|
||||
|
||||
# For each profile
|
||||
ind = 1
|
||||
pz, ps, pq, pe = read_data_line(f)
|
||||
pe, ps, pq, pz = read_data_line(f)
|
||||
while ind < lm - 2:
|
||||
z, s, q, e = read_data_line(f)
|
||||
e, s, q, z = read_data_line(f)
|
||||
set_and_compute_limites(
|
||||
reach, ind,
|
||||
(pz + z) / 2,
|
||||
@@ -595,15 +598,13 @@ class Rubar3(CommandLineSolver):
|
||||
(ps + s) / 2
|
||||
)
|
||||
|
||||
pz, ps, pq, pe = z, s, q, e
|
||||
pe, ps, pq, pz = z, s, q, e
|
||||
ind += 1
|
||||
|
||||
# Last profile
|
||||
z, s, q, e = read_data_line(f)
|
||||
e, s, q, z = read_data_line(f)
|
||||
set_and_compute_limites(reach, ind, z, q, s)
|
||||
|
||||
results.set("timestamps", ts)
|
||||
|
||||
@timer
|
||||
def results(self, study, repertory, qlog=None, name="0"):
|
||||
results = Results(
|
||||
|
||||
Reference in new issue
Block a user