stg.range_lin_interp and stg.M_profile_fine are convert from list to array

dev-brahim
brahim 2024-11-14 16:15:18 +01:00
parent a62895d8ad
commit 5ec2d0f97f
1 changed files with 6 additions and 6 deletions

View File

@ -1128,8 +1128,8 @@ class SedimentCalibrationTab(QWidget):
self.ax_Mfine.set_xlabel("Concentration fine sediments (g/L)") self.ax_Mfine.set_xlabel("Concentration fine sediments (g/L)")
self.ax_Mfine.set_ylabel("Depth (m)") self.ax_Mfine.set_ylabel("Depth (m)")
if stg.M_profile_fine: if stg.M_profile_fine.any():
self.ax_Mfine.plot(stg.M_profile_fine, [-r for r in stg.range_lin_interp], self.ax_Mfine.plot(stg.M_profile_fine, -stg.range_lin_interp,
marker="*", mfc="b", mec="b", ms=8, ls="None") marker="*", mfc="b", mec="b", ms=8, ls="None")
def interpolate_Mfine_profile(self): 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(), :], 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()])) r_bottom=stg.depth_bottom[self.combobox_acoustic_data_choice.currentIndex()]))
print(f"1 M_profile_fine : {stg.M_profile_fine}") print(f"1 M_profile_fine : {stg.M_profile_fine}")
stg.range_lin_interp = stg.range_lin_interp.tolist() stg.range_lin_interp = stg.range_lin_interp
stg.M_profile_fine = stg.M_profile_fine.tolist() stg.M_profile_fine = stg.M_profile_fine
stg.M_profile_fine = stg.M_profile_fine[:len(stg.range_lin_interp)] stg.M_profile_fine = stg.M_profile_fine[:stg.range_lin_interp.shape[0]]
print(f"2 M_profile_fine : {stg.M_profile_fine}") print(f"2 M_profile_fine : {stg.M_profile_fine}")
self.plot_profile_of_concentration_fine() self.plot_profile_of_concentration_fine()
@ -2146,7 +2146,7 @@ class SedimentCalibrationTab(QWidget):
def compute_zeta(self): def compute_zeta(self):
# --- Compute zeta --- # --- Compute zeta ---
if len(stg.M_profile_fine) == 0: if stg.M_profile_fine.shape == (0,):
msgBox = QMessageBox() msgBox = QMessageBox()
msgBox.setWindowTitle("Zeta computation error") msgBox.setWindowTitle("Zeta computation error")