Compare commits

..

No commits in common. "883d43adb4661af7e34e8d5f4028b1eb78ee209b" and "5ea7879896581d4537474b06d336a068396cfc2b" have entirely different histories.

16 changed files with 300 additions and 478 deletions

View File

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

View File

@ -26,8 +26,6 @@ import sqlite3
import logging import logging
import numpy as np import numpy as np
from datetime import date, time
from PyQt5.QtWidgets import QFileDialog, QApplication, QWidget, QTabWidget from PyQt5.QtWidgets import QFileDialog, QApplication, QWidget, QTabWidget
import settings as stg import settings as stg
@ -35,7 +33,6 @@ from settings import BS_raw_data, acoustic_data
from View.acoustic_data_tab import AcousticDataTab from View.acoustic_data_tab import AcousticDataTab
from tools import trace
logger = logging.getLogger("acoused") logger = logging.getLogger("acoused")
@ -84,7 +81,6 @@ class ReadTableForOpen:
self.read_table_settings() self.read_table_settings()
self.read_table_sediment_file() self.read_table_sediment_file()
self.read_table_table_sediment_data() self.read_table_table_sediment_data()
self.read_table_table_calibration()
logger.debug(f"Reading '{stg.filename_open}' done") logger.debug(f"Reading '{stg.filename_open}' done")
@ -117,7 +113,6 @@ class ReadTableForOpen:
stg.filename_BS_raw_data.append( stg.filename_BS_raw_data.append(
str(data[1]) + '.aqa' str(data[1]) + '.aqa'
) )
stg.path_BS_raw_data.append("")
stg.ABS_name.append(data[2]) stg.ABS_name.append(data[2])
stg.path_BS_noise_data.append(data[3]) stg.path_BS_noise_data.append(data[3])
stg.filename_BS_noise_data.append(data[4]) stg.filename_BS_noise_data.append(data[4])
@ -139,7 +134,7 @@ class ReadTableForOpen:
stg.hour = [0]*len(stg.acoustic_data) stg.hour = [0]*len(stg.acoustic_data)
for i in range(len(stg.acoustic_data)): for i in range(len(stg.acoustic_data)):
query = f''' query1 = f'''
SELECT SELECT
acoustic_data, Date, Hour, frequency, acoustic_data, Date, Hour, frequency,
sound_attenuation, kt_read, kt_corrected, NbProfiles, sound_attenuation, kt_read, kt_corrected, NbProfiles,
@ -149,38 +144,38 @@ class ReadTableForOpen:
FROM Measure FROM Measure
WHERE (acoustic_data = {i}) WHERE (acoustic_data = {i})
''' '''
data = self.execute(query) data1 = self.execute(query1)
logger.debug(f"data for {i}: {data}") logger.debug(f"data1 for {i}: {data1}")
stg.date[i] = date.fromisoformat(data[0][1]) stg.date[i] = data1[0][1]
stg.hour[i] = time.fromisoformat(data[0][2]) stg.hour[i] = data1[0][2]
stg.freq.append( stg.freq.append(
np.array([x[3] for x in data]) np.array([x[3] for x in data1])
) )
stg.freq_text.append( stg.freq_text.append(
[str(x[3]*1e-6) + 'MHz' for x in data] [str(x[3]*1e-6) + 'MHz' for x in data1]
) )
stg.water_attenuation.append( stg.water_attenuation.append(
[x[4] for x in data] [x[4] for x in data1]
) )
stg.kt_read = [x[5] for x in data] stg.kt_read = [x[5] for x in data1]
stg.kt_corrected = [x[6] for x in data] stg.kt_corrected = [x[6] for x in data1]
stg.nb_profiles.append([x[7] 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 data]) stg.nb_profiles_per_sec.append([x[8] for x in data1])
stg.nb_cells.append([x[9] for x in data]) stg.nb_cells.append([x[9] for x in data1])
stg.cell_size.append([x[10] for x in data]) stg.cell_size.append([x[10] for x in data1])
stg.pulse_length.append([x[11] for x in data]) stg.pulse_length.append([x[11] for x in data1])
stg.nb_pings_per_sec.append( stg.nb_pings_per_sec.append(
[x[12] for x in data] [x[12] for x in data1]
) )
stg.nb_pings_averaged_per_profile.append( stg.nb_pings_averaged_per_profile.append(
[x[13] for x in data] [x[13] for x in data1]
) )
stg.gain_rx.append([x[14] for x in data]) stg.gain_rx.append([x[14] for x in data1])
stg.gain_tx.append([x[15] for x in data]) stg.gain_tx.append([x[15] for x in data1])
logger.debug("measure:") logger.debug("measure:")
logger.debug(f"- stg.acoustic_data: {stg.acoustic_data}") logger.debug(f"- stg.acoustic_data: {stg.acoustic_data}")
@ -482,7 +477,7 @@ class ReadTableForOpen:
for s in range(len(stg.acoustic_data)): for s in range(len(stg.acoustic_data)):
query3 = f''' query3 = f'''
SELECT SELECT
acoustic_data, temperature, distance_to_free_surface, acoustic_data, temperature,
tmin_index, tmin_value, tmax_index, tmax_value, tmin_index, tmin_value, tmax_index, tmax_value,
rmin_index, rmin_value, rmax_index, rmax_value, rmin_index, rmin_value, rmax_index, rmax_value,
freq_bottom_detection_index, freq_bottom_detection_value, freq_bottom_detection_index, freq_bottom_detection_value,
@ -495,14 +490,13 @@ class ReadTableForOpen:
x = data[0] x = data[0]
stg.temperature = [x[1]][0] stg.temperature = [x[1]][0]
stg.distance_from_ABS_to_free_surface.append(x[2]) stg.tmin.append((x[2], x[3]))
stg.tmin.append((x[3], x[4])) stg.tmax.append((x[4], x[5]))
stg.tmax.append((x[5], x[6])) stg.rmin.append((x[6], x[7]))
stg.rmin.append((x[7], x[8])) stg.rmax.append((x[8], x[9]))
stg.rmax.append((x[9], x[10])) stg.freq_bottom_detection.append((x[10], x[11]))
stg.freq_bottom_detection.append((x[11], x[12])) stg.SNR_filter_value.append(x[12])
stg.SNR_filter_value.append(x[13]) stg.Nb_cells_to_average_BS_signal.append(x[13])
stg.Nb_cells_to_average_BS_signal.append(x[14])
logger.debug(f"stg.temperature: {stg.temperature}") logger.debug(f"stg.temperature: {stg.temperature}")
logger.debug(f"stg.tmin: {stg.tmin}") logger.debug(f"stg.tmin: {stg.tmin}")
@ -542,7 +536,6 @@ class ReadTableForOpen:
+ list(stg.radius_grain_sand) + list(stg.radius_grain_sand)
) )
@trace
def read_table_table_sediment_data(self): def read_table_table_sediment_data(self):
np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64) np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)
@ -565,32 +558,32 @@ class ReadTableForOpen:
stg.frac_vol_sand = [] stg.frac_vol_sand = []
stg.frac_vol_sand_cumul = [] stg.frac_vol_sand_cumul = []
for d in data: for f in range(len(data)):
stg.sample_fine.append((d[0], d[1])) stg.sample_fine.append((data[f][0], data[f][1]))
stg.distance_from_bank_fine.append(d[2]) stg.distance_from_bank_fine.append(data[f][2])
stg.depth_fine.append(d[3]) stg.depth_fine.append(data[f][3])
stg.time_fine.append(d[4]) stg.time_fine.append(data[f][4])
stg.Ctot_fine.append(d[5]) stg.Ctot_fine.append(data[f][5])
stg.Ctot_fine_per_cent.append(d[6]) stg.Ctot_fine_per_cent.append(data[f][6])
stg.D50_fine.append(d[7]) stg.D50_fine.append(data[f][7])
stg.frac_vol_fine.append( stg.frac_vol_fine.append(
np_f64_parse(d[8]) np_f64_parse(data[f][8])
) )
stg.frac_vol_fine_cumul.append( stg.frac_vol_fine_cumul.append(
np_f64_parse(d[9]) np_f64_parse(data[f][9])
) )
stg.sample_sand.append((d[10], d[11])) stg.sample_sand.append((data[f][10], data[f][11]))
stg.distance_from_bank_sand.append(d[12]) stg.distance_from_bank_sand.append(data[f][12])
stg.depth_sand.append(d[13]) stg.depth_sand.append(data[f][13])
stg.time_sand.append(d[14]) stg.time_sand.append(data[f][14])
stg.Ctot_sand.append(d[15]) stg.Ctot_sand.append(data[f][15])
stg.Ctot_sand_per_cent.append(d[16]) stg.Ctot_sand_per_cent.append(data[f][16])
stg.D50_sand.append(d[17]) stg.D50_sand.append(data[f][17])
stg.frac_vol_sand.append( stg.frac_vol_sand.append(
np_f64_parse(d[18]) np_f64_parse(data[f][18])
) )
stg.frac_vol_sand_cumul.append( stg.frac_vol_sand_cumul.append(
np_f64_parse(d[19]) np_f64_parse(data[f][19])
) )
stg.frac_vol_fine = np.array(stg.frac_vol_fine) stg.frac_vol_fine = np.array(stg.frac_vol_fine)
@ -599,36 +592,3 @@ class ReadTableForOpen:
stg.frac_vol_sand_cumul = np.array(stg.frac_vol_sand_cumul) stg.frac_vol_sand_cumul = np.array(stg.frac_vol_sand_cumul)
logger.debug(f"fine: {stg.Ctot_fine}, sand: {stg.sample_sand}") 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,8 +147,15 @@ class UpdateTableForSave:
) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)''', ) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)''',
( (
stg.acoustic_data[i], stg.acoustic_data[i],
stg.date[i].isoformat(), (
stg.hour[i].isoformat(), 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.freq[i][j], stg.freq[i][j],
stg.water_attenuation[i][j], stg.water_attenuation[i][j],
stg.kt_read[j], stg.kt_read[j],
@ -207,29 +214,21 @@ class UpdateTableForSave:
BS_mean) BS_mean)
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)''', VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)''',
(stg.acoustic_data[i], stg.time[i].tobytes(), stg.depth[i].tobytes(), stg.BS_raw_data[i].tobytes(), (stg.acoustic_data[i], stg.time[i].tobytes(), stg.depth[i].tobytes(), stg.BS_raw_data[i].tobytes(),
stg.time_reshape[i].tobytes(), stg.time_reshape[i].tobytes(), stg.depth_reshape[i].tobytes(), stg.BS_raw_data_reshape[i].tobytes(),
stg.depth_reshape[i].tobytes(), stg.time_cross_section[i].tobytes(), stg.depth_cross_section[i].tobytes(), stg.BS_cross_section[i].tobytes(),
stg.BS_raw_data_reshape[i].tobytes(), stg.BS_stream_bed[i].tobytes(),
stg.time_cross_section[i].tobytes(), stg.depth_bottom[i].tobytes(), stg.val_bottom[i].tobytes(), np.array(stg.ind_bottom[i]).tobytes(),
stg.depth_cross_section[i].tobytes(), stg.time_noise[i].tobytes(), stg.depth_noise[i].tobytes(),
stg.BS_cross_section[i].tobytes(), stg.BS_noise_raw_data[i].tobytes(),
np.array(stg.BS_stream_bed[i]).tobytes(), stg.SNR_raw_data[i].tobytes(), stg.SNR_cross_section[i].tobytes(),
np.array(stg.depth_bottom[i]).tobytes(), stg.SNR_stream_bed[i].tobytes(),
np.array(stg.val_bottom[i]).tobytes(), stg.BS_raw_data_pre_process_SNR[i].tobytes(),
np.array(stg.ind_bottom[i]).tobytes(), stg.BS_raw_data_pre_process_average[i].tobytes(),
np.array(stg.time_noise[i]).tobytes(), stg.BS_cross_section_pre_process_SNR[i].tobytes(),
np.array(stg.depth_noise[i]).tobytes(), stg.BS_cross_section_pre_process_average[i].tobytes(),
np.array(stg.BS_noise_raw_data[i]).tobytes(), stg.BS_stream_bed_pre_process_SNR[i].tobytes(),
np.array(stg.SNR_raw_data[i]).tobytes(), stg.BS_stream_bed_pre_process_average[i].tobytes(),
np.array(stg.SNR_cross_section[i]).tobytes(), stg.BS_mean[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()
) )
) )
@ -246,48 +245,29 @@ class UpdateTableForSave:
cur.execute(''' DROP TABLE Settings''') cur.execute(''' DROP TABLE Settings''')
cur.execute(''' cur.execute('''CREATE TABLE Settings(ID INTEGER PRIMARY KEY AUTOINCREMENT,
CREATE TABLE Settings( acoustic_data INTEGER,
ID INTEGER PRIMARY KEY AUTOINCREMENT, temperature FLOAT,
acoustic_data INTEGER, tmin_index FLOAT, tmin_value FLOAT, tmax_index FLOAT, tmax_value FLOAT,
temperature FLOAT, rmin_index FLOAT, rmin_value FLOAT, rmax_index FLOAT, rmax_value FLOAT,
distance_to_free_surface FLOAT, freq_bottom_detection_index FLOAT, freq_bottom_detection_value STRING,
tmin_index FLOAT, tmin_value FLOAT, SNR_filter_value FLOAT, Nb_cells_to_average_BS_signal 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: for i in stg.acoustic_data:
cur.execute(''' cur.execute('''INSERT into Settings(acoustic_data, temperature,
INSERT into Settings( tmin_index, tmin_value, tmax_index, tmax_value,
acoustic_data, temperature, rmin_index, rmin_value, rmax_index, rmax_value,
distance_to_free_surface, freq_bottom_detection_index, freq_bottom_detection_value,
tmin_index, tmin_value, tmax_index, tmax_value, SNR_filter_value, Nb_cells_to_average_BS_signal)
rmin_index, rmin_value, rmax_index, rmax_value, VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)''',
freq_bottom_detection_index, freq_bottom_detection_value, (stg.acoustic_data[i], stg.temperature,
SNR_filter_value, Nb_cells_to_average_BS_signal stg.tmin[i][0], stg.tmin[i][1], stg.tmax[i][0], stg.tmax[i][1],
) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 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])
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() cnx.commit()

View File

@ -23,27 +23,6 @@ from PyQt5.QtGui import QIcon, QPixmap, QFont
from PyQt5.QtWidgets import (QWidget, QLabel, QHBoxLayout, QVBoxLayout, QApplication, QMainWindow, QGridLayout, from PyQt5.QtWidgets import (QWidget, QLabel, QHBoxLayout, QVBoxLayout, QApplication, QMainWindow, QGridLayout,
QDialog, QDialogButtonBox, QPushButton, QTextEdit, QFrame, QLineEdit) QDialog, QDialogButtonBox, QPushButton, QTextEdit, QFrame, QLineEdit)
from PyQt5.QtCore import Qt 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): class AboutWindow(QDialog):
@ -52,6 +31,12 @@ class AboutWindow(QDialog):
super().__init__() 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.setGeometry(400, 200, 350, 200)
self.setWindowTitle("About AcouSed") self.setWindowTitle("About AcouSed")
@ -65,8 +50,7 @@ class AboutWindow(QDialog):
# ---------------------------------------------------------- # ----------------------------------------------------------
self.label_logo_AcouSed = QLabel() self.label_logo_AcouSed = QLabel()
self.label_logo_AcouSed.setPixmap(QPixmap(logos_inst.logo_AcouSed). self.label_logo_AcouSed.setPixmap(self.logo_AcouSed.scaledToHeight(128, Qt.SmoothTransformation))
scaledToHeight(128, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_logo_AcouSed, 0, 0, 5, 1, Qt.AlignCenter) self.gridLayout.addWidget(self.label_logo_AcouSed, 0, 0, 5, 1, Qt.AlignCenter)
self.label_acoused = QLabel() self.label_acoused = QLabel()
@ -80,7 +64,7 @@ class AboutWindow(QDialog):
self.gridLayout.addWidget(self.label_date, 1, 1, 1, 1, Qt.AlignCenter) self.gridLayout.addWidget(self.label_date, 1, 1, 1, 1, Qt.AlignCenter)
self.label_logo_INRAE = QLabel() self.label_logo_INRAE = QLabel()
self.label_logo_INRAE.setPixmap(QPixmap(logos_inst.logo_INRAE).scaledToHeight(42, Qt.SmoothTransformation)) self.label_logo_INRAE.setPixmap(self.logo_INRAE.scaledToHeight(42, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_logo_INRAE, 2, 1, 1, 1, Qt.AlignCenter) self.gridLayout.addWidget(self.label_logo_INRAE, 2, 1, 1, 1, Qt.AlignCenter)
self.label_contact = QLabel() self.label_contact = QLabel()
@ -119,17 +103,11 @@ class AboutWindow(QDialog):
self.button_Copyright.clicked.connect(self.copyright_window) self.button_Copyright.clicked.connect(self.copyright_window)
self.button_FundsPartners = QPushButton() self.button_Support = QPushButton()
self.button_FundsPartners.setText("Funds/Patners") self.button_Support.setText("Support")
self.gridLayout_button.addWidget(self.button_FundsPartners, 0, 2, 1, 1) self.gridLayout_button.addWidget(self.button_Support, 0, 2, 1, 1)
self.button_FundsPartners.clicked.connect(self.funds_partners_window) self.button_Support.clicked.connect(self.support_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): def licence_window(self):
lw = Licence() lw = Licence()
@ -139,12 +117,8 @@ class AboutWindow(QDialog):
cw = Copyright() cw = Copyright()
cw.exec() cw.exec()
def funds_partners_window(self): def support_window(self):
sw = FundsPartners() sw = Support()
sw.exec()
def authors_window(self):
sw = Authors()
sw.exec() sw.exec()
@ -175,7 +149,7 @@ class Licence(QDialog):
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \n"
"GNU General Public License for more details. \n\n" "GNU General Public License for more details. \n\n"
"You should have received a copy of the GNU General Public License \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): class Copyright(QDialog):
@ -184,6 +158,9 @@ class Copyright(QDialog):
super().__init__() super().__init__()
self.logo_path = "./Logo"
self.logo_INRAE = QPixmap(self.logo_path + "/" + "BlocMarque-INRAE-Inter.jpg")
self.setWindowTitle("Copyright") self.setWindowTitle("Copyright")
self.setGeometry(500, 300, 200, 200) self.setGeometry(500, 300, 200, 200)
@ -198,17 +175,24 @@ class Copyright(QDialog):
"All Rights Reserved.") "All Rights Reserved.")
self.label_INRAE = QLabel() self.label_INRAE = QLabel()
self.label_INRAE.setPixmap(QPixmap(logos_inst.logo_INRAE).scaledToHeight(64, Qt.SmoothTransformation)) self.label_INRAE.setPixmap(self.logo_INRAE.scaledToHeight(64, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_INRAE, 1, 0, 1, 1, Qt.AlignCenter) self.gridLayout.addWidget(self.label_INRAE, 1, 0, 1, 1, Qt.AlignCenter)
class FundsPartners(QDialog): class Support(QDialog):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
self.setWindowTitle("Funds/Partners") 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.setGeometry(500, 300, 300, 300) self.setGeometry(500, 300, 300, 300)
@ -216,85 +200,28 @@ class FundsPartners(QDialog):
self.setLayout(self.gridLayout) self.setLayout(self.gridLayout)
self.label_support = QLabel() self.label_support = QLabel()
self.label_support.setText("The development of AcouSed software was funded by OSR, Carnot Eau & Environnement, INRAE and CNR Company. \n " self.label_support.setText("The development of AcouSed was supported by OSR6 and CNR Company.")
"It was made in collaboration with Ubertone and EDF Companies.") self.gridLayout.addWidget(self.label_support, 0, 0, 1, 2, Qt.AlignLeft)
self.gridLayout.addWidget(self.label_support, 0, 0, 1, 4, Qt.AlignLeft)
self.label_OSR = QLabel() self.label_OSR = QLabel()
self.label_OSR.setPixmap(QPixmap(logos_inst.logo_OSR).scaledToHeight(78, Qt.SmoothTransformation)) self.label_OSR.setPixmap(self.logo_OSR.scaledToHeight(96, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_OSR, 1, 0, 1, 1, Qt.AlignCenter) self.gridLayout.addWidget(self.label_OSR, 1, 0, 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_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 = QLabel()
self.label_CNR.setPixmap(QPixmap(logos_inst.logo_CNR).scaledToHeight(32, Qt.SmoothTransformation)) self.label_CNR.setPixmap(self.logo_CNR.scaledToHeight(32, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_CNR, 2, 1, 1, 1, Qt.AlignCenter) self.gridLayout.addWidget(self.label_CNR, 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_Ubertone = QLabel() self.label_Ubertone = QLabel()
self.label_Ubertone.setPixmap(QPixmap(logos_inst.logo_Ubertone).scaledToHeight(24, Qt.SmoothTransformation)) self.label_Ubertone.setPixmap(self.logo_Ubertone.scaledToHeight(48, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_Ubertone, 2, 2, 1, 1, Qt.AlignCenter) self.gridLayout.addWidget(self.label_Ubertone, 3, 0, 1, 1, Qt.AlignCenter)
self.label_EDF = QLabel() self.label_EDF = QLabel()
self.label_EDF.setPixmap(QPixmap(logos_inst.logo_EDF).scaledToHeight(48, Qt.SmoothTransformation)) self.label_EDF.setPixmap(self.logo_EDF.scaledToHeight(48, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_EDF, 2, 3, 1, 1, Qt.AlignCenter) self.gridLayout.addWidget(self.label_EDF, 3, 1, 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__": # if __name__ == "__main__":

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

BIN
logos/Ubertone.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

View File

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