Merge branch 'dev-parouby' into dev

This commit is contained in:
parouby committed 2025-03-26 15:33:17 +01:00
commit 883d43adb4
10 files changed
+341 -257

No files matched your search

+16 -4
View File
@@ -59,6 +59,7 @@ from Model.acoustic_data_loader import AcousticDataLoader
from Model.acoustic_data_loader_UBSediFlow import AcousticDataLoaderUBSediFlow
from Model.calibration_constant_kt import CalibrationConstantKt
from tools import trace
locale.setlocale(locale.LC_ALL, '')
@@ -733,6 +734,7 @@ class AcousticDataTab(QWidget):
# -------------------- Functions for Acoustic dataTab --------------------
@trace
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)
@@ -842,7 +844,6 @@ class AcousticDataTab(QWidget):
self.groupbox_measurement_information_UBSediFlow()
def groupbox_measurement_information_no_ABS(self):
self.label_ABS_name.hide()
self.combobox_ABS_name.hide()
@@ -1190,15 +1191,22 @@ class AcousticDataTab(QWidget):
self.lineEdit_distance_from_ABS_to_free_surface.setText("0.00")
else:
stg.distance_from_ABS_to_free_surface[self.fileListWidget\
.currentRow()] = (
stg.distance_from_ABS_to_free_surface[
self.fileListWidget.currentRow()
] = (
float(
self.lineEdit_distance_from_ABS_to_free_surface\
.text().replace(",", ".")
)
)
self.lineEdit_distance_from_ABS_to_free_surface.setText(
str("%4s" % stg.distance_from_ABS_to_free_surface[self.fileListWidget.currentRow()]))
str(
"%4s" % stg.distance_from_ABS_to_free_surface[
self.fileListWidget.currentRow()
]
)
)
def refresh_distance_from_ABS_to_free_surface(self):
self.pushbutton_distance_from_ABS_to_free_surface.blockSignals(True)
@@ -1777,6 +1785,10 @@ class AcousticDataTab(QWidget):
.currentIndexChanged\
.connect(self.combobox_frequency_information_update)
self.lineEdit_distance_from_ABS_to_free_surface.setText(
str(stg.distance_from_ABS_to_free_surface[file_id])
)
logger.debug(f"Set temperature = {stg.temperature}")
self.lineEdit_temperature.setText(str(stg.temperature))
+2
View File
@@ -48,6 +48,7 @@ from View.checkable_combobox import CheckableComboBox
import settings as stg
from Model.acoustic_inversion_method_high_concentration import AcousticInversionMethodHighConcentration
from tools import trace
_translate = QCoreApplication.translate
@@ -371,6 +372,7 @@ class AcousticInversionTab(QWidget):
# ------------------------------------ Functions for Acoustic Inversion Tab ----------------------------------------
# ==================================================================================================================
@trace
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)
+3 -1
View File
@@ -10,6 +10,8 @@ from PyQt5.QtCore import Qt
import settings as stg
from tools import trace
logger = logging.getLogger("acoused")
class NoteTab(QWidget):
@@ -136,7 +138,7 @@ class NoteTab(QWidget):
## ---------- Functions ----------
## -------------------------------
@trace
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)
+7 -2
View File
@@ -49,6 +49,8 @@ import Translation.constant_string as cs
import settings as stg
from tools import trace
_translate = QCoreApplication.translate
logger = logging.getLogger("acoused")
@@ -278,6 +280,7 @@ class SampleDataTab(QWidget):
self.groupbox_plot_PSD.setTitle(_translate("CONSTANT_STRING", cs.DISTRIBUTION_PLOT))
@trace
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)
@@ -475,7 +478,8 @@ class SampleDataTab(QWidget):
self.item_checkbox_fine.setCheckState(Qt.Checked)
self.tableWidget_fine.setItem(i, 1, self.item_checkbox_fine)
self.item_checkbox_fine.setText("F" + str(i + 1))
stg.sample_fine.append(("F" + str(i + 1), i))
if len(stg.sample_fine) <= i:
stg.sample_fine.append(("F" + str(i + 1), i))
# --- Fill table with data ---
for i in range(stg.frac_vol_fine.shape[0]):
@@ -570,7 +574,8 @@ class SampleDataTab(QWidget):
self.item_checkbox_sand.setCheckState(Qt.Checked)
self.tableWidget_sand.setItem(i, 1, self.item_checkbox_sand)
self.item_checkbox_sand.setText("S" + str(i + 1))
stg.sample_sand.append(("S" + str(i + 1), i))
if len(stg.sample_sand) <= i:
stg.sample_sand.append(("S" + str(i + 1), i))
# --- Fill table with data ---
for i in range(stg.frac_vol_sand.shape[0]):
+152 -152
View File
@@ -48,6 +48,8 @@ import settings as stg
from View.checkable_combobox import CheckableComboBox
from Model.acoustic_inversion_method_high_concentration import AcousticInversionMethodHighConcentration
from tools import trace
logger = logging.getLogger("acoused")
class SedimentCalibrationTab(QWidget):
@@ -857,6 +859,7 @@ class SedimentCalibrationTab(QWidget):
# ----------------------------------- Functions for Signal processing Tab --------------------------------------
# ==============================================================================================================
@trace
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)
@@ -873,7 +876,7 @@ class SedimentCalibrationTab(QWidget):
return
self.update_acoustic_data()
# self.compute_depth_2D()
self.compute_depth_2D()
def update_acoustic_data(self):
self.combobox_acoustic_data_choice.clear()
@@ -931,11 +934,13 @@ class SedimentCalibrationTab(QWidget):
self.compute_FCB()
def plot_acoustic_recording(self):
data_id = self.combobox_acoustic_data_choice.currentIndex()
# --- Record frequencies for calibration ---
stg.frequencies_for_calibration.clear()
stg.frequencies_for_calibration.append(
(
stg.freq[self.combobox_acoustic_data_choice.currentIndex()][
stg.freq[data_id][
self.combobox_freq1.currentIndex()
],
self.combobox_freq1.currentIndex()
@@ -943,7 +948,7 @@ class SedimentCalibrationTab(QWidget):
)
stg.frequencies_for_calibration.append(
(
stg.freq[self.combobox_acoustic_data_choice.currentIndex()][
stg.freq[data_id][
self.combobox_freq2.currentIndex()
],
self.combobox_freq2.currentIndex()
@@ -952,7 +957,7 @@ class SedimentCalibrationTab(QWidget):
stg.frequency_for_inversion = tuple()
stg.frequency_for_inversion = (
stg.freq[self.combobox_acoustic_data_choice.currentIndex()][
stg.freq[data_id][
self.combobox_freq2.currentIndex()
],
self.combobox_freq2.currentIndex()
@@ -970,18 +975,18 @@ class SedimentCalibrationTab(QWidget):
self.verticalLayout_groupbox_data_plot.addWidget(self.canvas_BS)
if stg.BS_stream_bed_pre_process_average[
self.combobox_acoustic_data_choice.currentIndex()
data_id
].shape != (0,):
val_min = np.nanmin(
stg.BS_stream_bed_pre_process_average[
self.combobox_acoustic_data_choice.currentIndex()
data_id
][
self.combobox_freq2.currentIndex(), :, :
]
)
val_max = np.nanmax(
stg.BS_stream_bed_pre_process_average[
self.combobox_acoustic_data_choice.currentIndex()
data_id
][
self.combobox_freq2.currentIndex(), :, :
]
@@ -989,346 +994,346 @@ class SedimentCalibrationTab(QWidget):
if val_min == 0:
val_min = 1e-5
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.time_cross_section[data_id].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
elif stg.BS_stream_bed_pre_process_SNR[data_id].shape != (0,):
val_min = np.nanmin(
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :])
val_max = np.nanmax(
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.time_cross_section[data_id].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
elif stg.BS_stream_bed[data_id].shape != (0,):
val_min = np.nanmin(
stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(),
stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(),
:, :])
val_max = np.nanmax(
stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(),
stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(),
:, :])
if val_min == 0:
val_min = 1e-5
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.time_cross_section[data_id].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(),
stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(),
:, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(),
stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(),
:, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(),
stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(),
:, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(),
stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(),
:, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
elif stg.BS_cross_section_pre_process_average[data_id].shape != (0,):
val_min = np.nanmin(
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :])
val_max = np.nanmax(
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.time_cross_section[data_id].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
elif stg.BS_cross_section_pre_process_SNR[data_id].shape != (0,):
val_min = np.nanmin(
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :])
val_max = np.nanmax(
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0):
if stg.time_cross_section[data_id].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0):
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0):
if stg.depth_cross_section[data_id].shape != (0):
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
elif stg.BS_cross_section[data_id].shape != (0,):
val_min = np.nanmin(
stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section[data_id][
self.combobox_freq2.currentIndex(), :, :])
val_max = np.nanmax(
stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section[data_id][
self.combobox_freq2.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.time_cross_section[data_id].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
elif stg.BS_raw_data_pre_process_average[data_id].shape != (0,):
val_min = np.nanmin(stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
val_min = np.nanmin(stg.BS_raw_data_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
val_max = np.nanmax(stg.BS_raw_data_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :],
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][self.combobox_freq2.currentIndex(), :],
-stg.depth[data_id][self.combobox_freq2.currentIndex(), :],
stg.BS_raw_data_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
elif stg.BS_raw_data_pre_process_SNR[data_id].shape != (0,):
val_min = np.nanmin(stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
val_min = np.nanmin(stg.BS_raw_data_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
val_max = np.nanmax(stg.BS_raw_data_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :],
stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][self.combobox_freq2.currentIndex(), :],
-stg.depth[data_id][self.combobox_freq2.currentIndex(), :],
stg.BS_raw_data_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
elif stg.BS_raw_data[data_id].shape != (0,):
val_min = np.nanmin(stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()][
val_min = np.nanmin(stg.BS_raw_data[data_id][
self.combobox_freq2.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()][
val_max = np.nanmax(stg.BS_raw_data[data_id][
self.combobox_freq2.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :],
stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][self.combobox_freq2.currentIndex(), :],
-stg.depth[data_id][self.combobox_freq2.currentIndex(), :],
stg.BS_raw_data[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
@@ -1367,16 +1372,16 @@ class SedimentCalibrationTab(QWidget):
# --- Plot vertical red line for position of FCB profile ---
if stg.sand_sample_target_indice:
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.time_cross_section[data_id].shape != (0,):
self.red_line_plot_return, = (
self.axis_BS.plot(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), stg.sand_sample_target_indice[0][1]] *
np.ones(stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape[1]),
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
np.ones(stg.depth_cross_section[data_id].shape[1]),
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
color='red', linestyle="solid", linewidth=2))
@@ -1384,23 +1389,23 @@ class SedimentCalibrationTab(QWidget):
self.red_line_plot_return, = (
self.axis_BS.plot(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), stg.sand_sample_target_indice[0][1]] *
np.ones(stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape[1]),
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
np.ones(stg.depth_cross_section[data_id].shape[1]),
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
color='red', linestyle="solid", linewidth=2))
else:
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.time_cross_section[data_id].shape != (0,):
self.red_line_plot_return, = (
self.axis_BS.plot(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), stg.sand_sample_target_indice[0][1]] *
np.ones(stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape[1]),
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
np.ones(stg.depth[data_id].shape[1]),
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
color='red', linestyle="solid", linewidth=2))
@@ -1408,10 +1413,10 @@ class SedimentCalibrationTab(QWidget):
self.red_line_plot_return, = (
self.axis_BS.plot(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), stg.sand_sample_target_indice[0][1]] *
np.ones(stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape[1]),
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
np.ones(stg.depth[data_id].shape[1]),
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
color='red', linestyle="solid", linewidth=2))
@@ -1941,13 +1946,12 @@ class SedimentCalibrationTab(QWidget):
def compute_depth_2D(self):
if self.combobox_acoustic_data_choice.count() > 0:
for k in range(self.combobox_acoustic_data_choice.count()):
while len(stg.depth_2D) <= k:
stg.depth_2D.append(np.array([]))
if stg.depth_cross_section[k].shape != (0,):
if stg.time_cross_section[k].shape != (0,):
stg.depth_2D[k] = (
np.zeros((stg.freq[k].shape[0],
stg.depth_cross_section[k].shape[1],
@@ -1961,7 +1965,6 @@ class SedimentCalibrationTab(QWidget):
axis=1))
elif stg.time[k].shape != (0,):
stg.depth_2D[k] = (
np.zeros((stg.freq[k].shape[0],
stg.depth_cross_section[k].shape[1],
@@ -1976,9 +1979,7 @@ class SedimentCalibrationTab(QWidget):
axis=1))
elif stg.depth[k].shape != (0,):
if stg.time_cross_section[k].shape != (0,):
stg.depth_2D[k] = (
np.zeros((stg.freq[k].shape[0],
stg.depth[k].shape[1],
@@ -1993,7 +1994,6 @@ class SedimentCalibrationTab(QWidget):
axis=1))
elif stg.time[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
stg.depth_2D[k] = (
np.zeros((stg.freq[k].shape[0],
stg.depth[k].shape[1],
+1
View File
@@ -511,6 +511,7 @@ class SignalProcessingTab(QWidget):
self.icon_clear = QIcon(path_icon("clear.png"))
self.icon_apply = QIcon(path_icon("circle_green_arrow_right.png"))
@trace
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)