mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Merge: branch 'master' into 'scenarios'.
This commit is contained in:
commit
74ab3aa522
312 files changed
+82851
-9744
No files matched your search
@@ -350,6 +350,9 @@ class Reach(SQLSubModel):
|
||||
|
||||
def inter_profiles_rk(self):
|
||||
profiles = sorted(self.profiles, key=lambda p: p.rk)
|
||||
if len(profiles) == 0:
|
||||
return []
|
||||
|
||||
first = profiles[0]
|
||||
last = profiles[-1]
|
||||
|
||||
@@ -613,8 +616,8 @@ class Reach(SQLSubModel):
|
||||
|
||||
try:
|
||||
list_profile, list_header = self.read_file_st(str(file_path_name))
|
||||
profile_header = ["num", "code1",
|
||||
"code2", "nb_point", "rk", "name"]
|
||||
profile_header = ["num", "code1", "code2",
|
||||
"nb_point", "rk", "name"]
|
||||
|
||||
if list_profile and list_header:
|
||||
for ind, profile in enumerate(list_profile):
|
||||
@@ -687,6 +690,15 @@ class Reach(SQLSubModel):
|
||||
line_is_header = True
|
||||
else:
|
||||
list_point_profile.append(line)
|
||||
elif len(line) > 4:
|
||||
x, y, z = line[:3]
|
||||
if stop_code in x and stop_code in y:
|
||||
line_is_header = True
|
||||
list_profile.append(list_point_profile)
|
||||
list_point_profile = []
|
||||
else:
|
||||
line.append("")
|
||||
list_point_profile.append(line[:3])
|
||||
else:
|
||||
pass
|
||||
|
||||
@@ -721,6 +733,9 @@ class Reach(SQLSubModel):
|
||||
cnt += 1
|
||||
|
||||
def get_incline(self):
|
||||
if len(self.profiles) == 0:
|
||||
return 0.0
|
||||
|
||||
first = self.profile(0)
|
||||
last = self.profile(len(self) - 1)
|
||||
|
||||
@@ -738,6 +753,9 @@ class Reach(SQLSubModel):
|
||||
|
||||
def get_incline_mean(self):
|
||||
profiles = self.profiles
|
||||
if len(profiles) == 0:
|
||||
return 0.0
|
||||
|
||||
previous = profiles[0]
|
||||
|
||||
incline_acc = 0
|
||||
@@ -761,6 +779,9 @@ class Reach(SQLSubModel):
|
||||
|
||||
def get_incline_median(self):
|
||||
profiles = self.profiles
|
||||
if len(profiles) == 0:
|
||||
return 0.0
|
||||
|
||||
previous = profiles[0]
|
||||
|
||||
incline_acc = []
|
||||
@@ -785,6 +806,9 @@ class Reach(SQLSubModel):
|
||||
|
||||
def get_incline_median_mean(self):
|
||||
profiles = self.profiles
|
||||
if len(profiles) == 0:
|
||||
return 0.0
|
||||
|
||||
previous = profiles[0]
|
||||
|
||||
incline_acc = []
|
||||
@@ -796,6 +820,9 @@ class Reach(SQLSubModel):
|
||||
z_last = profile.z_min()
|
||||
rk_last = profile.rk
|
||||
|
||||
if (rk_last - rk_first) == 0:
|
||||
continue
|
||||
|
||||
incline_acc += [
|
||||
(z_last - z_first)
|
||||
/
|
||||
|
||||
Reference in new issue
Block a user