terraz_dev
Theophile Terraz 2025-06-10 09:10:58 +02:00
parent 400f6be9e3
commit c702862bc4
6 changed files with 24 additions and 21 deletions

View File

@ -12,3 +12,5 @@ shapely>=2.0.1
lxml>=4.9.3 lxml>=4.9.3
platformdirs>=4.2.0 platformdirs>=4.2.0
pyshp>=2.3.1 pyshp>=2.3.1
rasterio==1.3.11
#fortranformat==2.0.3

View File

@ -398,13 +398,13 @@ class InitialConditions(SQLSubModel):
discharge = data_discharge[profile.rk] discharge = data_discharge[profile.rk]
else: else:
discharge = ( discharge = (
#((width * 0.8) # ((width * 0.8)
#* strickler # * strickler
#* (height ** (5/3)) # * (height ** (5/3))
#* (abs(incline) ** (0.5))) # * (abs(incline) ** (0.5)))
(area * strickler (area * strickler
* (radius ** (2/3)) * (radius ** (2/3))
* (abs(incline) ** (0.5))) * (abs(incline) ** (0.5)))
) )
elevation = max( elevation = max(

View File

@ -372,12 +372,12 @@ class EditBoundaryConditionWindow(PamhyrWindow):
if strickler is None: if strickler is None:
strickler = 25.0 strickler = 25.0
height = [(i)*(z_max-z_min)/50 for i in range(51)] height = [(i)*(z_max-z_min)/50 for i in range(51)]
#q = [((profile.wet_width(z_min + h) * 0.8) * strickler # q = [((profile.wet_width(z_min + h) * 0.8) * strickler
#* (h ** (5/3)) * (abs(self.slope_value) ** (0.5))) # * (h ** (5/3)) * (abs(self.slope_value) ** (0.5)))
#for h in height] # for h in height]
q = [profile.wet_area(z_min + h) * strickler q = [profile.wet_area(z_min + h) * strickler
* (profile.wet_radius(z_min + h) ** (2/3)) * (profile.wet_radius(z_min + h) ** (2/3))
* (abs(self.slope_value) ** (0.5)) * (abs(self.slope_value) ** (0.5))
for h in height] for h in height]
for i in range(len(height)): for i in range(len(height)):
height[i] += z_min height[i] += z_min

View File

@ -51,7 +51,8 @@ class CoordinatesDialog(PamhyrDialog):
def setup_connections(self): def setup_connections(self):
for t in self._values: for t in self._values:
self.find(QPushButton, self.find(QPushButton,
f"pushButton_{t}").clicked.connect(lambda state, x=t: self.reset(x)) f"pushButton_{t}").clicked.connect(
lambda state, x=t: self.reset(x))
def reset(self, t): def reset(self, t):
self.spinbox[t].setValue(self._values[t]) self.spinbox[t].setValue(self._values[t])

View File

@ -148,10 +148,10 @@ class PlotAC(PamhyrPlot):
gl = profile.geometry.names() gl = profile.geometry.names()
self.annotation = [] self.annotation = []
self.complete_gl, self.incomplete_gl = reach.geometry.compute_guidelines() self.cgl, self.igl = reach.geometry.compute_guidelines()
lcomplete = list(self.complete_gl) lcomplete = list(self.cgl)
lincomplete = list(self.incomplete_gl) lincomplete = list(self.igl)
self.color_complete_gl = self.colors self.color_complete_gl = self.colors
self.color_incomplete_gl = 2 * ["grey"] self.color_incomplete_gl = 2 * ["grey"]
@ -165,7 +165,7 @@ class PlotAC(PamhyrPlot):
if txt == "": if txt == "":
continue continue
if txt.strip() in self.complete_gl: if txt.strip() in self.cgl:
color = self.color_complete_gl[ color = self.color_complete_gl[
lcomplete.index(txt) % len(self.color_complete_gl) lcomplete.index(txt) % len(self.color_complete_gl)
] ]
@ -185,7 +185,7 @@ class PlotAC(PamhyrPlot):
annotation.set_position((station[i] + 0., elevation[i] + 0.)) annotation.set_position((station[i] + 0., elevation[i] + 0.))
self.annotation.append(annotation) self.annotation.append(annotation)
if txt.strip() in self.complete_gl: if txt.strip() in self.cgl:
x_gl_complete.append(station[i]) x_gl_complete.append(station[i])
y_gl_complete.append(elevation[i]) y_gl_complete.append(elevation[i])
else: else:

View File

@ -1193,7 +1193,8 @@ class ResultsWindow(PamhyrWindow):
# b[2] right # b[2] right
# b[3] top # b[3] top
if b[2] > b[0] and b[1] < b[3]: if b[2] > b[0] and b[1] < b[3]:
self.canvas.axes.imshow(img.transpose((1, 2, 0)), extent=[b[0], b[2], b[1], b[3]]) self.canvas.axes.imshow(img.transpose((1, 2, 0)),
extent=[b[0], b[2], b[1], b[3]])
else: else:
dlg = CoordinatesDialog( dlg = CoordinatesDialog(
self.canvas.axes.get_xlim(), self.canvas.axes.get_xlim(),
@ -1202,7 +1203,6 @@ class ResultsWindow(PamhyrWindow):
parent=self parent=self
) )
if dlg.exec(): if dlg.exec():
self.canvas.axes.imshow(img.transpose((1, 2, 0)), extent=dlg.values) self.canvas.axes.imshow(img.transpose((1, 2, 0)),
extent=dlg.values)
self.plot_xy.idle() self.plot_xy.idle()