Compare commits

...

13 Commits

16 changed files with 478 additions and 300 deletions

View File

@ -99,6 +99,7 @@ class CreateTableForSaveAs:
ID INTEGER PRIMARY KEY AUTOINCREMENT,
acoustic_data INTEGER,
temperature FLOAT,
distance_to_free_surface FLOAT,
tmin_index FLOAT, tmin_value FLOAT,
tmax_index FLOAT, tmax_value FLOAT,
rmin_index FLOAT, rmin_value FLOAT,
@ -312,11 +313,9 @@ class CreateTableForSaveAs:
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
""",
(
stg.acoustic_data[i], #stg.date[i], stg.hour[i],
str(stg.date[i].year) + str('-')
+ str(stg.date[i].month) + str('-')
+ str(stg.date[i].day),
str(stg.hour[i].hour) + str(':') + str(stg.hour[i].minute),
stg.acoustic_data[i],
stg.date[i].isoformat(),
stg.hour[i].isoformat(),
stg.freq[i][j],
stg.water_attenuation[i][j],
stg.kt_read[j], stg.kt_corrected[j],
@ -410,16 +409,17 @@ class CreateTableForSaveAs:
cur.execute(
"""
INSERT into Settings(
acoustic_data, temperature,
acoustic_data, temperature, distance_to_free_surface,
tmin_index, tmin_value, tmax_index, tmax_value,
rmin_index, rmin_value, rmax_index, rmax_value,
freq_bottom_detection_index, freq_bottom_detection_value,
SNR_filter_value, Nb_cells_to_average_BS_signal
)
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
""",
(
stg.acoustic_data[i], stg.temperature,
stg.distance_from_ABS_to_free_surface[i],
stg.tmin[i][0], stg.tmin[i][1],
stg.tmax[i][0], stg.tmax[i][1],
stg.rmin[i][0], stg.rmin[i][1],
@ -543,7 +543,8 @@ class CreateTableForSaveAs:
np.array(stg.X_exponent).tobytes(),
np.array(stg.alpha_s).tobytes(),
np.array(stg.zeta).tobytes(),
stg.FCB.tobytes(), stg.depth_real.tobytes(),
np.array(stg.FCB).tobytes(),
np.array(stg.depth_real).tobytes(),
np.array(stg.lin_reg).tobytes()
)
)

View File

@ -26,6 +26,8 @@ import sqlite3
import logging
import numpy as np
from datetime import date, time
from PyQt5.QtWidgets import QFileDialog, QApplication, QWidget, QTabWidget
import settings as stg
@ -33,6 +35,7 @@ from settings import BS_raw_data, acoustic_data
from View.acoustic_data_tab import AcousticDataTab
from tools import trace
logger = logging.getLogger("acoused")
@ -81,6 +84,7 @@ class ReadTableForOpen:
self.read_table_settings()
self.read_table_sediment_file()
self.read_table_table_sediment_data()
self.read_table_table_calibration()
logger.debug(f"Reading '{stg.filename_open}' done")
@ -113,6 +117,7 @@ class ReadTableForOpen:
stg.filename_BS_raw_data.append(
str(data[1]) + '.aqa'
)
stg.path_BS_raw_data.append("")
stg.ABS_name.append(data[2])
stg.path_BS_noise_data.append(data[3])
stg.filename_BS_noise_data.append(data[4])
@ -134,7 +139,7 @@ class ReadTableForOpen:
stg.hour = [0]*len(stg.acoustic_data)
for i in range(len(stg.acoustic_data)):
query1 = f'''
query = f'''
SELECT
acoustic_data, Date, Hour, frequency,
sound_attenuation, kt_read, kt_corrected, NbProfiles,
@ -144,38 +149,38 @@ class ReadTableForOpen:
FROM Measure
WHERE (acoustic_data = {i})
'''
data1 = self.execute(query1)
data = self.execute(query)
logger.debug(f"data1 for {i}: {data1}")
logger.debug(f"data for {i}: {data}")
stg.date[i] = data1[0][1]
stg.hour[i] = data1[0][2]
stg.date[i] = date.fromisoformat(data[0][1])
stg.hour[i] = time.fromisoformat(data[0][2])
stg.freq.append(
np.array([x[3] for x in data1])
np.array([x[3] for x in data])
)
stg.freq_text.append(
[str(x[3]*1e-6) + 'MHz' for x in data1]
[str(x[3]*1e-6) + 'MHz' for x in data]
)
stg.water_attenuation.append(
[x[4] for x in data1]
[x[4] for x in data]
)
stg.kt_read = [x[5] for x in data1]
stg.kt_corrected = [x[6] for x in data1]
stg.kt_read = [x[5] for x in data]
stg.kt_corrected = [x[6] for x in data]
stg.nb_profiles.append([x[7] for x in data1])
stg.nb_profiles_per_sec.append([x[8] for x in data1])
stg.nb_cells.append([x[9] for x in data1])
stg.cell_size.append([x[10] for x in data1])
stg.pulse_length.append([x[11] for x in data1])
stg.nb_profiles.append([x[7] for x in data])
stg.nb_profiles_per_sec.append([x[8] for x in data])
stg.nb_cells.append([x[9] for x in data])
stg.cell_size.append([x[10] for x in data])
stg.pulse_length.append([x[11] for x in data])
stg.nb_pings_per_sec.append(
[x[12] for x in data1]
[x[12] for x in data]
)
stg.nb_pings_averaged_per_profile.append(
[x[13] for x in data1]
[x[13] for x in data]
)
stg.gain_rx.append([x[14] for x in data1])
stg.gain_tx.append([x[15] for x in data1])
stg.gain_rx.append([x[14] for x in data])
stg.gain_tx.append([x[15] for x in data])
logger.debug("measure:")
logger.debug(f"- stg.acoustic_data: {stg.acoustic_data}")
@ -477,7 +482,7 @@ class ReadTableForOpen:
for s in range(len(stg.acoustic_data)):
query3 = f'''
SELECT
acoustic_data, temperature,
acoustic_data, temperature, distance_to_free_surface,
tmin_index, tmin_value, tmax_index, tmax_value,
rmin_index, rmin_value, rmax_index, rmax_value,
freq_bottom_detection_index, freq_bottom_detection_value,
@ -490,13 +495,14 @@ class ReadTableForOpen:
x = data[0]
stg.temperature = [x[1]][0]
stg.tmin.append((x[2], x[3]))
stg.tmax.append((x[4], x[5]))
stg.rmin.append((x[6], x[7]))
stg.rmax.append((x[8], x[9]))
stg.freq_bottom_detection.append((x[10], x[11]))
stg.SNR_filter_value.append(x[12])
stg.Nb_cells_to_average_BS_signal.append(x[13])
stg.distance_from_ABS_to_free_surface.append(x[2])
stg.tmin.append((x[3], x[4]))
stg.tmax.append((x[5], x[6]))
stg.rmin.append((x[7], x[8]))
stg.rmax.append((x[9], x[10]))
stg.freq_bottom_detection.append((x[11], x[12]))
stg.SNR_filter_value.append(x[13])
stg.Nb_cells_to_average_BS_signal.append(x[14])
logger.debug(f"stg.temperature: {stg.temperature}")
logger.debug(f"stg.tmin: {stg.tmin}")
@ -536,6 +542,7 @@ class ReadTableForOpen:
+ list(stg.radius_grain_sand)
)
@trace
def read_table_table_sediment_data(self):
np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)
@ -558,32 +565,32 @@ class ReadTableForOpen:
stg.frac_vol_sand = []
stg.frac_vol_sand_cumul = []
for f in range(len(data)):
stg.sample_fine.append((data[f][0], data[f][1]))
stg.distance_from_bank_fine.append(data[f][2])
stg.depth_fine.append(data[f][3])
stg.time_fine.append(data[f][4])
stg.Ctot_fine.append(data[f][5])
stg.Ctot_fine_per_cent.append(data[f][6])
stg.D50_fine.append(data[f][7])
for d in data:
stg.sample_fine.append((d[0], d[1]))
stg.distance_from_bank_fine.append(d[2])
stg.depth_fine.append(d[3])
stg.time_fine.append(d[4])
stg.Ctot_fine.append(d[5])
stg.Ctot_fine_per_cent.append(d[6])
stg.D50_fine.append(d[7])
stg.frac_vol_fine.append(
np_f64_parse(data[f][8])
np_f64_parse(d[8])
)
stg.frac_vol_fine_cumul.append(
np_f64_parse(data[f][9])
np_f64_parse(d[9])
)
stg.sample_sand.append((data[f][10], data[f][11]))
stg.distance_from_bank_sand.append(data[f][12])
stg.depth_sand.append(data[f][13])
stg.time_sand.append(data[f][14])
stg.Ctot_sand.append(data[f][15])
stg.Ctot_sand_per_cent.append(data[f][16])
stg.D50_sand.append(data[f][17])
stg.sample_sand.append((d[10], d[11]))
stg.distance_from_bank_sand.append(d[12])
stg.depth_sand.append(d[13])
stg.time_sand.append(d[14])
stg.Ctot_sand.append(d[15])
stg.Ctot_sand_per_cent.append(d[16])
stg.D50_sand.append(d[17])
stg.frac_vol_sand.append(
np_f64_parse(data[f][18])
np_f64_parse(d[18])
)
stg.frac_vol_sand_cumul.append(
np_f64_parse(data[f][19])
np_f64_parse(d[19])
)
stg.frac_vol_fine = np.array(stg.frac_vol_fine)
@ -592,3 +599,36 @@ class ReadTableForOpen:
stg.frac_vol_sand_cumul = np.array(stg.frac_vol_sand_cumul)
logger.debug(f"fine: {stg.Ctot_fine}, sand: {stg.sample_sand}")
@trace
def read_table_table_calibration(self):
np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)
query = f'''
SELECT
path_calibration_file,
filename_calibration_file,
range_lin_interp,
M_profile_fine,
ks, sv,
X_exponent,
alpha_s, zeta, FCB,
depth_real, lin_reg
FROM Calibration
'''
data = self.execute(query)
it = iter(data[0])
stg.path_calibration_file = next(it)
stg.filename_calibration_file = next(it)
stg.range_lin_interp = np_f64_parse(next(it))
stg.M_profile_fine = np_f64_parse(next(it))
stg.ks = np_f64_parse(next(it))
stg.sv = np_f64_parse(next(it))
stg.X_exponent = np_f64_parse(next(it))
stg.alpha_s = np_f64_parse(next(it))
stg.zeta = np_f64_parse(next(it))
stg.FCB = np_f64_parse(next(it))
stg.depth_real = np_f64_parse(next(it))
stg.lin_reg = np_f64_parse(next(it))

View File

@ -147,15 +147,8 @@ class UpdateTableForSave:
) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)''',
(
stg.acoustic_data[i],
(
str(stg.date[i].year) + str('-') +
str(stg.date[i].month) + str('-') +
str(stg.date[i].day)
),
(
str(stg.hour[i].hour) + str(':') +
str(stg.hour[i].minute)
),
stg.date[i].isoformat(),
stg.hour[i].isoformat(),
stg.freq[i][j],
stg.water_attenuation[i][j],
stg.kt_read[j],
@ -214,21 +207,29 @@ class UpdateTableForSave:
BS_mean)
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)''',
(stg.acoustic_data[i], stg.time[i].tobytes(), stg.depth[i].tobytes(), stg.BS_raw_data[i].tobytes(),
stg.time_reshape[i].tobytes(), stg.depth_reshape[i].tobytes(), stg.BS_raw_data_reshape[i].tobytes(),
stg.time_cross_section[i].tobytes(), stg.depth_cross_section[i].tobytes(), stg.BS_cross_section[i].tobytes(),
stg.BS_stream_bed[i].tobytes(),
stg.depth_bottom[i].tobytes(), stg.val_bottom[i].tobytes(), np.array(stg.ind_bottom[i]).tobytes(),
stg.time_noise[i].tobytes(), stg.depth_noise[i].tobytes(),
stg.BS_noise_raw_data[i].tobytes(),
stg.SNR_raw_data[i].tobytes(), stg.SNR_cross_section[i].tobytes(),
stg.SNR_stream_bed[i].tobytes(),
stg.BS_raw_data_pre_process_SNR[i].tobytes(),
stg.BS_raw_data_pre_process_average[i].tobytes(),
stg.BS_cross_section_pre_process_SNR[i].tobytes(),
stg.BS_cross_section_pre_process_average[i].tobytes(),
stg.BS_stream_bed_pre_process_SNR[i].tobytes(),
stg.BS_stream_bed_pre_process_average[i].tobytes(),
stg.BS_mean[i].tobytes()
stg.time_reshape[i].tobytes(),
stg.depth_reshape[i].tobytes(),
stg.BS_raw_data_reshape[i].tobytes(),
stg.time_cross_section[i].tobytes(),
stg.depth_cross_section[i].tobytes(),
stg.BS_cross_section[i].tobytes(),
np.array(stg.BS_stream_bed[i]).tobytes(),
np.array(stg.depth_bottom[i]).tobytes(),
np.array(stg.val_bottom[i]).tobytes(),
np.array(stg.ind_bottom[i]).tobytes(),
np.array(stg.time_noise[i]).tobytes(),
np.array(stg.depth_noise[i]).tobytes(),
np.array(stg.BS_noise_raw_data[i]).tobytes(),
np.array(stg.SNR_raw_data[i]).tobytes(),
np.array(stg.SNR_cross_section[i]).tobytes(),
np.array(stg.SNR_stream_bed[i]).tobytes(),
np.array(stg.BS_raw_data_pre_process_SNR[i]).tobytes(),
np.array(stg.BS_raw_data_pre_process_average[i]).tobytes(),
np.array(stg.BS_cross_section_pre_process_SNR[i]).tobytes(),
np.array(stg.BS_cross_section_pre_process_average[i]).tobytes(),
np.array(stg.BS_stream_bed_pre_process_SNR[i]).tobytes(),
np.array(stg.BS_stream_bed_pre_process_average[i]).tobytes(),
np.array(stg.BS_mean[i]).tobytes()
)
)
@ -245,29 +246,48 @@ class UpdateTableForSave:
cur.execute(''' DROP TABLE Settings''')
cur.execute('''CREATE TABLE Settings(ID INTEGER PRIMARY KEY AUTOINCREMENT,
acoustic_data INTEGER,
temperature FLOAT,
tmin_index FLOAT, tmin_value FLOAT, tmax_index FLOAT, tmax_value FLOAT,
rmin_index FLOAT, rmin_value FLOAT, rmax_index FLOAT, rmax_value FLOAT,
freq_bottom_detection_index FLOAT, freq_bottom_detection_value STRING,
SNR_filter_value FLOAT, Nb_cells_to_average_BS_signal FLOAT
)'''
cur.execute('''
CREATE TABLE Settings(
ID INTEGER PRIMARY KEY AUTOINCREMENT,
acoustic_data INTEGER,
temperature FLOAT,
distance_to_free_surface FLOAT,
tmin_index FLOAT, tmin_value FLOAT,
tmax_index FLOAT, tmax_value FLOAT,
rmin_index FLOAT, rmin_value FLOAT,
rmax_index FLOAT, rmax_value FLOAT,
freq_bottom_detection_index FLOAT,
freq_bottom_detection_value STRING,
SNR_filter_value FLOAT,
Nb_cells_to_average_BS_signal FLOAT
)
'''
)
for i in stg.acoustic_data:
cur.execute('''INSERT into Settings(acoustic_data, temperature,
tmin_index, tmin_value, tmax_index, tmax_value,
rmin_index, rmin_value, rmax_index, rmax_value,
freq_bottom_detection_index, freq_bottom_detection_value,
SNR_filter_value, Nb_cells_to_average_BS_signal)
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)''',
(stg.acoustic_data[i], stg.temperature,
stg.tmin[i][0], stg.tmin[i][1], stg.tmax[i][0], stg.tmax[i][1],
stg.rmin[i][0], stg.rmin[i][1], stg.rmax[i][0], stg.rmax[i][1],
stg.freq_bottom_detection[i][0], stg.freq_bottom_detection[i][1],
stg.SNR_filter_value[i], stg.Nb_cells_to_average_BS_signal[i])
cur.execute('''
INSERT into Settings(
acoustic_data, temperature,
distance_to_free_surface,
tmin_index, tmin_value, tmax_index, tmax_value,
rmin_index, rmin_value, rmax_index, rmax_value,
freq_bottom_detection_index, freq_bottom_detection_value,
SNR_filter_value, Nb_cells_to_average_BS_signal
) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
''',
(
stg.acoustic_data[i], stg.temperature,
stg.distance_from_ABS_to_free_surface[i],
stg.tmin[i][0], stg.tmin[i][1],
stg.tmax[i][0], stg.tmax[i][1],
stg.rmin[i][0], stg.rmin[i][1],
stg.rmax[i][0], stg.rmax[i][1],
stg.freq_bottom_detection[i][0],
stg.freq_bottom_detection[i][1],
stg.SNR_filter_value[i],
stg.Nb_cells_to_average_BS_signal[i]
)
)
cnx.commit()

View File

@ -23,6 +23,27 @@ from PyQt5.QtGui import QIcon, QPixmap, QFont
from PyQt5.QtWidgets import (QWidget, QLabel, QHBoxLayout, QVBoxLayout, QApplication, QMainWindow, QGridLayout,
QDialog, QDialogButtonBox, QPushButton, QTextEdit, QFrame, QLineEdit)
from PyQt5.QtCore import Qt
import os
class Logos():
def __init__(self):
self.logo_AcouSed = (os.path.join('logos', "AcouSed.png"))
self.logo_INRAE = (os.path.join('logos', "BlocMarque-INRAE-Inter.jpg"))
self.logo_OSR = (os.path.join('logos', "OSR.png"))
self.logo_europe = (os.path.join('logos', "Europe.png"))
self.logo_saone_rhone = (os.path.join('logos', "plan_Rhone_Saone.png"))
self.logo_carnot = (os.path.join('logos', "Carnot_EE.png"))
self.logo_CNR = (os.path.join('logos', "CNR.png"))
self.logo_EDF = (os.path.join('logos', "EDF.png"))
self.logo_Ubertone = (os.path.join('logos', "Ubertone.jpg"))
logos_inst = Logos()
class AboutWindow(QDialog):
@ -31,12 +52,6 @@ class AboutWindow(QDialog):
super().__init__()
self.logo_path = "./logos"
self.logo_AcouSed = QPixmap(self.logo_path + "/" + "AcouSed.png")
self.logo_AcouSed.scaled(16, 16, Qt.KeepAspectRatio, Qt.SmoothTransformation)
self.logo_INRAE = QPixmap(self.logo_path + "/" + "BlocMarque-INRAE-Inter.jpg")
self.setGeometry(400, 200, 350, 200)
self.setWindowTitle("About AcouSed")
@ -50,7 +65,8 @@ class AboutWindow(QDialog):
# ----------------------------------------------------------
self.label_logo_AcouSed = QLabel()
self.label_logo_AcouSed.setPixmap(self.logo_AcouSed.scaledToHeight(128, Qt.SmoothTransformation))
self.label_logo_AcouSed.setPixmap(QPixmap(logos_inst.logo_AcouSed).
scaledToHeight(128, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_logo_AcouSed, 0, 0, 5, 1, Qt.AlignCenter)
self.label_acoused = QLabel()
@ -64,7 +80,7 @@ class AboutWindow(QDialog):
self.gridLayout.addWidget(self.label_date, 1, 1, 1, 1, Qt.AlignCenter)
self.label_logo_INRAE = QLabel()
self.label_logo_INRAE.setPixmap(self.logo_INRAE.scaledToHeight(42, Qt.SmoothTransformation))
self.label_logo_INRAE.setPixmap(QPixmap(logos_inst.logo_INRAE).scaledToHeight(42, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_logo_INRAE, 2, 1, 1, 1, Qt.AlignCenter)
self.label_contact = QLabel()
@ -103,11 +119,17 @@ class AboutWindow(QDialog):
self.button_Copyright.clicked.connect(self.copyright_window)
self.button_Support = QPushButton()
self.button_Support.setText("Support")
self.gridLayout_button.addWidget(self.button_Support, 0, 2, 1, 1)
self.button_FundsPartners = QPushButton()
self.button_FundsPartners.setText("Funds/Patners")
self.gridLayout_button.addWidget(self.button_FundsPartners, 0, 2, 1, 1)
self.button_Support.clicked.connect(self.support_window)
self.button_FundsPartners.clicked.connect(self.funds_partners_window)
self.button_Authors = QPushButton()
self.button_Authors.setText("Authors")
self.gridLayout_button.addWidget(self.button_Authors, 0, 3, 1, 1)
self.button_Authors.clicked.connect(self.authors_window)
def licence_window(self):
lw = Licence()
@ -117,8 +139,12 @@ class AboutWindow(QDialog):
cw = Copyright()
cw.exec()
def support_window(self):
sw = Support()
def funds_partners_window(self):
sw = FundsPartners()
sw.exec()
def authors_window(self):
sw = Authors()
sw.exec()
@ -149,7 +175,7 @@ class Licence(QDialog):
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \n"
"GNU General Public License for more details. \n\n"
"You should have received a copy of the GNU General Public License \n"
"along with this program. If not, see <https://www.gnu.org/licenses/>.")
"along with this program. If not, see https://www.gnu.org/licenses/.")
class Copyright(QDialog):
@ -158,9 +184,6 @@ class Copyright(QDialog):
super().__init__()
self.logo_path = "./Logo"
self.logo_INRAE = QPixmap(self.logo_path + "/" + "BlocMarque-INRAE-Inter.jpg")
self.setWindowTitle("Copyright")
self.setGeometry(500, 300, 200, 200)
@ -175,24 +198,17 @@ class Copyright(QDialog):
"All Rights Reserved.")
self.label_INRAE = QLabel()
self.label_INRAE.setPixmap(self.logo_INRAE.scaledToHeight(64, Qt.SmoothTransformation))
self.label_INRAE.setPixmap(QPixmap(logos_inst.logo_INRAE).scaledToHeight(64, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_INRAE, 1, 0, 1, 1, Qt.AlignCenter)
class Support(QDialog):
class FundsPartners(QDialog):
def __init__(self):
super().__init__()
self.logo_path = "./logos"
self.logo_OSR = QPixmap(self.logo_path + '/' + "OSR.png")
self.logo_CNR = QPixmap(self.logo_path + '/' + "CNR.png")
self.logo_EDF = QPixmap(self.logo_path + '/' + "EDF.png")
self.logo_Ubertone = QPixmap(self.logo_path + '/' + "Ubertone.jpeg")
self.setWindowTitle("Support")
self.setWindowTitle("Funds/Partners")
self.setGeometry(500, 300, 300, 300)
@ -200,28 +216,85 @@ class Support(QDialog):
self.setLayout(self.gridLayout)
self.label_support = QLabel()
self.label_support.setText("The development of AcouSed was supported by OSR6 and CNR Company.")
self.gridLayout.addWidget(self.label_support, 0, 0, 1, 2, Qt.AlignLeft)
self.label_support.setText("The development of AcouSed software was funded by OSR, Carnot Eau & Environnement, INRAE and CNR Company. \n "
"It was made in collaboration with Ubertone and EDF Companies.")
self.gridLayout.addWidget(self.label_support, 0, 0, 1, 4, Qt.AlignLeft)
self.label_OSR = QLabel()
self.label_OSR.setPixmap(self.logo_OSR.scaledToHeight(96, Qt.SmoothTransformation))
self.label_OSR.setPixmap(QPixmap(logos_inst.logo_OSR).scaledToHeight(78, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_OSR, 1, 0, 1, 1, Qt.AlignCenter)
self.label_CNR = QLabel()
self.label_CNR.setPixmap(self.logo_CNR.scaledToHeight(32, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_CNR, 1, 1, 1, 1, Qt.AlignCenter)
self.label_EUROPE = QLabel()
self.label_EUROPE.setPixmap(QPixmap(logos_inst.logo_europe).scaledToHeight(32, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_EUROPE, 1, 1, 1, 1, Qt.AlignCenter)
self.label_collaboration = QLabel()
self.label_collaboration.setText("It was made in collaboration with Ubertone and EDF Companies.")
self.gridLayout.addWidget(self.label_collaboration, 2, 0, 1, 2, Qt.AlignLeft)
self.label_SAONE_RHONE = QLabel()
self.label_SAONE_RHONE.setPixmap(QPixmap(logos_inst.logo_saone_rhone).scaledToHeight(64, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_SAONE_RHONE, 1, 2, 1, 1, Qt.AlignCenter)
self.label_CARNOT = QLabel()
self.label_CARNOT.setPixmap(QPixmap(logos_inst.logo_carnot).scaledToHeight(78, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_CARNOT, 1, 3, 1, 1, Qt.AlignCenter)
self.label_INRAE = QLabel()
self.label_INRAE.setPixmap(QPixmap(logos_inst.logo_INRAE).scaledToHeight(32, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_INRAE, 2, 0, 1, 1, Qt.AlignCenter)
self.label_CNR = QLabel()
self.label_CNR.setPixmap(QPixmap(logos_inst.logo_CNR).scaledToHeight(32, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_CNR, 2, 1, 1, 1, Qt.AlignCenter)
self.label_Ubertone = QLabel()
self.label_Ubertone.setPixmap(self.logo_Ubertone.scaledToHeight(48, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_Ubertone, 3, 0, 1, 1, Qt.AlignCenter)
self.label_Ubertone.setPixmap(QPixmap(logos_inst.logo_Ubertone).scaledToHeight(24, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_Ubertone, 2, 2, 1, 1, Qt.AlignCenter)
self.label_EDF = QLabel()
self.label_EDF.setPixmap(self.logo_EDF.scaledToHeight(48, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_EDF, 3, 1, 1, 1, Qt.AlignCenter)
self.label_EDF.setPixmap(QPixmap(logos_inst.logo_EDF).scaledToHeight(48, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_EDF, 2, 3, 1, 1, Qt.AlignCenter)
class Authors(QDialog):
def __init__(self):
super().__init__()
self.setWindowTitle("Authors")
self.setGeometry(500, 300, 300, 200)
self.gridLayout = QGridLayout()
self.setLayout(self.gridLayout)
self.label_adrien = QLabel()
self.label_adrien.setText("The development of AcouSed was based on Adrien VERGNE's PhD thesis work :")
self.gridLayout.addWidget(self.label_adrien, 0, 0, 1, 1, Qt.AlignLeft)
self.label_adrien_thesis = QLabel()
self.label_adrien_thesis.setText(
" - Adrien Vergne thesis (2018): "
"< a href = https://theses.fr/2018GREAU046 > https://theses.fr/2018GREAU046 </a>")
self.gridLayout.addWidget(self.label_adrien_thesis, 1, 0, 1, 1)
self.label_adrien_2020 = QLabel()
self.label_adrien_2020.setText(
" - Vergne A., Le Coz J., Berni C., & Pierrefeu G. (2020), Water Resources Research, 56(2): "
"< a href = https://doi.org/10.1029/2019WR024877 > https://doi.org/10.1029/2019WR024877 </a>")
self.gridLayout.addWidget(self.label_adrien_2020, 2, 0, 1, 1)
self.label_adrien_2021 = QLabel()
self.label_adrien_2021.setText(
" - Vergne A., Berni C., Le Coz J., & Tencé F., (2021), Water Resources Research, 57(9): "
"< a href = https://doi.org/10.1029/2021WR029589 > https://doi.org/10.1029/2021WR029589 </a>")
self.gridLayout.addWidget(self.label_adrien_2021, 3, 0, 1, 1)
self.label_brahim = QLabel()
self.label_brahim.setText("\n Acoused was designed and developped by Brahim MOUDJED from 2022 to 2025. \n")
self.gridLayout.addWidget(self.label_brahim, 4, 0, 1, 1)
self.label_PA = QLabel()
self.label_PA.setText("TECC company (< a href = https://parouby.fr/ > https://parouby.fr/ </a>) was involved in 2025 to improve program architecture.")
self.gridLayout.addWidget(self.label_PA, 5, 0, 1, 1)
# if __name__ == "__main__":

View File

@ -59,6 +59,7 @@ from Model.acoustic_data_loader import AcousticDataLoader
from Model.acoustic_data_loader_UBSediFlow import AcousticDataLoaderUBSediFlow
from Model.calibration_constant_kt import CalibrationConstantKt
from tools import trace
locale.setlocale(locale.LC_ALL, '')
@ -733,6 +734,7 @@ class AcousticDataTab(QWidget):
# -------------------- Functions for Acoustic dataTab --------------------
@trace
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)
@ -842,7 +844,6 @@ class AcousticDataTab(QWidget):
self.groupbox_measurement_information_UBSediFlow()
def groupbox_measurement_information_no_ABS(self):
self.label_ABS_name.hide()
self.combobox_ABS_name.hide()
@ -1190,15 +1191,22 @@ class AcousticDataTab(QWidget):
self.lineEdit_distance_from_ABS_to_free_surface.setText("0.00")
else:
stg.distance_from_ABS_to_free_surface[self.fileListWidget\
.currentRow()] = (
stg.distance_from_ABS_to_free_surface[
self.fileListWidget.currentRow()
] = (
float(
self.lineEdit_distance_from_ABS_to_free_surface\
.text().replace(",", ".")
)
)
self.lineEdit_distance_from_ABS_to_free_surface.setText(
str("%4s" % stg.distance_from_ABS_to_free_surface[self.fileListWidget.currentRow()]))
str(
"%4s" % stg.distance_from_ABS_to_free_surface[
self.fileListWidget.currentRow()
]
)
)
def refresh_distance_from_ABS_to_free_surface(self):
self.pushbutton_distance_from_ABS_to_free_surface.blockSignals(True)
@ -1777,6 +1785,10 @@ class AcousticDataTab(QWidget):
.currentIndexChanged\
.connect(self.combobox_frequency_information_update)
self.lineEdit_distance_from_ABS_to_free_surface.setText(
str(stg.distance_from_ABS_to_free_surface[file_id])
)
logger.debug(f"Set temperature = {stg.temperature}")
self.lineEdit_temperature.setText(str(stg.temperature))

View File

@ -48,6 +48,7 @@ from View.checkable_combobox import CheckableComboBox
import settings as stg
from Model.acoustic_inversion_method_high_concentration import AcousticInversionMethodHighConcentration
from tools import trace
_translate = QCoreApplication.translate
@ -371,6 +372,7 @@ class AcousticInversionTab(QWidget):
# ------------------------------------ Functions for Acoustic Inversion Tab ----------------------------------------
# ==================================================================================================================
@trace
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)

View File

@ -10,6 +10,8 @@ from PyQt5.QtCore import Qt
import settings as stg
from tools import trace
logger = logging.getLogger("acoused")
class NoteTab(QWidget):
@ -136,7 +138,7 @@ class NoteTab(QWidget):
## ---------- Functions ----------
## -------------------------------
@trace
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)

View File

@ -28,6 +28,7 @@ import pandas as pd
import itertools
import matplotlib.pyplot as plt
# from QtCore.QByteArray import length
from matplotlib.colors import LogNorm, BASE_COLORS
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolBar
@ -48,6 +49,8 @@ import Translation.constant_string as cs
import settings as stg
from tools import trace
_translate = QCoreApplication.translate
logger = logging.getLogger("acoused")
@ -189,6 +192,9 @@ class SampleDataTab(QWidget):
self.combobox_x_axis = QComboBox()
self.combobox_x_axis.addItems(['Concentration (g/L)', 'Concentration (%)'])
self.combobox_x_axis.setItemData(1,
"FINE : 100 * Cfine / (Cfine + Csand) | SAND : 100 * Csand / (Cfine + Csand)"
, Qt.ToolTipRole)
self.gridLayout_groupbox_option_total_concentration_plot.addWidget(self.combobox_x_axis, 0, 1)
self.label_y_axis = QLabel()
@ -246,6 +252,9 @@ class SampleDataTab(QWidget):
self.pushbutton_plot_transect.clicked.connect(self.fill_comboboxes_and_plot_transect)
self.combobox_x_axis.currentIndexChanged.connect(self.plot_total_concentration)
self.combobox_y_axis.currentIndexChanged.connect(self.plot_total_concentration)
self.combobox_PSD_plot.currentTextChanged.connect(self.plot_PSD_fine_and_sand_sediments)
# -------------------- Functions for Sample Data Tab --------------------
@ -271,6 +280,7 @@ class SampleDataTab(QWidget):
self.groupbox_plot_PSD.setTitle(_translate("CONSTANT_STRING", cs.DISTRIBUTION_PLOT))
@trace
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)
@ -450,6 +460,8 @@ class SampleDataTab(QWidget):
i, 0, self.comboBox_sample_table_fine[i]
)
self.comboBox_sample_table_fine[i].setCurrentIndex(i % len(list(color_list.keys())))
self.comboBox_sample_table_fine[i]\
.currentTextChanged\
.connect(self.plot_total_concentration)
@ -466,7 +478,8 @@ class SampleDataTab(QWidget):
self.item_checkbox_fine.setCheckState(Qt.Checked)
self.tableWidget_fine.setItem(i, 1, self.item_checkbox_fine)
self.item_checkbox_fine.setText("F" + str(i + 1))
stg.sample_fine.append(("F" + str(i + 1), i))
if len(stg.sample_fine) <= i:
stg.sample_fine.append(("F" + str(i + 1), i))
# --- Fill table with data ---
for i in range(stg.frac_vol_fine.shape[0]):
@ -495,8 +508,8 @@ class SampleDataTab(QWidget):
self.tableWidget_fine.itemChanged.connect(self.plot_total_concentration)
self.tableWidget_fine.itemChanged.connect(self.plot_PSD_fine_and_sand_sediments)
self.combobox_x_axis.currentIndexChanged.connect(self.plot_total_concentration)
self.combobox_y_axis.currentIndexChanged.connect(self.plot_total_concentration)
# self.combobox_x_axis.currentIndexChanged.connect(self.plot_total_concentration)
# self.combobox_y_axis.currentIndexChanged.connect(self.plot_total_concentration)
self.tableWidget_fine.blockSignals(False)
else:
@ -543,6 +556,8 @@ class SampleDataTab(QWidget):
i, 0, self.comboBox_sample_table_sand[i]
)
self.comboBox_sample_table_sand[i].setCurrentIndex(i % len(list(color_list.keys())))
self.comboBox_sample_table_sand[i]\
.currentTextChanged\
.connect(self.plot_total_concentration)
@ -559,7 +574,8 @@ class SampleDataTab(QWidget):
self.item_checkbox_sand.setCheckState(Qt.Checked)
self.tableWidget_sand.setItem(i, 1, self.item_checkbox_sand)
self.item_checkbox_sand.setText("S" + str(i + 1))
stg.sample_sand.append(("S" + str(i + 1), i))
if len(stg.sample_sand) <= i:
stg.sample_sand.append(("S" + str(i + 1), i))
# --- Fill table with data ---
for i in range(stg.frac_vol_sand.shape[0]):
@ -1391,6 +1407,11 @@ class SampleDataTab(QWidget):
else:
self.tableWidget_fine.blockSignals(True)
self.tableWidget_sand.blockSignals(True)
self.combobox_x_axis.blockSignals(True)
self.combobox_y_axis.blockSignals(True)
self.verticalLayout_groupbox_plot_total_concentration.removeWidget(self.canvas_plot_total_concentration)
self.verticalLayout_groupbox_plot_total_concentration.removeWidget(self.toolbar_plot_total_concentration)
@ -1656,6 +1677,11 @@ class SampleDataTab(QWidget):
self.axis_total_concentration.legend(loc="upper right")
self.figure_total_concentration.canvas.draw_idle()
self.tableWidget_fine.blockSignals(False)
self.tableWidget_sand.blockSignals(False)
self.combobox_x_axis.blockSignals(False)
self.combobox_y_axis.blockSignals(False)
def plot_PSD_fine_and_sand_sediments(self):
""" Update the plot of Particle Size Distribution according to choices of x-axis and y-axis combo-boxes """

View File

@ -48,6 +48,8 @@ import settings as stg
from View.checkable_combobox import CheckableComboBox
from Model.acoustic_inversion_method_high_concentration import AcousticInversionMethodHighConcentration
from tools import trace
logger = logging.getLogger("acoused")
class SedimentCalibrationTab(QWidget):
@ -857,6 +859,7 @@ class SedimentCalibrationTab(QWidget):
# ----------------------------------- Functions for Signal processing Tab --------------------------------------
# ==============================================================================================================
@trace
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)
@ -873,7 +876,7 @@ class SedimentCalibrationTab(QWidget):
return
self.update_acoustic_data()
# self.compute_depth_2D()
self.compute_depth_2D()
def update_acoustic_data(self):
self.combobox_acoustic_data_choice.clear()
@ -931,11 +934,13 @@ class SedimentCalibrationTab(QWidget):
self.compute_FCB()
def plot_acoustic_recording(self):
data_id = self.combobox_acoustic_data_choice.currentIndex()
# --- Record frequencies for calibration ---
stg.frequencies_for_calibration.clear()
stg.frequencies_for_calibration.append(
(
stg.freq[self.combobox_acoustic_data_choice.currentIndex()][
stg.freq[data_id][
self.combobox_freq1.currentIndex()
],
self.combobox_freq1.currentIndex()
@ -943,7 +948,7 @@ class SedimentCalibrationTab(QWidget):
)
stg.frequencies_for_calibration.append(
(
stg.freq[self.combobox_acoustic_data_choice.currentIndex()][
stg.freq[data_id][
self.combobox_freq2.currentIndex()
],
self.combobox_freq2.currentIndex()
@ -952,7 +957,7 @@ class SedimentCalibrationTab(QWidget):
stg.frequency_for_inversion = tuple()
stg.frequency_for_inversion = (
stg.freq[self.combobox_acoustic_data_choice.currentIndex()][
stg.freq[data_id][
self.combobox_freq2.currentIndex()
],
self.combobox_freq2.currentIndex()
@ -970,18 +975,18 @@ class SedimentCalibrationTab(QWidget):
self.verticalLayout_groupbox_data_plot.addWidget(self.canvas_BS)
if stg.BS_stream_bed_pre_process_average[
self.combobox_acoustic_data_choice.currentIndex()
data_id
].shape != (0,):
val_min = np.nanmin(
stg.BS_stream_bed_pre_process_average[
self.combobox_acoustic_data_choice.currentIndex()
data_id
][
self.combobox_freq2.currentIndex(), :, :
]
)
val_max = np.nanmax(
stg.BS_stream_bed_pre_process_average[
self.combobox_acoustic_data_choice.currentIndex()
data_id
][
self.combobox_freq2.currentIndex(), :, :
]
@ -989,346 +994,346 @@ class SedimentCalibrationTab(QWidget):
if val_min == 0:
val_min = 1e-5
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.time_cross_section[data_id].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
elif stg.BS_stream_bed_pre_process_SNR[data_id].shape != (0,):
val_min = np.nanmin(
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :])
val_max = np.nanmax(
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.time_cross_section[data_id].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_stream_bed_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
elif stg.BS_stream_bed[data_id].shape != (0,):
val_min = np.nanmin(
stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(),
stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(),
:, :])
val_max = np.nanmax(
stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(),
stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(),
:, :])
if val_min == 0:
val_min = 1e-5
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.time_cross_section[data_id].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(),
stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(),
:, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(),
stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(),
:, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(),
stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(),
:, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(),
stg.BS_stream_bed[data_id][self.combobox_freq2.currentIndex(),
:, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
elif stg.BS_cross_section_pre_process_average[data_id].shape != (0,):
val_min = np.nanmin(
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :])
val_max = np.nanmax(
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.time_cross_section[data_id].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
elif stg.BS_cross_section_pre_process_SNR[data_id].shape != (0,):
val_min = np.nanmin(
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :])
val_max = np.nanmax(
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0):
if stg.time_cross_section[data_id].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0):
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0):
if stg.depth_cross_section[data_id].shape != (0):
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
elif stg.BS_cross_section[data_id].shape != (0,):
val_min = np.nanmin(
stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section[data_id][
self.combobox_freq2.currentIndex(), :, :])
val_max = np.nanmax(
stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section[data_id][
self.combobox_freq2.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.time_cross_section[data_id].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
else:
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.BS_cross_section[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
elif stg.BS_raw_data_pre_process_average[data_id].shape != (0,):
val_min = np.nanmin(stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
val_min = np.nanmin(stg.BS_raw_data_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
val_max = np.nanmax(stg.BS_raw_data_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :],
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][self.combobox_freq2.currentIndex(), :],
-stg.depth[data_id][self.combobox_freq2.currentIndex(), :],
stg.BS_raw_data_pre_process_average[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
elif stg.BS_raw_data_pre_process_SNR[data_id].shape != (0,):
val_min = np.nanmin(stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
val_min = np.nanmin(stg.BS_raw_data_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
val_max = np.nanmax(stg.BS_raw_data_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :],
stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][self.combobox_freq2.currentIndex(), :],
-stg.depth[data_id][self.combobox_freq2.currentIndex(), :],
stg.BS_raw_data_pre_process_SNR[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
elif stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
elif stg.BS_raw_data[data_id].shape != (0,):
val_min = np.nanmin(stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()][
val_min = np.nanmin(stg.BS_raw_data[data_id][
self.combobox_freq2.currentIndex(), :, :])
val_max = np.nanmax(stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()][
val_max = np.nanmax(stg.BS_raw_data[data_id][
self.combobox_freq2.currentIndex(), :, :])
if val_min == 0:
val_min = 1e-5
self.axis_BS.pcolormesh(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :],
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][self.combobox_freq2.currentIndex(), :],
stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][self.combobox_freq2.currentIndex(), :],
-stg.depth[data_id][self.combobox_freq2.currentIndex(), :],
stg.BS_raw_data[data_id][
self.combobox_freq2.currentIndex(), :, :],
cmap='viridis', norm=LogNorm(vmin=val_min, vmax=val_max))
@ -1367,16 +1372,16 @@ class SedimentCalibrationTab(QWidget):
# --- Plot vertical red line for position of FCB profile ---
if stg.sand_sample_target_indice:
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,):
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.time_cross_section[data_id].shape != (0,):
self.red_line_plot_return, = (
self.axis_BS.plot(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), stg.sand_sample_target_indice[0][1]] *
np.ones(stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape[1]),
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
np.ones(stg.depth_cross_section[data_id].shape[1]),
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
color='red', linestyle="solid", linewidth=2))
@ -1384,23 +1389,23 @@ class SedimentCalibrationTab(QWidget):
self.red_line_plot_return, = (
self.axis_BS.plot(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), stg.sand_sample_target_indice[0][1]] *
np.ones(stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape[1]),
-stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
np.ones(stg.depth_cross_section[data_id].shape[1]),
-stg.depth_cross_section[data_id][
self.combobox_freq2.currentIndex(), :],
color='red', linestyle="solid", linewidth=2))
else:
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
if stg.time_cross_section[data_id].shape != (0,):
self.red_line_plot_return, = (
self.axis_BS.plot(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][
stg.time_cross_section[data_id][
self.combobox_freq2.currentIndex(), stg.sand_sample_target_indice[0][1]] *
np.ones(stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape[1]),
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
np.ones(stg.depth[data_id].shape[1]),
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
color='red', linestyle="solid", linewidth=2))
@ -1408,10 +1413,10 @@ class SedimentCalibrationTab(QWidget):
self.red_line_plot_return, = (
self.axis_BS.plot(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][
stg.time[data_id][
self.combobox_freq2.currentIndex(), stg.sand_sample_target_indice[0][1]] *
np.ones(stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape[1]),
-stg.depth[self.combobox_acoustic_data_choice.currentIndex()][
np.ones(stg.depth[data_id].shape[1]),
-stg.depth[data_id][
self.combobox_freq2.currentIndex(), :],
color='red', linestyle="solid", linewidth=2))
@ -1941,13 +1946,12 @@ class SedimentCalibrationTab(QWidget):
def compute_depth_2D(self):
if self.combobox_acoustic_data_choice.count() > 0:
for k in range(self.combobox_acoustic_data_choice.count()):
while len(stg.depth_2D) <= k:
stg.depth_2D.append(np.array([]))
if stg.depth_cross_section[k].shape != (0,):
if stg.time_cross_section[k].shape != (0,):
stg.depth_2D[k] = (
np.zeros((stg.freq[k].shape[0],
stg.depth_cross_section[k].shape[1],
@ -1961,7 +1965,6 @@ class SedimentCalibrationTab(QWidget):
axis=1))
elif stg.time[k].shape != (0,):
stg.depth_2D[k] = (
np.zeros((stg.freq[k].shape[0],
stg.depth_cross_section[k].shape[1],
@ -1976,9 +1979,7 @@ class SedimentCalibrationTab(QWidget):
axis=1))
elif stg.depth[k].shape != (0,):
if stg.time_cross_section[k].shape != (0,):
stg.depth_2D[k] = (
np.zeros((stg.freq[k].shape[0],
stg.depth[k].shape[1],
@ -1993,7 +1994,6 @@ class SedimentCalibrationTab(QWidget):
axis=1))
elif stg.time[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
stg.depth_2D[k] = (
np.zeros((stg.freq[k].shape[0],
stg.depth[k].shape[1],

View File

@ -511,6 +511,7 @@ class SignalProcessingTab(QWidget):
self.icon_clear = QIcon(path_icon("clear.png"))
self.icon_apply = QIcon(path_icon("circle_green_arrow_right.png"))
@trace
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)

BIN
logos/Carnot_EE.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
logos/Europe.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

BIN
logos/Ubertone.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
logos/plan_Rhone_Saone.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -35,9 +35,10 @@ def trace(func):
f"{head} Return {func.__module__}." +
f"{func.__qualname__}: {value}"
)
dt = t1-t
logger.debug(
f"{head}[TIME] {func.__module__}." +
f"{func.__qualname__}: {t1-t} sec"
f"{func.__qualname__}: {dt:f} sec"
)
return value