Acoustic data: Minor refacto.
parent
f23dceb42b
commit
ff39ad0536
|
|
@ -2314,83 +2314,41 @@ class AcousticDataTab(QWidget):
|
||||||
''' rmin and rmax are updated with double slider of depth '''
|
''' rmin and rmax are updated with double slider of depth '''
|
||||||
data_id = self.fileListWidget.currentRow()
|
data_id = self.fileListWidget.currentRow()
|
||||||
|
|
||||||
|
round_depth = np.round(stg.depth[data_id][0, :], 2)
|
||||||
|
depth_max = float(
|
||||||
|
"".join(
|
||||||
|
findall(
|
||||||
|
"[.0-9]",
|
||||||
|
self.lineEdit_depth_max_limits.text()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
depth_min = float(
|
||||||
|
"".join(
|
||||||
|
findall(
|
||||||
|
"[.0-9]",
|
||||||
|
self.lineEdit_depth_min_limits.text()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
diff_max = np.abs(round_depth - depth_max)
|
||||||
|
diff_min = np.abs(round_depth - depth_min)
|
||||||
|
|
||||||
stg.rmin[data_id] = ((
|
stg.rmin[data_id] = ((
|
||||||
np.where(
|
np.where(diff_max == np.nanmin(diff_max))[0][0]+1,
|
||||||
np.abs(
|
depth_max
|
||||||
np.round(
|
|
||||||
stg.depth[data_id][0, :], 2
|
|
||||||
) - float(
|
|
||||||
"".join(
|
|
||||||
findall(
|
|
||||||
"[.0-9]",
|
|
||||||
self.lineEdit_depth_max_limits.text()
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
) == np.nanmin(
|
|
||||||
np.abs(
|
|
||||||
np.round(stg.depth[data_id][0, :], 2)
|
|
||||||
- float(
|
|
||||||
"".join(
|
|
||||||
findall(
|
|
||||||
"[.0-9]",
|
|
||||||
self.lineEdit_depth_max_limits.text()
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)[0][0]+1,
|
|
||||||
float(
|
|
||||||
"".join(
|
|
||||||
findall(
|
|
||||||
"[.0-9]",
|
|
||||||
self.lineEdit_depth_max_limits.text()
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
))
|
))
|
||||||
|
|
||||||
stg.rmax[data_id] = ((
|
stg.rmax[data_id] = ((
|
||||||
np.where(
|
np.where(diff_min == np.nanmin(diff_min))[0][0],
|
||||||
np.abs(
|
depth_min
|
||||||
np.round(
|
|
||||||
stg.depth[data_id][0, :], 2
|
|
||||||
) - float(
|
|
||||||
"".join(
|
|
||||||
findall(
|
|
||||||
"[.0-9]",
|
|
||||||
self.lineEdit_depth_min_limits.text()
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
) == np.nanmin(
|
|
||||||
np.abs(
|
|
||||||
np.round(stg.depth[data_id][0, :], 2)
|
|
||||||
- float(
|
|
||||||
"".join(
|
|
||||||
findall(
|
|
||||||
"[.0-9]",
|
|
||||||
self.lineEdit_depth_min_limits.text()
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)[0][0],
|
|
||||||
float(
|
|
||||||
"".join(
|
|
||||||
findall(
|
|
||||||
"[.0-9]",
|
|
||||||
self.lineEdit_depth_min_limits.text()
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
))
|
))
|
||||||
|
|
||||||
stg.depth_cross_section[data_id] = (
|
stg.depth_cross_section[data_id] = (
|
||||||
stg.depth[data_id][:,
|
stg.depth[data_id][
|
||||||
stg.rmin[data_id][0]:stg.rmax[data_id][0]]
|
:, stg.rmin[data_id][0]:stg.rmax[data_id][0]
|
||||||
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
def compute_BS_cross_section(self):
|
def compute_BS_cross_section(self):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue