From fbdbc7ac763af419757752e52a1cac6ec1a37d76 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby Date: Wed, 16 Apr 2025 15:15:44 +0200 Subject: [PATCH] Inversion: Minor change. --- View/acoustic_inversion_tab.py | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/View/acoustic_inversion_tab.py b/View/acoustic_inversion_tab.py index 1072728..d832341 100644 --- a/View/acoustic_inversion_tab.py +++ b/View/acoustic_inversion_tab.py @@ -486,7 +486,7 @@ class AcousticInversionTab(QWidget): msgBox.setText("Sediment sound attenuation is negative !") msgBox.setStandardButtons(QMessageBox.Ok) msgBox.exec() - elif isinf(stg.alpha_s[0]) or isinf(stg.alpha_s[1]): + elif isinf(stg.alpha_s[0]) or isinf(stg.alpha_s[1]): msgBox = QMessageBox() msgBox.setWindowTitle("Alpha computation error") msgBox.setIconPixmap( @@ -532,32 +532,22 @@ class AcousticInversionTab(QWidget): ) def compute_SSC_fine(self): - stg.SSC_fine[self.combobox_acoustic_data_choice.currentIndex()] = np.array([]) + data_id = self.combobox_acoustic_data_choice.currentIndex() - stg.SSC_fine[self.combobox_acoustic_data_choice.currentIndex()] = self.inv_hc.SSC_fine( + stg.SSC_fine[data_id] = np.array([]) + + stg.SSC_fine[data_id] = self.inv_hc.SSC_fine( zeta=stg.zeta[1], - r2D=stg.depth_2D[ - self.combobox_acoustic_data_choice.currentIndex() - ][ - stg.frequency_for_inversion[1] - ], - VBI=stg.VBI_cross_section[ - self.combobox_acoustic_data_choice.currentIndex() - ], + r2D=stg.depth_2D[data_id][stg.frequency_for_inversion[1]], + VBI=stg.VBI_cross_section[data_id], freq=stg.frequencies_for_calibration[1][0], X=stg.X_exponent[0], - j_cross_section=stg.J_cross_section[ - self.combobox_acoustic_data_choice.currentIndex() - ][1], + j_cross_section=stg.J_cross_section[data_id][1], alpha_w=np.full( - shape=stg.depth_2D[ - self.combobox_acoustic_data_choice.currentIndex() - ][ + shape=stg.depth_2D[data_id][ stg.frequency_for_inversion[1] ].shape, - fill_value=stg.water_attenuation[ - self.combobox_acoustic_data_choice.currentIndex() - ][ + fill_value=stg.water_attenuation[data_id][ stg.frequency_for_inversion[1] ] ) @@ -925,8 +915,6 @@ class AcousticInversionTab(QWidget): ) ) - # --- Plot fine SSC : measured vs inverted --- - def fill_combobox_fine_sample(self): data_id = self.combobox_acoustic_data_choice.currentIndex() @@ -1746,7 +1734,6 @@ class AcousticInversionTab(QWidget): else: depth_data = stg.depth - t = np.repeat( time_data[k][stg.frequency_for_inversion[1]], depth_data[k].shape[1]