User can import calibration to compute inversion
parent
fa479e1dc8
commit
86c831e126
|
|
@ -175,39 +175,46 @@ class SedimentCalibrationTab(QWidget):
|
||||||
|
|
||||||
self.pushbutton_interpolate_Mfine_profile = QPushButton()
|
self.pushbutton_interpolate_Mfine_profile = QPushButton()
|
||||||
self.pushbutton_interpolate_Mfine_profile.setText("Interpolate")
|
self.pushbutton_interpolate_Mfine_profile.setText("Interpolate")
|
||||||
self.gridLayout_groupbox_interpolate_info.addWidget(self.pushbutton_interpolate_Mfine_profile, 0, 0, 1, 4)
|
self.gridLayout_groupbox_interpolate_info.addWidget(self.pushbutton_interpolate_Mfine_profile, 0, 0, 1, 4, Qt.AlignCenter)
|
||||||
|
|
||||||
self.label_sample_fine = QLabel()
|
self.label_sample_fine = QLabel()
|
||||||
self.label_sample_fine.setText("Sample")
|
self.label_sample_fine.setText("Sample")
|
||||||
self.gridLayout_groupbox_interpolate_info.addWidget(self.label_sample_fine, 1, 0, 1, 1)
|
self.gridLayout_groupbox_interpolate_info.addWidget(self.label_sample_fine, 1, 0, 1, 1, Qt.AlignCenter)
|
||||||
|
|
||||||
self.label_depth_fine = QLabel()
|
self.label_depth_fine = QLabel()
|
||||||
self.label_depth_fine.setText("Depth (m)")
|
self.label_depth_fine.setText("Depth (m)")
|
||||||
self.gridLayout_groupbox_interpolate_info.addWidget(self.label_depth_fine, 1, 1, 1, 1)
|
self.gridLayout_groupbox_interpolate_info.addWidget(self.label_depth_fine, 1, 1, 1, 1, Qt.AlignCenter)
|
||||||
|
|
||||||
self.label_time_fine = QLabel()
|
self.label_time_fine = QLabel()
|
||||||
self.label_time_fine.setText("time")
|
self.label_time_fine.setText("time")
|
||||||
self.gridLayout_groupbox_interpolate_info.addWidget(self.label_time_fine, 1, 2, 1, 1)
|
self.gridLayout_groupbox_interpolate_info.addWidget(self.label_time_fine, 1, 2, 1, 1, Qt.AlignCenter)
|
||||||
|
|
||||||
self.label_concentration_fine = QLabel()
|
self.label_concentration_fine = QLabel()
|
||||||
self.label_concentration_fine.setText("Cfine (g/L)")
|
self.label_concentration_fine.setText("Cfine (g/L)")
|
||||||
self.gridLayout_groupbox_interpolate_info.addWidget(self.label_concentration_fine, 1, 3, 1, 1)
|
self.gridLayout_groupbox_interpolate_info.addWidget(self.label_concentration_fine, 1, 3, 1, 1, Qt.AlignCenter)
|
||||||
|
|
||||||
|
self.double_horizontal_line = QFrame()
|
||||||
|
self.double_horizontal_line.setFrameShape(QFrame.HLine)
|
||||||
|
self.double_horizontal_line.setFrameShadow(QFrame.Sunken)
|
||||||
|
self.double_horizontal_line.setLineWidth(1)
|
||||||
|
self.double_horizontal_line.setMidLineWidth(3)
|
||||||
|
self.gridLayout_groupbox_interpolate_info.addWidget(self.double_horizontal_line, 4, 0, 1, 4, Qt.AlignCenter)
|
||||||
|
|
||||||
self.label_sample_sand = QLabel()
|
self.label_sample_sand = QLabel()
|
||||||
self.label_sample_sand.setText("Sample")
|
self.label_sample_sand.setText("Sample")
|
||||||
self.gridLayout_groupbox_interpolate_info.addWidget(self.label_sample_sand, 5, 0, 1, 1)
|
self.gridLayout_groupbox_interpolate_info.addWidget(self.label_sample_sand, 5, 0, 1, 1, Qt.AlignCenter)
|
||||||
|
|
||||||
self.label_depth_sand = QLabel()
|
self.label_depth_sand = QLabel()
|
||||||
self.label_depth_sand.setText("Depth (m)")
|
self.label_depth_sand.setText("Depth (m)")
|
||||||
self.gridLayout_groupbox_interpolate_info.addWidget(self.label_depth_sand, 5, 1, 1, 1)
|
self.gridLayout_groupbox_interpolate_info.addWidget(self.label_depth_sand, 5, 1, 1, 1, Qt.AlignCenter)
|
||||||
|
|
||||||
self.label_time_sand = QLabel()
|
self.label_time_sand = QLabel()
|
||||||
self.label_time_sand.setText("time")
|
self.label_time_sand.setText("time")
|
||||||
self.gridLayout_groupbox_interpolate_info.addWidget(self.label_time_sand, 5, 2, 1, 1)
|
self.gridLayout_groupbox_interpolate_info.addWidget(self.label_time_sand, 5, 2, 1, 1, Qt.AlignCenter)
|
||||||
|
|
||||||
self.label_concentration_sand = QLabel()
|
self.label_concentration_sand = QLabel()
|
||||||
self.label_concentration_sand.setText("Csand (g/L)")
|
self.label_concentration_sand.setText("Csand (g/L)")
|
||||||
self.gridLayout_groupbox_interpolate_info.addWidget(self.label_concentration_sand, 5, 3, 1, 1)
|
self.gridLayout_groupbox_interpolate_info.addWidget(self.label_concentration_sand, 5, 3, 1, 1, Qt.AlignCenter)
|
||||||
|
|
||||||
# --- Groupbox interpolate plot ---
|
# --- Groupbox interpolate plot ---
|
||||||
self.verticalLayout_groupbox_interpolate_plot = QVBoxLayout(self.groupbox_interpolate_plot)
|
self.verticalLayout_groupbox_interpolate_plot = QVBoxLayout(self.groupbox_interpolate_plot)
|
||||||
|
|
@ -284,16 +291,28 @@ class SedimentCalibrationTab(QWidget):
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_kt, 2, 0, 1, 1, Qt.AlignCenter)
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_kt, 2, 0, 1, 1, Qt.AlignCenter)
|
||||||
|
|
||||||
self.label_kt_freq1 = QLabel()
|
self.label_kt_freq1 = QLabel()
|
||||||
self.label_kt_freq1.setText("0.00 V.m^1.5")
|
self.label_kt_freq1.setText("0.00")
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_kt_freq1, 2, 1, 1, 2, Qt.AlignCenter)
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_kt_freq1, 2, 1, 1, 1, Qt.AlignRight)
|
||||||
|
|
||||||
|
self.label_kt_freq1_unit = QLabel()
|
||||||
|
self.label_kt_freq1_unit.setText("V.m<sup>1.5</sup>")
|
||||||
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_kt_freq1_unit, 2, 2, 1, 1,
|
||||||
|
Qt.AlignLeft)
|
||||||
|
|
||||||
self.label_kt_freq2 = QLabel()
|
self.label_kt_freq2 = QLabel()
|
||||||
self.label_kt_freq2.setText("0.00 V.m^1.5")
|
self.label_kt_freq2.setText("0.00 V.m<sup>1.5</sup>")
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_kt_freq2, 2, 3, 1, 2, Qt.AlignCenter)
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_kt_freq2, 2, 3, 1, 1, Qt.AlignRight)
|
||||||
|
|
||||||
|
self.label_kt_freq2_unit = QLabel()
|
||||||
|
self.label_kt_freq2_unit.setText("V.m<sup>1.5</sup>")
|
||||||
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_kt_freq2_unit, 2, 4, 1, 1,
|
||||||
|
Qt.AlignLeft)
|
||||||
|
|
||||||
self.horizontalLine = QFrame()
|
self.horizontalLine = QFrame()
|
||||||
self.horizontalLine.setFrameShape(QFrame.HLine)
|
self.horizontalLine.setFrameShape(QFrame.HLine)
|
||||||
self.horizontalLine.setFrameShadow(QFrame.Sunken)
|
self.horizontalLine.setFrameShadow(QFrame.Sunken)
|
||||||
|
self.horizontalLine.setLineWidth(1)
|
||||||
|
self.horizontalLine.setMidLineWidth(0)
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.horizontalLine, 3, 0, 1, 6)
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.horizontalLine, 3, 0, 1, 6)
|
||||||
|
|
||||||
self.label_ks = QLabel()
|
self.label_ks = QLabel()
|
||||||
|
|
@ -309,7 +328,7 @@ class SedimentCalibrationTab(QWidget):
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.lineEdit_ks_freq1, 4, 1, 1, 1)
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.lineEdit_ks_freq1, 4, 1, 1, 1)
|
||||||
|
|
||||||
self.label_ks_freq1_unit = QLabel()
|
self.label_ks_freq1_unit = QLabel()
|
||||||
self.label_ks_freq1_unit.setText("m/kg^0.5")
|
self.label_ks_freq1_unit.setText("m.kg<sup>-0.5</sup>")
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_ks_freq1_unit, 4, 2, 1, 1,
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_ks_freq1_unit, 4, 2, 1, 1,
|
||||||
Qt.AlignLeft)
|
Qt.AlignLeft)
|
||||||
|
|
||||||
|
|
@ -322,7 +341,7 @@ class SedimentCalibrationTab(QWidget):
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.lineEdit_ks_freq2, 4, 3, 1, 1)
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.lineEdit_ks_freq2, 4, 3, 1, 1)
|
||||||
|
|
||||||
self.label_ks_freq2_unit = QLabel()
|
self.label_ks_freq2_unit = QLabel()
|
||||||
self.label_ks_freq2_unit.setText("m/kg^0.5")
|
self.label_ks_freq2_unit.setText("m.kg<sup>-0.5</sup>")
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_ks_freq2_unit, 4, 4, 1, 1,
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_ks_freq2_unit, 4, 4, 1, 1,
|
||||||
Qt.AlignLeft)
|
Qt.AlignLeft)
|
||||||
|
|
||||||
|
|
@ -339,7 +358,7 @@ class SedimentCalibrationTab(QWidget):
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.lineEdit_sv_freq1, 5, 1, 1, 1)
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.lineEdit_sv_freq1, 5, 1, 1, 1)
|
||||||
|
|
||||||
self.label_sv_freq1_unit = QLabel()
|
self.label_sv_freq1_unit = QLabel()
|
||||||
self.label_sv_freq1_unit.setText("/m")
|
self.label_sv_freq1_unit.setText("m<sup>-1</sup>")
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_sv_freq1_unit, 5, 2, 1, 1)
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_sv_freq1_unit, 5, 2, 1, 1)
|
||||||
|
|
||||||
# self.spinbox_sv_freq2 = QDoubleSpinBox()
|
# self.spinbox_sv_freq2 = QDoubleSpinBox()
|
||||||
|
|
@ -351,7 +370,7 @@ class SedimentCalibrationTab(QWidget):
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.lineEdit_sv_freq2, 5, 3, 1, 1)
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.lineEdit_sv_freq2, 5, 3, 1, 1)
|
||||||
|
|
||||||
self.label_sv_freq2_unit = QLabel()
|
self.label_sv_freq2_unit = QLabel()
|
||||||
self.label_sv_freq2_unit.setText("/m")
|
self.label_sv_freq2_unit.setText("m<sup>-1</sup>")
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_sv_freq2_unit, 5, 4, 1, 1)
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_sv_freq2_unit, 5, 4, 1, 1)
|
||||||
|
|
||||||
self.label_X = QLabel()
|
self.label_X = QLabel()
|
||||||
|
|
@ -378,7 +397,7 @@ class SedimentCalibrationTab(QWidget):
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.lineEdit_alphas_freq1, 7, 1, 1, 1)
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.lineEdit_alphas_freq1, 7, 1, 1, 1)
|
||||||
|
|
||||||
self.label_alphas_freq1_unit = QLabel()
|
self.label_alphas_freq1_unit = QLabel()
|
||||||
self.label_alphas_freq1_unit.setText("/m")
|
self.label_alphas_freq1_unit.setText("m<sup>-1</sup>")
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_alphas_freq1_unit, 7, 2, 1, 1, Qt.AlignLeft)
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_alphas_freq1_unit, 7, 2, 1, 1, Qt.AlignLeft)
|
||||||
|
|
||||||
# self.spinbox_alphas_freq2 = QDoubleSpinBox()
|
# self.spinbox_alphas_freq2 = QDoubleSpinBox()
|
||||||
|
|
@ -390,7 +409,7 @@ class SedimentCalibrationTab(QWidget):
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.lineEdit_alphas_freq2, 7, 3, 1, 1)
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.lineEdit_alphas_freq2, 7, 3, 1, 1)
|
||||||
|
|
||||||
self.label_alphas_freq2_unit = QLabel()
|
self.label_alphas_freq2_unit = QLabel()
|
||||||
self.label_alphas_freq2_unit.setText("/m")
|
self.label_alphas_freq2_unit.setText("m<sup>-1</sup>")
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_alphas_freq2_unit, 7, 4, 1, 1, Qt.AlignLeft)
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_alphas_freq2_unit, 7, 4, 1, 1, Qt.AlignLeft)
|
||||||
|
|
||||||
self.label_zeta = QLabel()
|
self.label_zeta = QLabel()
|
||||||
|
|
@ -406,7 +425,7 @@ class SedimentCalibrationTab(QWidget):
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.lineEdit_zeta_freq1, 8, 1, 1, 1)
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.lineEdit_zeta_freq1, 8, 1, 1, 1)
|
||||||
|
|
||||||
self.label_zeta_freq1_unit = QLabel()
|
self.label_zeta_freq1_unit = QLabel()
|
||||||
self.label_zeta_freq1_unit.setText("/m")
|
self.label_zeta_freq1_unit.setText("m<sup>-1</sup>")
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_zeta_freq1_unit, 8, 2, 1, 1,
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_zeta_freq1_unit, 8, 2, 1, 1,
|
||||||
Qt.AlignLeft)
|
Qt.AlignLeft)
|
||||||
|
|
||||||
|
|
@ -419,7 +438,7 @@ class SedimentCalibrationTab(QWidget):
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.lineEdit_zeta_freq2, 8, 3, 1, 1)
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.lineEdit_zeta_freq2, 8, 3, 1, 1)
|
||||||
|
|
||||||
self.label_zeta_freq2_unit = QLabel()
|
self.label_zeta_freq2_unit = QLabel()
|
||||||
self.label_zeta_freq2_unit.setText("/m")
|
self.label_zeta_freq2_unit.setText("m<sup>-1</sup>")
|
||||||
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_zeta_freq2_unit, 8, 4, 1, 1,
|
self.gridLayout_groupbox_sediment_calibration_parameter.addWidget(self.label_zeta_freq2_unit, 8, 4, 1, 1,
|
||||||
Qt.AlignLeft)
|
Qt.AlignLeft)
|
||||||
|
|
||||||
|
|
@ -446,7 +465,7 @@ class SedimentCalibrationTab(QWidget):
|
||||||
# ++++++++++++++++++++
|
# ++++++++++++++++++++
|
||||||
# +++ Groupbox FCB +++
|
# +++ Groupbox FCB +++
|
||||||
|
|
||||||
self.groupbox_FCB.setTitle("Step 3 (optional) : Fluid Corrected Backscatter")
|
self.groupbox_FCB.setTitle("Step 3 (for information) : Fluid Corrected Backscatter")
|
||||||
self.horizontalLayout_groupbox_FCB = QHBoxLayout(self.groupbox_FCB)
|
self.horizontalLayout_groupbox_FCB = QHBoxLayout(self.groupbox_FCB)
|
||||||
|
|
||||||
self.groupbox_FCB.setCheckable(True)
|
self.groupbox_FCB.setCheckable(True)
|
||||||
|
|
@ -623,6 +642,10 @@ class SedimentCalibrationTab(QWidget):
|
||||||
self.combobox_sand_sample_choice.addItems([s[0] for s in stg.sample_sand])
|
self.combobox_sand_sample_choice.addItems([s[0] for s in stg.sample_sand])
|
||||||
|
|
||||||
self.plot_acoustic_recording()
|
self.plot_acoustic_recording()
|
||||||
|
|
||||||
|
self.label_temperature.clear()
|
||||||
|
self.label_temperature.setText("T = " + str(stg.temperature) + " °C")
|
||||||
|
|
||||||
self.update_label_freq1_for_calibration()
|
self.update_label_freq1_for_calibration()
|
||||||
self.update_label_freq2_for_calibration()
|
self.update_label_freq2_for_calibration()
|
||||||
self.update_label_kt_value_for_calibration()
|
self.update_label_kt_value_for_calibration()
|
||||||
|
|
@ -995,7 +1018,7 @@ class SedimentCalibrationTab(QWidget):
|
||||||
for i in reversed(range(self.gridLayout_groupbox_interpolate_info.count())):
|
for i in reversed(range(self.gridLayout_groupbox_interpolate_info.count())):
|
||||||
self.gridLayout_groupbox_interpolate_info.itemAt(i).widget().setParent(None)
|
self.gridLayout_groupbox_interpolate_info.itemAt(i).widget().setParent(None)
|
||||||
|
|
||||||
self.gridLayout_groupbox_interpolate_info.addWidget(self.pushbutton_interpolate_Mfine_profile, 0, 0, 1, 4)
|
self.gridLayout_groupbox_interpolate_info.addWidget(self.pushbutton_interpolate_Mfine_profile, 0, 0, 1, 4, Qt.AlignCenter)
|
||||||
|
|
||||||
fine_head = ["Sample", "Depth (m)", "time", "Cfine (g/L)"]
|
fine_head = ["Sample", "Depth (m)", "time", "Cfine (g/L)"]
|
||||||
fine_label = [self.label_sample_fine, self.label_depth_fine, self.label_time_fine,
|
fine_label = [self.label_sample_fine, self.label_depth_fine, self.label_time_fine,
|
||||||
|
|
@ -1004,8 +1027,8 @@ class SedimentCalibrationTab(QWidget):
|
||||||
for j in range(len(fine_head)):
|
for j in range(len(fine_head)):
|
||||||
exec("fine_label[" + str(j) + "] = QLabel()")
|
exec("fine_label[" + str(j) + "] = QLabel()")
|
||||||
eval("fine_label[" + str(j) + "].setText(fine_head[" + str(j) + "])")
|
eval("fine_label[" + str(j) + "].setText(fine_head[" + str(j) + "])")
|
||||||
print((f"self.gridLayout_groupbox_interpolate_info.addWidget(fine_label[{j}], 1, {j}, 1, 1)"))
|
print((f"self.gridLayout_groupbox_interpolate_info.addWidget(fine_label[{j}], 1, {j}, 1, 1, Qt.AlignCenter)"))
|
||||||
eval(f"self.gridLayout_groupbox_interpolate_info.addWidget(fine_label[{j}], 1, {j}, 1, 1)")
|
eval(f"self.gridLayout_groupbox_interpolate_info.addWidget(fine_label[{j}], 1, {j}, 1, 1, Qt.AlignCenter)")
|
||||||
|
|
||||||
fine_data = []
|
fine_data = []
|
||||||
for k in range(len(stg.fine_sample_profile)):
|
for k in range(len(stg.fine_sample_profile)):
|
||||||
|
|
@ -1017,7 +1040,15 @@ class SedimentCalibrationTab(QWidget):
|
||||||
# exec("fine_label[" + str(p) + "]_" + "stg.fine_sample_profile[" + str(p) + "][0]" + " = QLabel()")
|
# exec("fine_label[" + str(p) + "]_" + "stg.fine_sample_profile[" + str(p) + "][0]" + " = QLabel()")
|
||||||
# eval("fine_label[" + str(p) + "]_" + "stg.fine_sample_profile[" + str(p) + "][0]" + ".setText(" + "fine_data[" + str(p) + "][" + str(q) + "])")
|
# eval("fine_label[" + str(p) + "]_" + "stg.fine_sample_profile[" + str(p) + "][0]" + ".setText(" + "fine_data[" + str(p) + "][" + str(q) + "])")
|
||||||
# eval("self.gridLayout_groupbox_interpolate_info.addWidget(" + "fine_label[" + str(p) + "]_" + "stg.fine_sample_profile[" + str(p) + "], " + str(1+p) + ", " + str(q) + ", 1, 1)")
|
# eval("self.gridLayout_groupbox_interpolate_info.addWidget(" + "fine_label[" + str(p) + "]_" + "stg.fine_sample_profile[" + str(p) + "], " + str(1+p) + ", " + str(q) + ", 1, 1)")
|
||||||
eval(f"self.gridLayout_groupbox_interpolate_info.addWidget(QLabel(fine_data[{p}][{q}]), {2 + p}, {q}, 1, 1)")
|
print(f"self.gridLayout_groupbox_interpolate_info.addWidget(QLabel(fine_data[{p}][{q}]), {2 + p}, {q}, 1, 1, Qt.AlignCenter)")
|
||||||
|
eval(f"self.gridLayout_groupbox_interpolate_info.addWidget(QLabel(fine_data[{p}][{q}]), {2 + p}, {q}, 1, 1, Qt.AlignCenter)")
|
||||||
|
|
||||||
|
# self.double_horizontal_line = QFrame()
|
||||||
|
# self.double_horizontal_line.setFrameShape(QFrame.HLine)
|
||||||
|
# self.double_horizontal_line.setFrameShadow(QFrame.Sunken)
|
||||||
|
# self.double_horizontal_line.setLineWidth(1)
|
||||||
|
# self.double_horizontal_line.setMidLineWidth(3)
|
||||||
|
self.gridLayout_groupbox_interpolate_info.addWidget(self.double_horizontal_line, 2 + len(fine_data), 0, 1, 4, Qt.AlignCenter)
|
||||||
|
|
||||||
sand_head = ["Sample", "Depth (m)", "time", "Csand (g/L)"]
|
sand_head = ["Sample", "Depth (m)", "time", "Csand (g/L)"]
|
||||||
sand_label = [self.label_sample_sand, self.label_depth_sand, self.label_time_sand,
|
sand_label = [self.label_sample_sand, self.label_depth_sand, self.label_time_sand,
|
||||||
|
|
@ -1026,8 +1057,8 @@ class SedimentCalibrationTab(QWidget):
|
||||||
for s in range(len(sand_head)):
|
for s in range(len(sand_head)):
|
||||||
exec("sand_label[" + str(s) + "] = QLabel()")
|
exec("sand_label[" + str(s) + "] = QLabel()")
|
||||||
eval("sand_label[" + str(s) + "].setText(sand_head[" + str(s) + "])")
|
eval("sand_label[" + str(s) + "].setText(sand_head[" + str(s) + "])")
|
||||||
# print((f"self.gridLayout_groupbox_interpolate_info.addWidget(sand_label[{s}], 0, {s + 1}, 1, 1)"))
|
print(f"self.gridLayout_groupbox_interpolate_info.addWidget(sand_label[{s}], {3 + len(fine_data)}, {s}, 1, 1, Qt.AlignCenter)")
|
||||||
eval(f"self.gridLayout_groupbox_interpolate_info.addWidget(sand_label[{s}], {2 + len(fine_data)}, {s}, 1, 1)")
|
eval(f"self.gridLayout_groupbox_interpolate_info.addWidget(sand_label[{s}], {3 + len(fine_data)}, {s}, 1, 1, Qt.AlignCenter)")
|
||||||
|
|
||||||
sand_data = [stg.sand_sample_target[0][0],
|
sand_data = [stg.sand_sample_target[0][0],
|
||||||
str(stg.depth_sand[stg.sand_sample_target[0][1]]),
|
str(stg.depth_sand[stg.sand_sample_target[0][1]]),
|
||||||
|
|
@ -1035,7 +1066,7 @@ class SedimentCalibrationTab(QWidget):
|
||||||
str(stg.Ctot_sand[stg.sand_sample_target[0][1]])]
|
str(stg.Ctot_sand[stg.sand_sample_target[0][1]])]
|
||||||
|
|
||||||
for t in range(len(sand_data)):
|
for t in range(len(sand_data)):
|
||||||
self.gridLayout_groupbox_interpolate_info.addWidget(QLabel(sand_data[t]), 3 + len(fine_data), t, 1, 1)
|
self.gridLayout_groupbox_interpolate_info.addWidget(QLabel(sand_data[t]), 4 + len(fine_data), t, 1, 1, Qt.AlignCenter)
|
||||||
|
|
||||||
|
|
||||||
def plot_profile_of_concentration_fine(self):
|
def plot_profile_of_concentration_fine(self):
|
||||||
|
|
@ -1277,8 +1308,8 @@ class SedimentCalibrationTab(QWidget):
|
||||||
dir_name = path.dirname(filename[0])
|
dir_name = path.dirname(filename[0])
|
||||||
name = path.basename(filename[0])
|
name = path.basename(filename[0])
|
||||||
|
|
||||||
stg.path_calibration_import_file = dir_name
|
stg.path_calibration_file = dir_name
|
||||||
stg.filename_calibration_import_file = name
|
stg.filename_calibration_file = name
|
||||||
|
|
||||||
self.lineEdit_import_calibration.clear()
|
self.lineEdit_import_calibration.clear()
|
||||||
self.lineEdit_import_calibration.setText(name)
|
self.lineEdit_import_calibration.setText(name)
|
||||||
|
|
@ -1298,25 +1329,40 @@ class SedimentCalibrationTab(QWidget):
|
||||||
def update_label_kt_value_for_calibration(self):
|
def update_label_kt_value_for_calibration(self):
|
||||||
self.label_kt_freq1.clear()
|
self.label_kt_freq1.clear()
|
||||||
print("self.combobox_freq1.currentIndex() ", self.combobox_freq1.currentIndex(), self.combobox_freq1.currentText())
|
print("self.combobox_freq1.currentIndex() ", self.combobox_freq1.currentIndex(), self.combobox_freq1.currentText())
|
||||||
if stg.kt_corrected[self.combobox_freq1.currentText()] != stg.kt_read[self.combobox_freq1.currentIndex()]:
|
if stg.kt_corrected[self.combobox_freq1.currentIndex()] != stg.kt_read[self.combobox_freq1.currentIndex()]:
|
||||||
self.label_kt_freq1.setText(str('%.4f' % stg.kt_corrected[self.combobox_freq1.currentText()]))
|
self.label_kt_freq1.setText(str('%.4f' % stg.kt_corrected[self.combobox_freq1.currentIndex()]))
|
||||||
else:
|
else:
|
||||||
self.label_kt_freq1.setText(str('%.4f' % stg.kt_read[self.combobox_freq1.currentIndex()]))
|
self.label_kt_freq1.setText(str('%.4f' % stg.kt_read[self.combobox_freq1.currentIndex()]))
|
||||||
|
|
||||||
self.label_kt_freq2.clear()
|
self.label_kt_freq2.clear()
|
||||||
if stg.kt_corrected[self.combobox_freq2.currentText()] != stg.kt_read[self.combobox_freq2.currentIndex()]:
|
if stg.kt_corrected[self.combobox_freq2.currentIndex()] != stg.kt_read[self.combobox_freq2.currentIndex()]:
|
||||||
self.label_kt_freq2.setText(str('%.4f' % stg.kt_corrected[self.combobox_freq2.currentText()]))
|
self.label_kt_freq2.setText(str('%.4f' % stg.kt_corrected[self.combobox_freq2.currentIndex()]))
|
||||||
else:
|
else:
|
||||||
self.label_kt_freq2.setText(str('%.4f' % stg.kt_read[self.combobox_freq2.currentIndex()]))
|
self.label_kt_freq2.setText(str('%.4f' % stg.kt_read[self.combobox_freq2.currentIndex()]))
|
||||||
|
|
||||||
def read_calibration_file_and_fill_parameter(self):
|
def read_calibration_file_and_fill_parameter(self):
|
||||||
|
if self.combobox_acoustic_data_choice.count() == 0:
|
||||||
|
|
||||||
|
msgBox = QMessageBox()
|
||||||
|
msgBox.setWindowTitle("Calibration import error")
|
||||||
|
msgBox.setIconPixmap(
|
||||||
|
QPixmap(self.path_icon + "no_approved.png").scaledToHeight(32, Qt.SmoothTransformation))
|
||||||
|
msgBox.setText("Update data before importing calibration")
|
||||||
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||||
|
msgBox.exec()
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
# --- Read calibration file ---
|
# --- Read calibration file ---
|
||||||
data = pd.read_csv(stg.calibration_file[0] + "/" + stg.calibration_file[1], header=0, index_col=0)
|
data = pd.read_csv(stg.path_calibration_file + "/" + stg.filename_calibration_file, header=0, index_col=0)
|
||||||
print(data.head())
|
print(data.head())
|
||||||
print(data.iloc[0][0])
|
print(data.iloc[0][0])
|
||||||
print(type(data.iloc[0][0]))
|
print(type(data.iloc[0][0]))
|
||||||
|
|
||||||
# --- Fill spinboxes of calibration parameter ---
|
# --- Fill spinboxes of calibration parameter ---
|
||||||
|
self.label_temperature.clear()
|
||||||
|
self.label_temperature.setText("T = " + str(stg.temperature) + " °C")
|
||||||
|
|
||||||
self.label_freq1.clear()
|
self.label_freq1.clear()
|
||||||
self.label_freq1.setText(data.columns[0])
|
self.label_freq1.setText(data.columns[0])
|
||||||
print(stg.freq_text)
|
print(stg.freq_text)
|
||||||
|
|
@ -1348,12 +1394,12 @@ class SedimentCalibrationTab(QWidget):
|
||||||
# self.spinbox_ks_freq1.clear()
|
# self.spinbox_ks_freq1.clear()
|
||||||
# self.spinbox_ks_freq1.setValue()
|
# self.spinbox_ks_freq1.setValue()
|
||||||
self.lineEdit_ks_freq1.clear()
|
self.lineEdit_ks_freq1.clear()
|
||||||
self.lineEdit_ks_freq1.setText(str("%.5f" % float(data.iloc[0][0])) + " m/kg^0.5")
|
self.lineEdit_ks_freq1.setText(str("%.5f" % float(data.iloc[0][0])))
|
||||||
|
|
||||||
# self.spinbox_ks_freq2.clear()
|
# self.spinbox_ks_freq2.clear()
|
||||||
# self.spinbox_ks_freq2.setValue(float(data.iloc[0][1]))
|
# self.spinbox_ks_freq2.setValue(float(data.iloc[0][1]))
|
||||||
self.lineEdit_ks_freq2.clear()
|
self.lineEdit_ks_freq2.clear()
|
||||||
self.lineEdit_ks_freq2.setText(str("%.5f" % float(data.iloc[0][1])) + " m/kg^0.5")
|
self.lineEdit_ks_freq2.setText(str("%.5f" % float(data.iloc[0][1])))
|
||||||
|
|
||||||
stg.ks.clear()
|
stg.ks.clear()
|
||||||
# stg.ks = [self.spinbox_ks_freq1.value(), self.spinbox_ks_freq2.value()]
|
# stg.ks = [self.spinbox_ks_freq1.value(), self.spinbox_ks_freq2.value()]
|
||||||
|
|
@ -1362,12 +1408,12 @@ class SedimentCalibrationTab(QWidget):
|
||||||
# self.spinbox_sv_freq1.clear()
|
# self.spinbox_sv_freq1.clear()
|
||||||
# self.spinbox_sv_freq1.setValue(float(data.iloc[1][0]))
|
# self.spinbox_sv_freq1.setValue(float(data.iloc[1][0]))
|
||||||
self.lineEdit_sv_freq1.clear()
|
self.lineEdit_sv_freq1.clear()
|
||||||
self.lineEdit_sv_freq1.setText(str("%.5f" % float(data.iloc[1][0])) + " /m")
|
self.lineEdit_sv_freq1.setText(str("%.5f" % float(data.iloc[1][0])))
|
||||||
|
|
||||||
# self.spinbox_sv_freq2.clear()
|
# self.spinbox_sv_freq2.clear()
|
||||||
# self.spinbox_sv_freq2.setValue(float(data.iloc[1][1]))
|
# self.spinbox_sv_freq2.setValue(float(data.iloc[1][1]))
|
||||||
self.lineEdit_sv_freq2.clear()
|
self.lineEdit_sv_freq2.clear()
|
||||||
self.lineEdit_sv_freq2.setText(str("%.5f" % float(data.iloc[1][1])) + " /m")
|
self.lineEdit_sv_freq2.setText(str("%.5f" % float(data.iloc[1][1])))
|
||||||
|
|
||||||
stg.sv.clear()
|
stg.sv.clear()
|
||||||
# stg.sv = [self.spinbox_sv_freq1.value(), self.spinbox_sv_freq2.value()]
|
# stg.sv = [self.spinbox_sv_freq1.value(), self.spinbox_sv_freq2.value()]
|
||||||
|
|
@ -1488,6 +1534,9 @@ class SedimentCalibrationTab(QWidget):
|
||||||
|
|
||||||
def function_pushbutton_compute_calibration(self):
|
def function_pushbutton_compute_calibration(self):
|
||||||
|
|
||||||
|
self.label_temperature.clear()
|
||||||
|
self.label_temperature.setText("T = " + str(stg.temperature) + " °C")
|
||||||
|
|
||||||
self.compute_ks()
|
self.compute_ks()
|
||||||
self.compute_sv()
|
self.compute_sv()
|
||||||
self.compute_X()
|
self.compute_X()
|
||||||
|
|
@ -1589,11 +1638,10 @@ class SedimentCalibrationTab(QWidget):
|
||||||
# print("kt cor ", stg.kt_corrected)
|
# print("kt cor ", stg.kt_corrected)
|
||||||
# print("kt read", stg.kt_read)
|
# print("kt read", stg.kt_read)
|
||||||
|
|
||||||
if ([stg.kt_corrected[key] for key in stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()]] !=
|
if stg.kt_corrected != stg.kt_read:
|
||||||
stg.kt_read[self.combobox_acoustic_data_choice.currentIndex()]):
|
|
||||||
|
|
||||||
kt2D = np.repeat(
|
kt2D = np.repeat(
|
||||||
np.array([[stg.kt_corrected[key] for key in stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()]]]).transpose(),
|
np.array([stg.kt_corrected]).transpose(),
|
||||||
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape[1],
|
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape[1],
|
||||||
axis=1)
|
axis=1)
|
||||||
kt3D = np.repeat(
|
kt3D = np.repeat(
|
||||||
|
|
@ -1604,7 +1652,7 @@ class SedimentCalibrationTab(QWidget):
|
||||||
else:
|
else:
|
||||||
|
|
||||||
kt2D = np.repeat(
|
kt2D = np.repeat(
|
||||||
np.array([stg.kt_read[self.combobox_acoustic_data_choice.currentIndex()]]).transpose(),
|
np.array([stg.kt_read]).transpose(),
|
||||||
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape[1],
|
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape[1],
|
||||||
axis=1)
|
axis=1)
|
||||||
print(stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape)
|
print(stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape)
|
||||||
|
|
@ -1636,11 +1684,10 @@ class SedimentCalibrationTab(QWidget):
|
||||||
print("kt cor ", stg.kt_corrected)
|
print("kt cor ", stg.kt_corrected)
|
||||||
print("kt read", stg.kt_read)
|
print("kt read", stg.kt_read)
|
||||||
|
|
||||||
if ([stg.kt_corrected[key] for key in stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()]] !=
|
if (stg.kt_corrected != stg.kt_read):
|
||||||
stg.kt_read[self.combobox_acoustic_data_choice.currentIndex()]):
|
|
||||||
|
|
||||||
kt2D = np.repeat(
|
kt2D = np.repeat(
|
||||||
np.array([[stg.kt_corrected[key] for key in stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()]]]).transpose(),
|
np.array([stg.kt_corrected]).transpose(),
|
||||||
stg.time[self.combobox_acoustic_data_choice.currentIndex()].shape[1],
|
stg.time[self.combobox_acoustic_data_choice.currentIndex()].shape[1],
|
||||||
axis=1)
|
axis=1)
|
||||||
kt3D = np.repeat(
|
kt3D = np.repeat(
|
||||||
|
|
@ -1651,7 +1698,7 @@ class SedimentCalibrationTab(QWidget):
|
||||||
else:
|
else:
|
||||||
|
|
||||||
kt2D = np.repeat(
|
kt2D = np.repeat(
|
||||||
np.array([stg.kt_read[self.combobox_acoustic_data_choice.currentIndex()]]).transpose(),
|
np.array([stg.kt_read]).transpose(),
|
||||||
stg.time[self.combobox_acoustic_data_choice.currentIndex()].shape[1],
|
stg.time[self.combobox_acoustic_data_choice.currentIndex()].shape[1],
|
||||||
axis=1)
|
axis=1)
|
||||||
print(stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape)
|
print(stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape)
|
||||||
|
|
@ -1685,11 +1732,10 @@ class SedimentCalibrationTab(QWidget):
|
||||||
print("kt cor ", stg.kt_corrected)
|
print("kt cor ", stg.kt_corrected)
|
||||||
print("kt read", stg.kt_read)
|
print("kt read", stg.kt_read)
|
||||||
|
|
||||||
if ([stg.kt_corrected[key] for key in stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()]] !=
|
if (stg.kt_corrected != stg.kt_read):
|
||||||
stg.kt_read[self.combobox_acoustic_data_choice.currentIndex()]):
|
|
||||||
|
|
||||||
kt2D = np.repeat(
|
kt2D = np.repeat(
|
||||||
np.array([[stg.kt_corrected[key] for key in stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()]]]).transpose(),
|
np.array([stg.kt_corrected]).transpose(),
|
||||||
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape[1],
|
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape[1],
|
||||||
axis=1)
|
axis=1)
|
||||||
kt3D = np.repeat(
|
kt3D = np.repeat(
|
||||||
|
|
@ -1700,7 +1746,7 @@ class SedimentCalibrationTab(QWidget):
|
||||||
else:
|
else:
|
||||||
|
|
||||||
kt2D = np.repeat(
|
kt2D = np.repeat(
|
||||||
np.array([stg.kt_read[self.combobox_acoustic_data_choice.currentIndex()]]).transpose(),
|
np.array([stg.kt_read]).transpose(),
|
||||||
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape[1],
|
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape[1],
|
||||||
axis=1)
|
axis=1)
|
||||||
print(stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape)
|
print(stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape)
|
||||||
|
|
@ -1732,11 +1778,10 @@ class SedimentCalibrationTab(QWidget):
|
||||||
print("kt cor ", stg.kt_corrected)
|
print("kt cor ", stg.kt_corrected)
|
||||||
print("kt read", stg.kt_read)
|
print("kt read", stg.kt_read)
|
||||||
|
|
||||||
if ([stg.kt_corrected[key] for key in stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()]] !=
|
if (stg.kt_corrected != stg.kt_read):
|
||||||
stg.kt_read[self.combobox_acoustic_data_choice.currentIndex()]):
|
# print([stg.kt_corrected[key] for key in stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()]])
|
||||||
print([stg.kt_corrected[key] for key in stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()]])
|
|
||||||
kt2D = np.repeat(
|
kt2D = np.repeat(
|
||||||
np.array([[stg.kt_corrected[key] for key in stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()]]]).transpose(),
|
np.array([stg.kt_corrected]).transpose(),
|
||||||
stg.time[self.combobox_acoustic_data_choice.currentIndex()].shape[1],
|
stg.time[self.combobox_acoustic_data_choice.currentIndex()].shape[1],
|
||||||
axis=1)
|
axis=1)
|
||||||
kt3D = np.repeat(
|
kt3D = np.repeat(
|
||||||
|
|
@ -1747,7 +1792,7 @@ class SedimentCalibrationTab(QWidget):
|
||||||
else:
|
else:
|
||||||
|
|
||||||
kt2D = np.repeat(
|
kt2D = np.repeat(
|
||||||
np.array([stg.kt_read[self.combobox_acoustic_data_choice.currentIndex()]]).transpose(),
|
np.array([stg.kt_read]).transpose(),
|
||||||
stg.time[self.combobox_acoustic_data_choice.currentIndex()].shape[1],
|
stg.time[self.combobox_acoustic_data_choice.currentIndex()].shape[1],
|
||||||
axis=1)
|
axis=1)
|
||||||
print(stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape)
|
print(stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape)
|
||||||
|
|
@ -2110,10 +2155,10 @@ class SedimentCalibrationTab(QWidget):
|
||||||
|
|
||||||
dir_save_cal = QFileDialog.getExistingDirectory(
|
dir_save_cal = QFileDialog.getExistingDirectory(
|
||||||
caption="Save calibration",
|
caption="Save calibration",
|
||||||
directory=[stg.path_calibration_save_file if stg.path_calibration_save_file else stg.path_BS_raw_data[-1] if self.combobox_acoustic_data_choice.count() > 0 else ""][0],
|
directory=[stg.path_calibration_file if stg.path_calibration_file else stg.path_BS_raw_data[-1] if self.combobox_acoustic_data_choice.count() > 0 else ""][0],
|
||||||
options=QFileDialog.DontUseNativeDialog)
|
options=QFileDialog.DontUseNativeDialog)
|
||||||
|
|
||||||
stg.path_calibration_save_file = path.dirname(dir_save_cal)
|
stg.path_calibration_file = path.dirname(dir_save_cal)
|
||||||
|
|
||||||
cal_array = [[' ', stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()][stg.frequencies_for_calibration[0][1]],
|
cal_array = [[' ', stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()][stg.frequencies_for_calibration[0][1]],
|
||||||
stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()][stg.frequencies_for_calibration[1][1]]],
|
stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()][stg.frequencies_for_calibration[1][1]]],
|
||||||
|
|
|
||||||
|
|
@ -213,9 +213,8 @@ frequencies_for_calibration = []
|
||||||
range_lin_interp = []
|
range_lin_interp = []
|
||||||
M_profile_fine = []
|
M_profile_fine = []
|
||||||
|
|
||||||
path_calibration_save_file = ""
|
path_calibration_file = ""
|
||||||
path_calibration_import_file = ""
|
filename_calibration_file = ""
|
||||||
filename_calibration_import_file = ""
|
|
||||||
|
|
||||||
ks = []
|
ks = []
|
||||||
sv = []
|
sv = []
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue