mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Results: Update plot XY and add overflow on this plot.
This commit is contained in:
1 parent
6055065e27
commit
aeae8fb710
4 files changed
+218
-118
No files matched your search
@@ -489,46 +489,52 @@ class ProfileXYZ(Profile, SQLSubModel):
|
||||
# niveau d'eau pour lequel on a obtenu irg, ird, ptX et ptY
|
||||
# ====================================================================
|
||||
|
||||
# initialisation
|
||||
irg = -1
|
||||
ird = -1
|
||||
|
||||
# Get the index of last point with elevation lesser than water
|
||||
# level (for the right and left river side)
|
||||
i_left = -1
|
||||
i_right = -1
|
||||
|
||||
for i in range(self.number_points):
|
||||
if self.point(i).z <= z:
|
||||
irg = i
|
||||
i_left = i
|
||||
break
|
||||
|
||||
for i in reversed(range(self.number_points)):
|
||||
if self.point(i).z <= z:
|
||||
ird = i
|
||||
i_right = i
|
||||
break
|
||||
|
||||
# interpolation des points ptX et ptY
|
||||
if (irg < self.number_points - 1):
|
||||
# Interpolate points at river left side
|
||||
if (i_left > 0):
|
||||
x = np.interp(
|
||||
z,
|
||||
[self.point(irg).z, self.point(irg + 1).z],
|
||||
[self.point(irg).x, self.point(irg + 1).x]
|
||||
[self.point(i_left).z, self.point(i_left - 1).z],
|
||||
[self.point(i_left).x, self.point(i_left - 1).x]
|
||||
)
|
||||
y = np.interp(
|
||||
z,
|
||||
[self.point(irg).z, self.point(irg + 1).z],
|
||||
[self.point(irg).y, self.point(irg + 1).y]
|
||||
[self.point(i_left).z, self.point(i_left - 1).z],
|
||||
[self.point(i_left).y, self.point(i_left - 1).y]
|
||||
)
|
||||
ptX = PointXYZ(x, y, z)
|
||||
pt_left = PointXYZ(x, y, z)
|
||||
else:
|
||||
ptX = self.point(0)
|
||||
if (ird > 0):
|
||||
pt_left = self.point(0)
|
||||
|
||||
# Interpolate points at river right side
|
||||
if (i_right < self.number_points - 1):
|
||||
x = np.interp(
|
||||
z,
|
||||
[self.point(ird-1).z, self.point(ird).z],
|
||||
[self.point(ird-1).x, self.point(ird).x]
|
||||
[self.point(i_right).z, self.point(i_right + 1).z],
|
||||
[self.point(i_right).x, self.point(i_right + 1).x]
|
||||
)
|
||||
y = np.interp(
|
||||
z,
|
||||
[self.point(ird).z, self.point(ird - 1).z],
|
||||
[self.point(ird).y, self.point(ird - 1).y]
|
||||
[self.point(i_right).z, self.point(i_right + 1).z],
|
||||
[self.point(i_right).y, self.point(i_right + 1).y]
|
||||
)
|
||||
ptY = PointXYZ(x, y, z)
|
||||
pt_right = PointXYZ(x, y, z)
|
||||
else:
|
||||
ptY = self.point(self.number_points - 1)
|
||||
pt_right = self.point(self.number_points - 1)
|
||||
|
||||
return ptX, ptY
|
||||
return pt_left, pt_right
|
||||
Reference in new issue
Block a user