mirror of https://gitlab.com/pamhyr/pamhyr2
mean water depth
parent
04e5b61732
commit
61fce32c60
|
|
@ -494,6 +494,18 @@ class ProfileXYZ(Profile, SQLSubModel):
|
|||
|
||||
return lines
|
||||
|
||||
def max_water_depth(self, z):
|
||||
return z - self.z_min()
|
||||
|
||||
def mean_water_depth(self, z):
|
||||
a = self.wet_area(z)
|
||||
w = self.wet_width(z)
|
||||
|
||||
if w == 0:
|
||||
return 0
|
||||
|
||||
return a/w
|
||||
|
||||
def wet_polygon(self, z):
|
||||
points = self.wet_points(z)
|
||||
if len(points) < 3:
|
||||
|
|
|
|||
|
|
@ -96,10 +96,13 @@ class TableModel(PamhyrTableModel):
|
|||
z = self._lst[row].get_ts_key(self._timestamp, "Z")
|
||||
v = self._lst[row].geometry.wet_width(z)
|
||||
return f"{v:.4f}"
|
||||
elif self._headers[column] == "depth":
|
||||
elif self._headers[column] == "max_depth":
|
||||
z = self._lst[row].get_ts_key(self._timestamp, "Z")
|
||||
z_min = self._lst[row].geometry.z_min()
|
||||
v = z - z_min
|
||||
v = self._lst[row].geometry.max_water_depth(z)
|
||||
return f"{v:.4f}"
|
||||
elif self._headers[column] == "mean_depth":
|
||||
z = self._lst[row].get_ts_key(self._timestamp, "Z")
|
||||
v = self._lst[row].geometry.mean_water_depth(z)
|
||||
return f"{v:.4f}"
|
||||
elif self._headers[column] == "wet_area":
|
||||
z = self._lst[row].get_ts_key(self._timestamp, "Z")
|
||||
|
|
|
|||
|
|
@ -59,7 +59,8 @@ class ResultsTranslate(MainTranslate):
|
|||
"discharge": self._dict["unit_discharge"],
|
||||
"velocity": self._dict["unit_speed"],
|
||||
"width": self._dict["unit_width"],
|
||||
"depth": self._dict["unit_height"],
|
||||
"max_depth": self._dict["unit_max_height"],
|
||||
"mean_depth": self._dict["unit_mean_height"],
|
||||
"wet_area": self._dict["unit_wet_area"],
|
||||
"wet_perimeter": self._dict["unit_wet_perimeter"],
|
||||
"hydraulic_radius": self._dict["unit_hydraulic_radius"],
|
||||
|
|
|
|||
|
|
@ -54,7 +54,9 @@ class UnitTranslate(CommonWordTranslate):
|
|||
|
||||
self._dict["unit_rk"] = _translate("Unit", "River Kilometric (m)")
|
||||
self._dict["unit_width"] = _translate("Unit", "Width (m)")
|
||||
self._dict["unit_height"] = _translate("Unit", "Height (m)")
|
||||
self._dict["unit_height"] = _translate("Unit", "Depth (m)")
|
||||
self._dict["unit_max_height"] = _translate("Unit", "Max Depth (m)")
|
||||
self._dict["unit_mean_height"] = _translate("Unit", "Mean Depth (m)")
|
||||
self._dict["unit_diameter"] = _translate("Unit", "Diameter (m)")
|
||||
self._dict["unit_thickness"] = _translate("Unit", "Thickness (m)")
|
||||
self._dict["unit_elevation"] = _translate("Unit", "Elevation (m)")
|
||||
|
|
|
|||
Loading…
Reference in New Issue