|
|
|
|
@ -447,8 +447,8 @@ class SignalProcessingTab(QWidget):
|
|
|
|
|
# --------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
self.pushbutton_update.clicked.connect(self.update_SignalPreprocessingTab)
|
|
|
|
|
# self.pushbutton_update.clicked.connect(self.compute_average_profile_tail)
|
|
|
|
|
# self.pushbutton_update.clicked.connect(self.plot_averaged_profile_tail)
|
|
|
|
|
self.pushbutton_update.clicked.connect(self.compute_average_profile_tail)
|
|
|
|
|
self.pushbutton_update.clicked.connect(self.plot_averaged_profile_tail)
|
|
|
|
|
|
|
|
|
|
self.combobox_acoustic_data_choice.currentIndexChanged.connect(self.combobox_acoustic_data_choice_change_index)
|
|
|
|
|
|
|
|
|
|
@ -501,39 +501,26 @@ class SignalProcessingTab(QWidget):
|
|
|
|
|
- the user remove a file (in the list widget) in the first tab (Acoustic data), so that the combobox
|
|
|
|
|
of data to be processed is updated,
|
|
|
|
|
- the user change the limits of one or all the records in the first tab (Acoustic data) """
|
|
|
|
|
if len(stg.filename_BS_raw_data) == 0:
|
|
|
|
|
|
|
|
|
|
msgBox = QMessageBox()
|
|
|
|
|
msgBox.setWindowTitle("Compute noise from profile tail error")
|
|
|
|
|
msgBox.setIcon(QMessageBox.Warning)
|
|
|
|
|
msgBox.setText("Download acoustic data in previous tab before updating data")
|
|
|
|
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
|
|
|
|
msgBox.exec()
|
|
|
|
|
self.combobox_acoustic_data_choice.clear()
|
|
|
|
|
self.combobox_acoustic_data_choice.addItems(stg.filename_BS_raw_data)
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
if stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 0:
|
|
|
|
|
|
|
|
|
|
self.combobox_acoustic_data_choice.clear()
|
|
|
|
|
self.combobox_acoustic_data_choice.addItems(stg.filename_BS_raw_data)
|
|
|
|
|
self.groupbox_download_noise_file.setChecked(True)
|
|
|
|
|
self.groupbox_compute_noise_from_profile_tail.setChecked(False)
|
|
|
|
|
self.groupbox_download_noise_file_toggle()
|
|
|
|
|
|
|
|
|
|
if stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 0:
|
|
|
|
|
elif stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 1:
|
|
|
|
|
|
|
|
|
|
self.groupbox_download_noise_file.setChecked(True)
|
|
|
|
|
self.groupbox_compute_noise_from_profile_tail.setChecked(False)
|
|
|
|
|
self.groupbox_download_noise_file_toggle()
|
|
|
|
|
self.groupbox_download_noise_file.setChecked(False)
|
|
|
|
|
self.groupbox_compute_noise_from_profile_tail.setChecked(True)
|
|
|
|
|
self.groupbox_option_profile_tail_toggle()
|
|
|
|
|
|
|
|
|
|
elif stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 1:
|
|
|
|
|
self.combobox_freq_noise_from_profile_tail.clear()
|
|
|
|
|
self.combobox_freq_noise_from_profile_tail.addItems(stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()])
|
|
|
|
|
|
|
|
|
|
self.groupbox_download_noise_file.setChecked(False)
|
|
|
|
|
self.groupbox_compute_noise_from_profile_tail.setChecked(True)
|
|
|
|
|
self.groupbox_option_profile_tail_toggle()
|
|
|
|
|
|
|
|
|
|
self.combobox_freq_noise_from_profile_tail.clear()
|
|
|
|
|
self.combobox_freq_noise_from_profile_tail.addItems(stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()])
|
|
|
|
|
|
|
|
|
|
self.combobox_acoustic_data_choice.currentIndexChanged.connect(self.combobox_acoustic_data_choice_change_index)
|
|
|
|
|
|
|
|
|
|
self.compute_average_profile_tail()
|
|
|
|
|
self.plot_averaged_profile_tail()
|
|
|
|
|
self.combobox_acoustic_data_choice.currentIndexChanged.connect(self.combobox_acoustic_data_choice_change_index)
|
|
|
|
|
|
|
|
|
|
def activate_list_of_pre_processed_data(self):
|
|
|
|
|
for i in range(self.combobox_acoustic_data_choice.count()):
|
|
|
|
|
@ -667,65 +654,45 @@ class SignalProcessingTab(QWidget):
|
|
|
|
|
|
|
|
|
|
# --- Plot averaged signal ---
|
|
|
|
|
|
|
|
|
|
if len(stg.filename_BS_raw_data) == 0:
|
|
|
|
|
if stg.BS_mean[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
|
|
|
|
|
msgBox = QMessageBox()
|
|
|
|
|
msgBox.setWindowTitle("Compute noise from profile tail error")
|
|
|
|
|
msgBox.setIcon(QMessageBox.Warning)
|
|
|
|
|
msgBox.setText("Download acoustic data in previous tab before computing noise from profile tail")
|
|
|
|
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
|
|
|
|
msgBox.exec()
|
|
|
|
|
self.verticalLayout_groupbox_plot_profile_tail.removeWidget(self.canvas_profile_tail)
|
|
|
|
|
|
|
|
|
|
elif self.combobox_acoustic_data_choice.count() == 0:
|
|
|
|
|
self.fig_profile_tail, self.axis_profile_tail = plt.subplots(nrows=1, ncols=1, layout='constrained')
|
|
|
|
|
self.canvas_profile_tail = FigureCanvas(self.fig_profile_tail)
|
|
|
|
|
|
|
|
|
|
msgBox = QMessageBox()
|
|
|
|
|
msgBox.setWindowTitle("Compute noise from profile tail error")
|
|
|
|
|
msgBox.setIcon(QMessageBox.Warning)
|
|
|
|
|
msgBox.setText("Refresh acoustic data before computing noise from profile tail")
|
|
|
|
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
|
|
|
|
msgBox.exec()
|
|
|
|
|
self.verticalLayout_groupbox_plot_profile_tail.addWidget(self.canvas_profile_tail)
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
self.axis_profile_tail.plot(
|
|
|
|
|
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq_noise_from_profile_tail.currentIndex()],
|
|
|
|
|
stg.BS_mean[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq_noise_from_profile_tail.currentIndex()],
|
|
|
|
|
color="blue", linewidth=1)
|
|
|
|
|
self.axis_profile_tail.plot(
|
|
|
|
|
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
|
|
|
|
|
self.combobox_freq_noise_from_profile_tail.currentIndex()],
|
|
|
|
|
float(self.lineEdit_profile_tail_value.text().replace(",", ".")) *
|
|
|
|
|
np.ones(stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
|
|
|
|
|
self.combobox_freq_noise_from_profile_tail.currentIndex()].shape[0]),
|
|
|
|
|
linestyle='dashed', linewidth=2, color='red')
|
|
|
|
|
|
|
|
|
|
if stg.BS_mean[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
self.axis_profile_tail.set_yscale('log')
|
|
|
|
|
self.axis_profile_tail.tick_params(axis='both', labelsize=8)
|
|
|
|
|
self.axis_profile_tail.text(.98, .03, "Depth (m)",
|
|
|
|
|
fontsize=8, fontweight='bold', fontname="Ubuntu", c="black", alpha=0.9,
|
|
|
|
|
horizontalalignment='right', verticalalignment='bottom', rotation='horizontal',
|
|
|
|
|
transform=self.axis_profile_tail.transAxes)
|
|
|
|
|
self.axis_profile_tail.text(.1, .45, "BS signal (v)",
|
|
|
|
|
fontsize=8, fontweight='bold', fontname="Ubuntu", c="black", alpha=0.9,
|
|
|
|
|
horizontalalignment='right', verticalalignment='bottom', rotation='vertical',
|
|
|
|
|
transform=self.axis_profile_tail.transAxes)
|
|
|
|
|
self.axis_profile_tail.text(.98, .85,
|
|
|
|
|
stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()][
|
|
|
|
|
self.combobox_freq_noise_from_profile_tail.currentIndex()],
|
|
|
|
|
fontsize=10, fontweight='bold', fontname="Ubuntu", c="black", alpha=0.5,
|
|
|
|
|
horizontalalignment='right', verticalalignment='bottom',
|
|
|
|
|
transform=self.axis_profile_tail.transAxes)
|
|
|
|
|
|
|
|
|
|
self.verticalLayout_groupbox_plot_profile_tail.removeWidget(self.canvas_profile_tail)
|
|
|
|
|
|
|
|
|
|
self.fig_profile_tail, self.axis_profile_tail = plt.subplots(nrows=1, ncols=1, layout='constrained')
|
|
|
|
|
self.canvas_profile_tail = FigureCanvas(self.fig_profile_tail)
|
|
|
|
|
|
|
|
|
|
self.verticalLayout_groupbox_plot_profile_tail.addWidget(self.canvas_profile_tail)
|
|
|
|
|
|
|
|
|
|
self.axis_profile_tail.plot(
|
|
|
|
|
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq_noise_from_profile_tail.currentIndex()],
|
|
|
|
|
stg.BS_mean[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq_noise_from_profile_tail.currentIndex()],
|
|
|
|
|
color="blue", linewidth=1)
|
|
|
|
|
self.axis_profile_tail.plot(
|
|
|
|
|
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
|
|
|
|
|
self.combobox_freq_noise_from_profile_tail.currentIndex()],
|
|
|
|
|
float(self.lineEdit_profile_tail_value.text().replace(",", ".")) *
|
|
|
|
|
np.ones(stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
|
|
|
|
|
self.combobox_freq_noise_from_profile_tail.currentIndex()].shape[0]),
|
|
|
|
|
linestyle='dashed', linewidth=2, color='red')
|
|
|
|
|
|
|
|
|
|
self.axis_profile_tail.set_yscale('log')
|
|
|
|
|
self.axis_profile_tail.tick_params(axis='both', labelsize=8)
|
|
|
|
|
self.axis_profile_tail.text(.98, .03, "Depth (m)",
|
|
|
|
|
fontsize=8, fontweight='bold', fontname="Ubuntu", c="black", alpha=0.9,
|
|
|
|
|
horizontalalignment='right', verticalalignment='bottom', rotation='horizontal',
|
|
|
|
|
transform=self.axis_profile_tail.transAxes)
|
|
|
|
|
self.axis_profile_tail.text(.1, .45, "BS signal (v)",
|
|
|
|
|
fontsize=8, fontweight='bold', fontname="Ubuntu", c="black", alpha=0.9,
|
|
|
|
|
horizontalalignment='right', verticalalignment='bottom', rotation='vertical',
|
|
|
|
|
transform=self.axis_profile_tail.transAxes)
|
|
|
|
|
self.axis_profile_tail.text(.98, .85,
|
|
|
|
|
stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()][
|
|
|
|
|
self.combobox_freq_noise_from_profile_tail.currentIndex()],
|
|
|
|
|
fontsize=10, fontweight='bold', fontname="Ubuntu", c="black", alpha=0.5,
|
|
|
|
|
horizontalalignment='right', verticalalignment='bottom',
|
|
|
|
|
transform=self.axis_profile_tail.transAxes)
|
|
|
|
|
|
|
|
|
|
self.fig_profile_tail.canvas.draw_idle()
|
|
|
|
|
self.fig_profile_tail.canvas.draw_idle()
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
@ -755,87 +722,82 @@ class SignalProcessingTab(QWidget):
|
|
|
|
|
|
|
|
|
|
def clear_noise_data(self):
|
|
|
|
|
|
|
|
|
|
if len(stg.filename_BS_raw_data) == 0:
|
|
|
|
|
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.BS_noise_averaged_data[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.SNR_raw_data[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.SNR_cross_section[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.SNR_stream_bed[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.time_noise[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] = 0
|
|
|
|
|
stg.SNR_filter_value[self.combobox_acoustic_data_choice.currentIndex()] = 0
|
|
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
|
|
|
|
|
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.BS_noise_averaged_data[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.SNR_raw_data[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.SNR_cross_section[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.SNR_stream_bed[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.time_noise[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.SNR_filter_value[self.combobox_acoustic_data_choice.currentIndex()] = 0
|
|
|
|
|
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
|
|
|
|
|
stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
if stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 0:
|
|
|
|
|
self.lineEdit_noise_file.clear()
|
|
|
|
|
|
|
|
|
|
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
elif stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 1:
|
|
|
|
|
self.lineEdit_val1.clear()
|
|
|
|
|
self.lineEdit_val1.setText("0.00")
|
|
|
|
|
|
|
|
|
|
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = np.array([])
|
|
|
|
|
print("stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()]", stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()])
|
|
|
|
|
if stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 0:
|
|
|
|
|
self.lineEdit_noise_file.clear()
|
|
|
|
|
self.lineEdit_val2.clear()
|
|
|
|
|
self.lineEdit_val2.setText("0.00")
|
|
|
|
|
|
|
|
|
|
elif stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 1:
|
|
|
|
|
self.lineEdit_val1.clear()
|
|
|
|
|
self.lineEdit_val1.setText("0.00")
|
|
|
|
|
self.lineEdit_profile_tail_value.clear()
|
|
|
|
|
self.lineEdit_profile_tail_value.setText("0.0000")
|
|
|
|
|
|
|
|
|
|
self.lineEdit_val2.clear()
|
|
|
|
|
self.lineEdit_val2.setText("0.00")
|
|
|
|
|
self.verticalLayout_groupbox_plot_profile_tail.removeWidget(self.canvas_profile_tail)
|
|
|
|
|
self.canvas_profile_tail = FigureCanvas()
|
|
|
|
|
self.verticalLayout_groupbox_plot_profile_tail.addWidget(self.canvas_profile_tail)
|
|
|
|
|
|
|
|
|
|
self.lineEdit_profile_tail_value.clear()
|
|
|
|
|
self.lineEdit_profile_tail_value.setText("0.0000")
|
|
|
|
|
self.lineEdit_SNR_criterion.setText("0.00")
|
|
|
|
|
self.lineEdit_horizontal_average.setText("0.00")
|
|
|
|
|
|
|
|
|
|
self.verticalLayout_groupbox_plot_profile_tail.removeWidget(self.canvas_profile_tail)
|
|
|
|
|
self.canvas_profile_tail = FigureCanvas()
|
|
|
|
|
self.verticalLayout_groupbox_plot_profile_tail.addWidget(self.canvas_profile_tail)
|
|
|
|
|
# --- Clear SNR plot ---
|
|
|
|
|
self.verticalLayout_groupbox_plot_SNR.removeWidget(self.toolbar_SNR)
|
|
|
|
|
self.verticalLayout_groupbox_plot_SNR.removeWidget(self.scroll_SNR)
|
|
|
|
|
|
|
|
|
|
self.lineEdit_SNR_criterion.setText("0.00")
|
|
|
|
|
self.lineEdit_horizontal_average.setText("0.00")
|
|
|
|
|
self.canvas_SNR = FigureCanvas()
|
|
|
|
|
self.toolbar_SNR = NavigationToolBar(self.canvas_SNR, self)
|
|
|
|
|
self.scroll_SNR.setWidget(self.canvas_SNR)
|
|
|
|
|
|
|
|
|
|
# --- Clear SNR plot ---
|
|
|
|
|
self.verticalLayout_groupbox_plot_SNR.removeWidget(self.toolbar_SNR)
|
|
|
|
|
self.verticalLayout_groupbox_plot_SNR.removeWidget(self.scroll_SNR)
|
|
|
|
|
self.verticalLayout_groupbox_plot_SNR.addWidget(self.toolbar_SNR)
|
|
|
|
|
self.verticalLayout_groupbox_plot_SNR.addWidget(self.scroll_SNR)
|
|
|
|
|
|
|
|
|
|
self.canvas_SNR = FigureCanvas()
|
|
|
|
|
self.toolbar_SNR = NavigationToolBar(self.canvas_SNR, self)
|
|
|
|
|
self.scroll_SNR.setWidget(self.canvas_SNR)
|
|
|
|
|
# --- Clear BS plot ---
|
|
|
|
|
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field.removeWidget(self.toolbar_BS)
|
|
|
|
|
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field.removeWidget(self.scroll_BS)
|
|
|
|
|
|
|
|
|
|
self.verticalLayout_groupbox_plot_SNR.addWidget(self.toolbar_SNR)
|
|
|
|
|
self.verticalLayout_groupbox_plot_SNR.addWidget(self.scroll_SNR)
|
|
|
|
|
self.canvas_BS = FigureCanvas()
|
|
|
|
|
self.toolbar_BS = NavigationToolBar(self.canvas_BS, self)
|
|
|
|
|
self.scroll_BS.setWidget(self.canvas_BS)
|
|
|
|
|
|
|
|
|
|
# --- Clear BS plot ---
|
|
|
|
|
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field.removeWidget(self.toolbar_BS)
|
|
|
|
|
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field.removeWidget(self.scroll_BS)
|
|
|
|
|
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field.addWidget(self.toolbar_BS)
|
|
|
|
|
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field.addWidget(self.scroll_BS)
|
|
|
|
|
|
|
|
|
|
self.canvas_BS = FigureCanvas()
|
|
|
|
|
self.toolbar_BS = NavigationToolBar(self.canvas_BS, self)
|
|
|
|
|
self.scroll_BS.setWidget(self.canvas_BS)
|
|
|
|
|
self.combobox_frequency_profile.clear()
|
|
|
|
|
|
|
|
|
|
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field.addWidget(self.toolbar_BS)
|
|
|
|
|
self.verticalLayout_groupbox_plot_pre_processed_data_2D_field.addWidget(self.scroll_BS)
|
|
|
|
|
self.verticalLayout_groupbox_plot_profile.removeWidget(self.toolbar_profile)
|
|
|
|
|
self.verticalLayout_groupbox_plot_profile.removeWidget(self.canvas_profile)
|
|
|
|
|
|
|
|
|
|
self.combobox_frequency_profile.clear()
|
|
|
|
|
self.canvas_profile = FigureCanvas()
|
|
|
|
|
self.toolbar_profile = NavigationToolBar(self.canvas_profile, self)
|
|
|
|
|
|
|
|
|
|
self.verticalLayout_groupbox_plot_profile.removeWidget(self.toolbar_profile)
|
|
|
|
|
self.verticalLayout_groupbox_plot_profile.removeWidget(self.canvas_profile)
|
|
|
|
|
self.verticalLayout_groupbox_plot_profile.addWidget(self.toolbar_profile)
|
|
|
|
|
self.verticalLayout_groupbox_plot_profile.addWidget(self.canvas_profile)
|
|
|
|
|
|
|
|
|
|
self.canvas_profile = FigureCanvas()
|
|
|
|
|
self.toolbar_profile = NavigationToolBar(self.canvas_profile, self)
|
|
|
|
|
self.slider.setValue(1)
|
|
|
|
|
self.slider.setMaximum(10)
|
|
|
|
|
|
|
|
|
|
self.verticalLayout_groupbox_plot_profile.addWidget(self.toolbar_profile)
|
|
|
|
|
self.verticalLayout_groupbox_plot_profile.addWidget(self.canvas_profile)
|
|
|
|
|
|
|
|
|
|
self.slider.setValue(1)
|
|
|
|
|
self.slider.setMaximum(10)
|
|
|
|
|
|
|
|
|
|
self.slider.setValue(0)
|
|
|
|
|
self.slider.setMaximum(10)
|
|
|
|
|
self.slider.setValue(0)
|
|
|
|
|
self.slider.setMaximum(10)
|
|
|
|
|
|
|
|
|
|
def open_dialog_box(self):
|
|
|
|
|
|
|
|
|
|
@ -1259,19 +1221,11 @@ class SignalProcessingTab(QWidget):
|
|
|
|
|
|
|
|
|
|
def remove_point_with_snr_filter(self):
|
|
|
|
|
|
|
|
|
|
if len(stg.filename_BS_raw_data) == 0:
|
|
|
|
|
msgBox = QMessageBox()
|
|
|
|
|
msgBox.setWindowTitle("Compute noise from profile tail error")
|
|
|
|
|
msgBox.setIcon(QMessageBox.Warning)
|
|
|
|
|
msgBox.setText("Download acoustic data in previous tab before applying SNR filter")
|
|
|
|
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
|
|
|
|
msgBox.exec()
|
|
|
|
|
|
|
|
|
|
elif len(stg.BS_noise_raw_data) == 0:
|
|
|
|
|
if len(stg.BS_noise_raw_data) == 0:
|
|
|
|
|
msgBox = QMessageBox()
|
|
|
|
|
msgBox.setWindowTitle("SNR filter Error")
|
|
|
|
|
msgBox.setIcon(QMessageBox.Warning)
|
|
|
|
|
msgBox.setText("Define noise data (file or profile tail) before using SNR filter")
|
|
|
|
|
msgBox.setText("Load Noise data from acoustic data tab before using SNR filter")
|
|
|
|
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
|
|
|
|
msgBox.exec()
|
|
|
|
|
|
|
|
|
|
@ -1550,123 +1504,105 @@ class SignalProcessingTab(QWidget):
|
|
|
|
|
|
|
|
|
|
def compute_averaged_BS_data(self):
|
|
|
|
|
|
|
|
|
|
if len(stg.filename_BS_raw_data) == 0:
|
|
|
|
|
msgBox = QMessageBox()
|
|
|
|
|
msgBox.setWindowTitle("Compute noise from profile tail error")
|
|
|
|
|
msgBox.setIcon(QMessageBox.Warning)
|
|
|
|
|
msgBox.setText("Download acoustic data in previous tab before applying SNR filter")
|
|
|
|
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
|
|
|
|
msgBox.exec()
|
|
|
|
|
kernel_avg = np.ones(2 * int(float(self.lineEdit_horizontal_average.text().replace(",", "."))) + 1)
|
|
|
|
|
print(kernel_avg)
|
|
|
|
|
|
|
|
|
|
elif len(stg.BS_noise_raw_data) == 0:
|
|
|
|
|
msgBox = QMessageBox()
|
|
|
|
|
msgBox.setWindowTitle("SNR filter Error")
|
|
|
|
|
msgBox.setIcon(QMessageBox.Warning)
|
|
|
|
|
msgBox.setText("Define noise data (file or profile tail) before using SNR filter")
|
|
|
|
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
|
|
|
|
msgBox.exec()
|
|
|
|
|
stg.Nb_cells_to_average_BS_signal[self.combobox_acoustic_data_choice.currentIndex()] = (
|
|
|
|
|
float(self.lineEdit_horizontal_average.text().replace(",", ".")))
|
|
|
|
|
|
|
|
|
|
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,):
|
|
|
|
|
|
|
|
|
|
x_time = stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()]
|
|
|
|
|
y_depth = stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()]
|
|
|
|
|
|
|
|
|
|
elif stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
|
|
|
|
|
x_time = stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()]
|
|
|
|
|
y_depth = stg.depth[self.combobox_acoustic_data_choice.currentIndex()]
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
|
|
kernel_avg = np.ones(2 * int(float(self.lineEdit_horizontal_average.text().replace(",", "."))) + 1)
|
|
|
|
|
print(kernel_avg)
|
|
|
|
|
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
|
|
|
|
|
stg.Nb_cells_to_average_BS_signal[self.combobox_acoustic_data_choice.currentIndex()] = (
|
|
|
|
|
float(self.lineEdit_horizontal_average.text().replace(",", ".")))
|
|
|
|
|
x_time = stg.time[self.combobox_acoustic_data_choice.currentIndex()]
|
|
|
|
|
y_depth = stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()]
|
|
|
|
|
|
|
|
|
|
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
elif stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
|
|
|
|
|
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
x_time = stg.time[self.combobox_acoustic_data_choice.currentIndex()]
|
|
|
|
|
y_depth = stg.depth[self.combobox_acoustic_data_choice.currentIndex()]
|
|
|
|
|
|
|
|
|
|
x_time = stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()]
|
|
|
|
|
y_depth = stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()]
|
|
|
|
|
if stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
|
|
|
|
|
elif stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
|
|
|
|
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()]))
|
|
|
|
|
|
|
|
|
|
x_time = stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()]
|
|
|
|
|
y_depth = stg.depth[self.combobox_acoustic_data_choice.currentIndex()]
|
|
|
|
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
|
|
|
|
for i in range(y_depth.shape[1]):
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
|
|
|
|
convolve(stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][f, i, :],
|
|
|
|
|
kernel_avg))
|
|
|
|
|
|
|
|
|
|
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
elif stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
|
|
|
|
|
x_time = stg.time[self.combobox_acoustic_data_choice.currentIndex()]
|
|
|
|
|
y_depth = stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()]
|
|
|
|
|
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
|
|
|
|
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()]))
|
|
|
|
|
|
|
|
|
|
elif stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
|
|
|
|
for i in range(y_depth.shape[1]):
|
|
|
|
|
|
|
|
|
|
x_time = stg.time[self.combobox_acoustic_data_choice.currentIndex()]
|
|
|
|
|
y_depth = stg.depth[self.combobox_acoustic_data_choice.currentIndex()]
|
|
|
|
|
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
|
|
|
|
convolve(stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][f, i, :],
|
|
|
|
|
kernel_avg))
|
|
|
|
|
|
|
|
|
|
if stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
elif stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
|
|
|
|
|
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
|
|
|
|
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()]))
|
|
|
|
|
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
|
|
|
|
stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()]))
|
|
|
|
|
|
|
|
|
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
|
|
|
|
for i in range(y_depth.shape[1]):
|
|
|
|
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
|
|
|
|
for i in range(y_depth.shape[1]):
|
|
|
|
|
|
|
|
|
|
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
|
|
|
|
convolve(stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][f, i, :],
|
|
|
|
|
kernel_avg))
|
|
|
|
|
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
|
|
|
|
convolve(stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][f, i, :],
|
|
|
|
|
kernel_avg))
|
|
|
|
|
|
|
|
|
|
elif stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
elif stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
|
|
|
|
|
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
|
|
|
|
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()]))
|
|
|
|
|
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
|
|
|
|
stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()]))
|
|
|
|
|
|
|
|
|
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
|
|
|
|
for i in range(y_depth.shape[1]):
|
|
|
|
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
|
|
|
|
for i in range(y_depth.shape[1]):
|
|
|
|
|
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
|
|
|
|
convolve(stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][f, i, :], kernel_avg))
|
|
|
|
|
|
|
|
|
|
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
|
|
|
|
convolve(stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][f, i, :],
|
|
|
|
|
kernel_avg))
|
|
|
|
|
elif stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
|
|
|
|
|
elif stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
|
|
|
|
stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()]))
|
|
|
|
|
|
|
|
|
|
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
|
|
|
|
stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()]))
|
|
|
|
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
|
|
|
|
for i in range(y_depth.shape[1]):
|
|
|
|
|
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
|
|
|
|
convolve(stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][f, i, :],
|
|
|
|
|
kernel_avg))
|
|
|
|
|
|
|
|
|
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
|
|
|
|
for i in range(y_depth.shape[1]):
|
|
|
|
|
elif stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
|
|
|
|
|
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
|
|
|
|
convolve(stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][f, i, :],
|
|
|
|
|
kernel_avg))
|
|
|
|
|
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
|
|
|
|
stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()]))
|
|
|
|
|
|
|
|
|
|
elif stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
|
|
|
|
for i in range(y_depth.shape[1]):
|
|
|
|
|
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
|
|
|
|
convolve(stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()][f, i, :], kernel_avg))
|
|
|
|
|
|
|
|
|
|
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
|
|
|
|
stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()]))
|
|
|
|
|
|
|
|
|
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
|
|
|
|
for i in range(y_depth.shape[1]):
|
|
|
|
|
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
|
|
|
|
convolve(stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][f, i, :], kernel_avg))
|
|
|
|
|
|
|
|
|
|
elif stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
|
|
|
|
|
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
|
|
|
|
stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()]))
|
|
|
|
|
|
|
|
|
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
|
|
|
|
for i in range(y_depth.shape[1]):
|
|
|
|
|
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
|
|
|
|
convolve(stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][f, i, :],
|
|
|
|
|
kernel_avg))
|
|
|
|
|
|
|
|
|
|
elif stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
|
|
|
|
|
|
|
|
|
|
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = (deepcopy(
|
|
|
|
|
stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()]))
|
|
|
|
|
|
|
|
|
|
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]):
|
|
|
|
|
for i in range(y_depth.shape[1]):
|
|
|
|
|
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][f, i, :] = (
|
|
|
|
|
convolve(stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()][f, i, :], kernel_avg))
|
|
|
|
|
|
|
|
|
|
self.plot_pre_processed_BS_signal()
|
|
|
|
|
self.update_plot_pre_processed_profile()
|
|
|
|
|
self.plot_pre_processed_BS_signal()
|
|
|
|
|
self.update_plot_pre_processed_profile()
|
|
|
|
|
|
|
|
|
|
def plot_pre_processed_profile(self):
|
|
|
|
|
|
|
|
|
|
|