From 5ec2d0f97f8e626ab2f0934ae83509e156ff4185 Mon Sep 17 00:00:00 2001 From: brahim Date: Thu, 14 Nov 2024 16:15:18 +0100 Subject: [PATCH] stg.range_lin_interp and stg.M_profile_fine are convert from list to array --- View/sediment_calibration_tab.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/View/sediment_calibration_tab.py b/View/sediment_calibration_tab.py index a391577..3f8e787 100644 --- a/View/sediment_calibration_tab.py +++ b/View/sediment_calibration_tab.py @@ -1128,8 +1128,8 @@ class SedimentCalibrationTab(QWidget): self.ax_Mfine.set_xlabel("Concentration fine sediments (g/L)") self.ax_Mfine.set_ylabel("Depth (m)") - if stg.M_profile_fine: - self.ax_Mfine.plot(stg.M_profile_fine, [-r for r in stg.range_lin_interp], + if stg.M_profile_fine.any(): + self.ax_Mfine.plot(stg.M_profile_fine, -stg.range_lin_interp, marker="*", mfc="b", mec="b", ms=8, ls="None") def interpolate_Mfine_profile(self): @@ -1167,9 +1167,9 @@ class SedimentCalibrationTab(QWidget): range_cells=stg.depth[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :], r_bottom=stg.depth_bottom[self.combobox_acoustic_data_choice.currentIndex()])) print(f"1 M_profile_fine : {stg.M_profile_fine}") - stg.range_lin_interp = stg.range_lin_interp.tolist() - stg.M_profile_fine = stg.M_profile_fine.tolist() - stg.M_profile_fine = stg.M_profile_fine[:len(stg.range_lin_interp)] + stg.range_lin_interp = stg.range_lin_interp + stg.M_profile_fine = stg.M_profile_fine + stg.M_profile_fine = stg.M_profile_fine[:stg.range_lin_interp.shape[0]] print(f"2 M_profile_fine : {stg.M_profile_fine}") self.plot_profile_of_concentration_fine() @@ -2146,7 +2146,7 @@ class SedimentCalibrationTab(QWidget): def compute_zeta(self): # --- Compute zeta --- - if len(stg.M_profile_fine) == 0: + if stg.M_profile_fine.shape == (0,): msgBox = QMessageBox() msgBox.setWindowTitle("Zeta computation error")