Commit ed1a1a71 authored by Theophile Terraz's avatar Theophile Terraz
Browse files

debug

No related merge requests found
Showing with 22 additions and 7 deletions
+22 -7
......@@ -384,9 +384,11 @@ class InitialConditions(SQLSubModel):
width = profile.wet_width(profile.z_min() + height)
frictions = self._reach.frictions.frictions
strickler = None
for f in frictions:
if f.contains_rk(profile.rk):
strickler = f.get_friction(profile.rk)[0]
if frictions is not None:
if len(frictions) >= 1:
for f in frictions:
if f.contains_rk(profile.rk):
strickler = f.get_friction(profile.rk)[0]
if strickler is None:
strickler = 25.0
......@@ -423,6 +425,8 @@ class InitialConditions(SQLSubModel):
def generate_discharge(self, discharge: float, compute_height: bool):
profiles = self._reach.reach.profiles.copy()
if profiles is None:
return None
profiles.reverse()
previous_elevation = -99999.99
......@@ -443,9 +447,11 @@ class InitialConditions(SQLSubModel):
width = profile.width_approximation()
frictions = self._reach.frictions.frictions
strickler = None
for f in frictions:
if f.contains_rk(profile.rk):
strickler = f.get_friction(profile.rk)[0]
if frictions is not None:
if len(frictions) >= 1:
for f in frictions:
if f.contains_rk(profile.rk):
strickler = f.get_friction(profile.rk)[0]
if strickler is None:
strickler = 25.0
......
......@@ -994,6 +994,7 @@ class Mage8(Mage):
reachs = []
iprofiles = {}
profile_len = []
reach_offset = {}
data = read_int(2*nb_reach)
......@@ -1013,6 +1014,7 @@ class Mage8(Mage):
# Profile ID offset
reach_offset[r] = i1
profile_len.append(i2-i1+1)
logger.debug(f"read_bin: iprofiles = {iprofiles}")
......@@ -1041,6 +1043,13 @@ class Mage8(Mage):
]
def ip_to_ri(r, i): return i - reach_offset[r]
# check results and geometry consistency
for i, r in enumerate(reachs):
if len(r.profiles) != profile_len[i]:
logger.warning(f"geometry reach {i} has {len(r.profiles)} profiles")
logger.warning(f"results reach {i} has {profile_len[i]} values")
return
ts = set()
end = False
while not end:
......@@ -1050,7 +1059,7 @@ class Mage8(Mage):
f, dtype=np.byte, count=1)).decode()
data = read_float(n)
logger.debug(f"read_bin: timestamp = {timestamp} sec")
#logger.debug(f"read_bin: timestamp = {timestamp} sec")
ts.add(timestamp)
if key in ["Z", "Q"]:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment