Signal processing: Fix open study file crash.

This commit is contained in:
parouby committed 2025-03-24 13:50:13 +01:00
1 parent 413e8fb18e
commit 0cd9964594
4 files changed
+45 -30

No files matched your search

+2 -2
View File
@@ -1653,9 +1653,9 @@ class AcousticDataTab(QWidget):
stg.gain_tx.append(acoustic_data._gain_tx)
stg.water_attenuation.append([])
# --- The other acoustic variables lists are filled with empty object. ---
# --- They will be used for pre- and post-processing ---
self.initiate_setting_parameters_new_others()
def initiate_setting_parameters_new_others(self):
stg.BS_cross_section.append(np.array([]))
stg.depth_cross_section.append(np.array([]))
stg.time_cross_section.append(np.array([]))
+15 -8
View File
@@ -521,15 +521,12 @@ class SignalProcessingTab(QWidget):
self.blockSignals(True)
self.combobox_acoustic_data_choice.blockSignals(True)
self.combobox_acoustic_data_choice.addItems(stg.filename_BS_raw_data)
# self.recompute()
# self.replot()
self.update_SignalPreprocessingTab(recompute=True)
self.combobox_acoustic_data_choice.blockSignals(False)
self.blockSignals(False)
def update_SignalPreprocessingTab(self):
def update_SignalPreprocessingTab(self, recompute=True):
""" The tab is updated in two cases :
- the user remove a file (in the list widget) in the first tab (Acoustic data), so that the combobox
@@ -567,7 +564,9 @@ class SignalProcessingTab(QWidget):
stg.freq_text[data_id]
)
self.recompute()
if recompute:
self.recompute()
self.replot()
logger.debug("Update the Signal preprocessing tab... Done")
@@ -795,9 +794,17 @@ class SignalProcessingTab(QWidget):
self.compute_average_profile_tail()
self.lineEdit_SNR_criterion.setText(str(stg.SNR_filter_value[self.combobox_acoustic_data_choice.currentIndex()]))
self.lineEdit_SNR_criterion.setText(
str(stg.SNR_filter_value[
self.combobox_acoustic_data_choice.currentIndex()
])
)
self.lineEdit_horizontal_average.setText(str(stg.Nb_cells_to_average_BS_signal[self.combobox_acoustic_data_choice.currentIndex()]))
self.lineEdit_horizontal_average.setText(
str(stg.Nb_cells_to_average_BS_signal[
self.combobox_acoustic_data_choice.currentIndex()
])
)
self.combobox_frequency_profile.clear()
self.combobox_frequency_profile.addItems(