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
platformdirs>=4.2.0
pyshp>=2.3.1
rasterio==1.3.11
#fortranformat==2.0.3

View File

@ -51,7 +51,8 @@ class CoordinatesDialog(PamhyrDialog):
def setup_connections(self):
for t in self._values:
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):
self.spinbox[t].setValue(self._values[t])

View File

@ -148,10 +148,10 @@ class PlotAC(PamhyrPlot):
gl = profile.geometry.names()
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)
lincomplete = list(self.incomplete_gl)
lcomplete = list(self.cgl)
lincomplete = list(self.igl)
self.color_complete_gl = self.colors
self.color_incomplete_gl = 2 * ["grey"]
@ -165,7 +165,7 @@ class PlotAC(PamhyrPlot):
if txt == "":
continue
if txt.strip() in self.complete_gl:
if txt.strip() in self.cgl:
color = 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.))
self.annotation.append(annotation)
if txt.strip() in self.complete_gl:
if txt.strip() in self.cgl:
x_gl_complete.append(station[i])
y_gl_complete.append(elevation[i])
else:

View File

@ -1193,7 +1193,8 @@ class ResultsWindow(PamhyrWindow):
# b[2] right
# b[3] top
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:
dlg = CoordinatesDialog(
self.canvas.axes.get_xlim(),
@ -1202,7 +1203,6 @@ class ResultsWindow(PamhyrWindow):
parent=self
)
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()