Compare commits

..

No commits in common. "0241f33109fcde34c65957dd7bbc009b84ecb1a0" and "2c1b01118e573ac99a9e188276109442058900d4" have entirely different histories.

4 changed files with 675 additions and 736 deletions

View File

@ -20,16 +20,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import logging
import numpy as np import numpy as np
import settings as stg import settings as stg
from Model.GrainSizeTools import demodul_granulo, mix_gaussian_model from Model.GrainSizeTools import demodul_granulo, mix_gaussian_model
from tools import trace
logger = logging.getLogger("acoused")
class AcousticInversionMethodHighConcentration(): class AcousticInversionMethodHighConcentration():
@ -208,6 +203,7 @@ class AcousticInversionMethodHighConcentration():
r2D, r2D,
water_attenuation_freq1, water_attenuation_freq2, water_attenuation_freq1, water_attenuation_freq2,
X): X):
logVBI = ((zeta_freq2 * logVBI = ((zeta_freq2 *
np.log(j_cross_section_freq1 * np.exp(4 * r2D * water_attenuation_freq1) / np.log(j_cross_section_freq1 * np.exp(4 * r2D * water_attenuation_freq1) /
(freq1 ** X)) - (freq1 ** X)) -
@ -227,3 +223,5 @@ class AcousticInversionMethodHighConcentration():
def SSC_sand(self, VBI, freq, X, ks): def SSC_sand(self, VBI, freq, X, ks):
SSC_sand = (16 * np.pi * VBI * freq ** X) / (3 * ks**2) SSC_sand = (16 * np.pi * VBI * freq ** X) / (3 * ks**2)
return SSC_sand return SSC_sand

View File

@ -697,11 +697,11 @@ class ReadTableForOpen:
stg.filename_calibration_file = next(it) stg.filename_calibration_file = next(it)
stg.range_lin_interp = np_f64_parse(next(it)) stg.range_lin_interp = np_f64_parse(next(it))
stg.M_profile_fine = np_f64_parse(next(it)) stg.M_profile_fine = np_f64_parse(next(it))
stg.ks = np_f64_parse(next(it)).tolist() stg.ks = np_f64_parse(next(it))
stg.sv = np_f64_parse(next(it)).tolist() stg.sv = np_f64_parse(next(it))
stg.X_exponent = np_f64_parse(next(it)).tolist() stg.X_exponent = np_f64_parse(next(it)).tolist()
stg.alpha_s = np_f64_parse(next(it)).tolist() stg.alpha_s = np_f64_parse(next(it))
stg.zeta = np_f64_parse(next(it)).tolist() stg.zeta = np_f64_parse(next(it))
stg.FCB = np_f64_parse(next(it)).tolist() stg.FCB = np_f64_parse(next(it))
stg.depth_real = np_f64_parse(next(it)).tolist() stg.depth_real = np_f64_parse(next(it))
stg.lin_reg = np_f64_parse(next(it)).tolist() stg.lin_reg = np_f64_parse(next(it))

File diff suppressed because it is too large Load Diff

View File

@ -867,12 +867,8 @@ class SedimentCalibrationTab(QWidget):
self.function_pushbutton_update_acoustic_file() self.function_pushbutton_update_acoustic_file()
self._update_calibration_parameters() self._update_calibration_parameters()
self._update_calibration()
self.function_pushbutton_plot_sample() self.function_pushbutton_plot_sample()
self.compute_kt2D_kt3D()
self.compute_J_cross_section()
self.blockSignals(False) self.blockSignals(False)
def _update_calibration_parameters(self): def _update_calibration_parameters(self):
@ -897,41 +893,12 @@ class SedimentCalibrationTab(QWidget):
self.combobox_sand_sample_choice\ self.combobox_sand_sample_choice\
.setCurrentIndex(stg.calib_sand_target) .setCurrentIndex(stg.calib_sand_target)
self.update_label_freq1_for_calibration()
self.update_label_freq2_for_calibration()
self.update_label_kt_value_for_calibration()
self.combobox_sand_sample_choice.blockSignals(False) self.combobox_sand_sample_choice.blockSignals(False)
self.combobox_fine_sample_choice.blockSignals(False) self.combobox_fine_sample_choice.blockSignals(False)
self.combobox_freq2.blockSignals(False) self.combobox_freq2.blockSignals(False)
self.combobox_freq1.blockSignals(False) self.combobox_freq1.blockSignals(False)
self.combobox_acoustic_data_choice.blockSignals(False) self.combobox_acoustic_data_choice.blockSignals(False)
def _update_calibration(self):
self.groupbox_sediment_calibration_compute.blockSignals(True)
if stg.filename_calibration_file == "":
self.groupbox_sediment_calibration_compute\
.setChecked(True)
self.groupbox_sediment_calibration_import\
.setChecked(False)
self.lineEdit_ks_freq1.setText(f"{stg.ks[0]:.5f}")
self.lineEdit_ks_freq2.setText(f"{stg.ks[1]:.5f}")
self.lineEdit_sv_freq1.setText(f"{stg.sv[0]:.5f}")
self.lineEdit_sv_freq2.setText(f"{stg.sv[1]:.5f}")
self.lineEdit_X.setText(f"{stg.X_exponent[0]:.5f}")
self.lineEdit_alphas_freq1.setText(f"{stg.alpha_s[0]:.5f}")
self.lineEdit_alphas_freq2.setText(f"{stg.alpha_s[1]:.5f}")
self.lineEdit_zeta_freq1.setText(f"{stg.zeta[0]:.5f}")
self.lineEdit_zeta_freq2.setText(f"{stg.zeta[1]:.5f}")
self.groupbox_sediment_calibration_compute.blockSignals(False)
def function_pushbutton_update_acoustic_file(self): def function_pushbutton_update_acoustic_file(self):
if len(stg.data_preprocessed) == 0: if len(stg.data_preprocessed) == 0:
return return
@ -1023,7 +990,9 @@ class SedimentCalibrationTab(QWidget):
stg.frequency_for_inversion = tuple() stg.frequency_for_inversion = tuple()
stg.frequency_for_inversion = ( stg.frequency_for_inversion = (
stg.freq[data_id][freq2], stg.freq[data_id][
freq2
],
freq2 freq2
) )
@ -1031,8 +1000,7 @@ class SedimentCalibrationTab(QWidget):
self.verticalLayout_groupbox_data_plot.removeWidget(self.toolbar_BS) self.verticalLayout_groupbox_data_plot.removeWidget(self.toolbar_BS)
self.verticalLayout_groupbox_data_plot.removeWidget(self.canvas_BS) self.verticalLayout_groupbox_data_plot.removeWidget(self.canvas_BS)
self.fig_BS, self.axis_BS = plt.subplots( self.fig_BS, self.axis_BS = plt.subplots(
nrows=1, ncols=1, sharex=True, sharey=False, nrows=1, ncols=1, sharex=True, sharey=False, layout='constrained'
layout='constrained'
) )
self.canvas_BS = FigureCanvas(self.fig_BS) self.canvas_BS = FigureCanvas(self.fig_BS)
self.toolbar_BS = NavigationToolBar(self.canvas_BS, self) self.toolbar_BS = NavigationToolBar(self.canvas_BS, self)
@ -1043,10 +1011,18 @@ class SedimentCalibrationTab(QWidget):
data_id data_id
].shape != (0,): ].shape != (0,):
val_min = np.nanmin( val_min = np.nanmin(
stg.BS_stream_bed_pre_process_average[data_id][freq2, :, :] stg.BS_stream_bed_pre_process_average[
data_id
][
freq2, :, :
]
) )
val_max = np.nanmax( val_max = np.nanmax(
stg.BS_stream_bed_pre_process_average[data_id][freq2, :, :] stg.BS_stream_bed_pre_process_average[
data_id
][
freq2, :, :
]
) )
if val_min == 0: if val_min == 0:
val_min = 1e-5 val_min = 1e-5
@ -1054,13 +1030,13 @@ class SedimentCalibrationTab(QWidget):
if stg.time_cross_section[data_id].shape != (0,): if stg.time_cross_section[data_id].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,): if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh( self.axis_BS.pcolormesh(
stg.time_cross_section[data_id][freq2, :], stg.time_cross_section[data_id][
-stg.depth_cross_section[data_id][freq2, :], freq2, :],
-stg.depth_cross_section[data_id][
freq2, :],
stg.BS_stream_bed_pre_process_average[data_id][ stg.BS_stream_bed_pre_process_average[data_id][
freq2, :, :], freq2, :, :],
cmap='viridis', cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
norm=LogNorm(vmin=val_min, vmax=val_max)
)
else: else:
self.axis_BS.pcolormesh( self.axis_BS.pcolormesh(
stg.time_cross_section[data_id][ stg.time_cross_section[data_id][