Inversion is added to AcouSed. The inversion tab is organised in two part. At the top, fine SSC 2D field is plotted. At the bottom, sand SSC 2D field is plotted. A combobox and a push button are insert on a line at the top. The user choose the acoustic data by clicking on the combobox and run the inversion computation by clicking on the button.

dev-brahim
brahim 2024-07-26 11:45:50 +02:00
parent 3e52edb45b
commit d38a65f2c6
3 changed files with 1089 additions and 472 deletions

File diff suppressed because it is too large Load Diff

View File

@ -276,6 +276,15 @@ class SedimentCalibrationTab(QWidget):
def plot_acoustic_recording(self):
# --- Record frequencies for calibration ---
stg.frequencies_for_calibration.append((stg.freq[self.combobox_acoustic_data_choice.currentIndex()][
self.combobox_freq1.currentIndex()],
self.combobox_freq1.currentIndex()))
stg.frequencies_for_calibration.append((stg.freq[self.combobox_acoustic_data_choice.currentIndex()][
self.combobox_freq2.currentIndex()],
self.combobox_freq2.currentIndex()))
# --- Plot acoustic data recording ---
self.verticalLayout_groupbox_acoustic_data.removeWidget(self.canvas_BS)
self.fig_BS, self.axis_BS = plt.subplots(nrows=1, ncols=1, sharex=True, sharey=False, layout='constrained')
self.canvas_BS = FigureCanvas(self.fig_BS)
@ -654,6 +663,8 @@ class SedimentCalibrationTab(QWidget):
self.combobox_freq2.currentIndex()],
C=stg.water_velocity[self.combobox_acoustic_data_choice.currentIndex()])
stg.ks = [ks_freq1, ks_freq2]
print("\n************************************************************** \n")
print(f"ks for frequency of {stg.freq[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq1.currentIndex()]} : {ks_freq1} m/kg^0.5 \n")
print(f"ks for frequency of {stg.freq[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex()]} : {ks_freq2} m/kg^0.5")
@ -668,6 +679,8 @@ class SedimentCalibrationTab(QWidget):
sv_freq1 = self.inv_hc.sv(ks=ks_freq1, M_sand=stg.Ctot_sand[stg.sand_sample_target[0][1]])
sv_freq2 = self.inv_hc.sv(ks=ks_freq2, M_sand=stg.Ctot_sand[stg.sand_sample_target[0][1]])
stg.sv = [sv_freq1, sv_freq2]
print(f"sv for frequency of {stg.freq[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq1.currentIndex()]} : {sv_freq1:.8f} /m \n")
print(f"sv for frequency of {stg.freq[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex()]} : {sv_freq2:.8f} /m")
@ -682,6 +695,8 @@ class SedimentCalibrationTab(QWidget):
freq2=stg.freq[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex()],
sv_freq1=sv_freq1, sv_freq2=sv_freq2)
stg.X_exponent.append(X_exponent)
print(f"Exponent X = {X_exponent:.2f}\n")
self.spinbox_X.clear()
@ -800,6 +815,11 @@ class SedimentCalibrationTab(QWidget):
r2D=depth_2D[self.combobox_freq2.currentIndex(), :, :],
kt=kt3D[self.combobox_freq2.currentIndex(), :, :])
stg.depth_2D = depth_2D
stg.J_cross_section.append(J_cross_section_freq1)
stg.J_cross_section.append(J_cross_section_freq2)
print("J_cross_section_freq1.shape ", J_cross_section_freq1.shape)
print("J_cross_section_freq2.shape ", J_cross_section_freq2.shape)
@ -844,6 +864,8 @@ class SedimentCalibrationTab(QWidget):
alpha_w=stg.water_attenuation[self.combobox_acoustic_data_choice.currentIndex()][
self.combobox_freq2.currentIndex()])
stg.alpha_s = [alpha_s_freq1, alpha_s_freq2]
print(f"\u03B1s for frequency of freq1 : {alpha_s_freq1:.2f} /m \n")
print(f"\u03B1s for frequency of freq2 : {alpha_s_freq2:.2f} /m")
@ -876,6 +898,8 @@ class SedimentCalibrationTab(QWidget):
self.combobox_freq2.currentIndex(), :],
M_profile_fine=stg.M_profile_fine)
stg.zeta = [zeta_freq1, zeta_freq2]
print(f"\u03B6 for frequency of freq1 : {zeta_freq1:.3f} /m \n")
print(f"\u03B6 for frequency of freq2 : {zeta_freq2:.3f} /m")

View File

@ -153,36 +153,38 @@ sand_sample_target_indice = []
Ctot_fine_per_cent = []
Ctot_sand_per_cent = []
range_lin_interp = []
M_profile_fine = []
# --- Acoustic inversion method ---
temperature = []
water_attenuation = []
water_velocity = []
X_exponent = np.array([])
zeta = np.array([])
# kt_corrected = np.array([])
# kt_corrected_2D = np.array([])
# kt_corrected_3D = np.array([])
J_cross_section = np.array([])
J_stream_bed = np.array([[[]]])
frequencies_to_compute_VBI = np.array([])
VBI_cross_section = np.array([])
VBI_stream_bed = np.array([[[]]])
frequency_to_compute_SSC = 0
ks = 0
sv = 0
alpha_s = 0
# --- Sediment Calibration
frequencies_for_calibration = []
SSC_fine = np.array(())
SSC_sand = np.array([])
range_lin_interp = []
M_profile_fine = []
ks = []
sv = []
X_exponent = []
alpha_s = []
zeta = []
J_cross_section = []
frequency_for_inversion = []
SSC_fine = np.array([[]])
SSC_sand = np.array([[]])
# --- Save study ---