Compare commits

...

24 Commits

Author SHA1 Message Date
brahim 2dd387e8ac User Manual is replaced by Tuto acoused 2025-03-26 15:19:49 +01:00
brahim 88b93bd011 docs source of aquascat tutorial and inversion theory 2025-03-26 14:40:01 +01:00
brahim 5a75697de7 correction branch fusion 2025-03-26 14:30:05 +01:00
brahim bc1479208b add/update of logos 2025-03-26 14:19:31 +01:00
brahim e664aac865 logos are added and Authors section is also added 2025-03-26 14:18:37 +01:00
brahim a7aba734a3 sample are plotted with different colors when fine and sand file are downloaded 2025-03-26 12:03:19 +01:00
Pierre-Antoine 5ea7879896 guix: Update manifest. 2025-03-25 16:54:39 +01:00
Pierre-Antoine d7ea9cc4f7 Merge branch 'dev-parouby' into dev 2025-03-25 16:44:40 +01:00
Pierre-Antoine 07353ccc3c Acoustic data: Minor change. 2025-03-25 16:41:25 +01:00
Pierre-Antoine 6dbd1e3e5c Acoustic data: Fix temperature value at study open. 2025-03-25 16:07:25 +01:00
Pierre-Antoine 5631a25b51 MainWindow: Minor change. 2025-03-25 15:35:03 +01:00
Pierre-Antoine 466cda0a35 Note: Disable note tab. 2025-03-25 13:46:28 +01:00
Pierre-Antoine 1351d7e5fc Sample data: Fix plot drawing at study open. 2025-03-25 13:22:06 +01:00
Pierre-Antoine 5f7c81f866 Signal processing: Fix #42. 2025-03-25 10:03:41 +01:00
Pierre-Antoine 74137405fc Signal processing: Complete missing data at open study. 2025-03-24 17:58:37 +01:00
Pierre-Antoine 943f768720 Model: Create table: Fix table definition. 2025-03-24 17:16:04 +01:00
Pierre-Antoine 81221525de Acoustic inversion: Fix crash at open study. 2025-03-24 16:10:33 +01:00
Pierre-Antoine 19c2ae9b7f Sediment calibration: Fix crash at open study file. 2025-03-24 15:40:30 +01:00
Pierre-Antoine 41132afa90 Sample Data: Fix open study. 2025-03-24 14:51:50 +01:00
Pierre-Antoine 0cd9964594 Signal processing: Fix open study file crash. 2025-03-24 13:50:13 +01:00
Pierre-Antoine 413e8fb18e Acoustic data: Fix open study. 2025-03-24 13:02:10 +01:00
Pierre-Antoine 2e20b2f464 Model: Finish refactoring read table for open. 2025-03-24 13:01:21 +01:00
Pierre-Antoine bdfcff88a5 Model: Continue refactoring. 2025-03-20 18:20:26 +01:00
Pierre-Antoine 680f18b741 Model: Start simple refactoring read table. 2025-03-20 17:53:38 +01:00
22 changed files with 1016 additions and 696 deletions

Binary file not shown.

View File

@ -81,7 +81,7 @@ class CreateTableForSaveAs:
time_reshape BLOB, depth_reshape BLOB, BS_raw_data_reshape BLOB, time_reshape BLOB, depth_reshape BLOB, BS_raw_data_reshape BLOB,
time_cross_section BLOB, depth_cross_section BLOB, time_cross_section BLOB, depth_cross_section BLOB,
BS_cross_section BLOB, BS_stream_bed BLOB, BS_cross_section BLOB, BS_stream_bed BLOB,
depth_bottom, val_bottom, ind_bottom, depth_bottom BLOB, val_bottom BLOB, ind_bottom BLOB,
time_noise BLOB, depth_noise BLOB, BS_noise_raw_data BLOB, time_noise BLOB, depth_noise BLOB, BS_noise_raw_data BLOB,
SNR_raw_data BLOB, SNR_cross_section BLOB, SNR_stream_bed BLOB, SNR_raw_data BLOB, SNR_cross_section BLOB, SNR_stream_bed BLOB,
BS_raw_data_pre_process_SNR BLOB, BS_raw_data_pre_process_SNR BLOB,

View File

@ -60,384 +60,535 @@ class ReadTableForOpen:
except OSError as e: except OSError as e:
logger.warning(f"chdir: {str(e)}") logger.warning(f"chdir: {str(e)}")
self.sql_file_to_open = open(stg.filename_open)
self.read_table() self.read_table()
self.opened = True self.opened = True
def read_table(self): def execute(self, query):
return self._cur.execute(query).fetchall()
def read_table(self):
stg.read_table_trigger = 1 stg.read_table_trigger = 1
# connexion to File db logger.debug(f"Open '{stg.filename_open}'")
cnx = sqlite3.connect(stg.filename_open) cnx = sqlite3.connect(stg.filename_open)
self._cur = cnx.cursor()
# Create database cursor to execute SQL statements and fetch results from SQL queries. self.read_table_acoustic_file()
cur = cnx.cursor() self.read_table_measure()
self.read_table_BS_raw_data()
self.read_table_settings()
self.read_table_sediment_file()
self.read_table_table_sediment_data()
# -------------------------------------------------------------------------------------------------------------- logger.debug(f"Reading '{stg.filename_open}' done")
# +++++++++++++++++++++++++++
# --- Table Acoustic File ---
# +++++++++++++++++++++++++++
self._cur.close()
cnx.close()
logger.debug(f"'{stg.filename_open}' closed")
def read_table_acoustic_file(self):
query0 = f'''SELECT acoustic_data FROM AcousticFile''' query0 = f'''SELECT acoustic_data FROM AcousticFile'''
data0 = cur.execute(query0).fetchall() data0 = self.execute(query0)
print("data0 ", data0)
logger.debug(f"data0: {data0}")
stg.acoustic_data = [x[0] for x in data0] stg.acoustic_data = [x[0] for x in data0]
print("stg.acoustic_data ", stg.acoustic_data) logger.debug(f"stg.acoustic_data: {stg.acoustic_data}")
for k in range(len(stg.acoustic_data)): for k in range(len(stg.acoustic_data)):
print("hello") query = f'''
query = f'''SELECT acoustic_data, acoustic_file, ABS_name, path_BS_noise_data, filename_BS_noise_data, SELECT
noise_method, noise_value, data_preprocessed FROM AcousticFile WHERE (acoustic_data = {k})''' acoustic_data, acoustic_file, ABS_name, path_BS_noise_data,
data = cur.execute(query).fetchall() filename_BS_noise_data,
noise_method, noise_value, data_preprocessed
FROM AcousticFile
WHERE (acoustic_data = {k})
'''
data = self.execute(query)[0]
print("data acoustic file", data) print("data acoustic file", data)
stg.filename_BS_raw_data.append([str(y[1]) + '.aqa' for y in data][0]) stg.filename_BS_raw_data.append(
stg.ABS_name.append([z[2] for z in data][0]) str(data[1]) + '.aqa'
stg.path_BS_noise_data.append([z[3] for z in data][0]) )
stg.filename_BS_noise_data.append([z[4] for z in data][0]) stg.ABS_name.append(data[2])
stg.noise_method.append([z[5] for z in data][0]) stg.path_BS_noise_data.append(data[3])
stg.noise_value.append([z[6] for z in data][0]) stg.filename_BS_noise_data.append(data[4])
stg.data_preprocessed.append([z[7] for z in data][0]) stg.noise_method.append(data[5])
stg.noise_value.append(data[6])
stg.data_preprocessed.append(data[7])
print("data acoustic file ", stg.filename_BS_raw_data, stg.ABS_name, stg.path_BS_noise_data, stg.filename_BS_noise_data, logger.debug("data acoustic file:")
stg.noise_method, stg.noise_value, stg.data_preprocessed) logger.debug(f"- {stg.filename_BS_raw_data}")
logger.debug(f"- {stg.ABS_name}")
# -------------------------------------------------------------------------------------------------------------- logger.debug(f"- {stg.path_BS_noise_data}")
# +++++++++++++++++++++ logger.debug(f"- {stg.filename_BS_noise_data}")
# --- Table Measure --- logger.debug(f"- {stg.noise_method}")
# +++++++++++++++++++++ logger.debug(f"- {stg.noise_value}")
logger.debug(f"- {stg.data_preprocessed}")
def read_table_measure(self):
stg.date = [0]*len(stg.acoustic_data) stg.date = [0]*len(stg.acoustic_data)
stg.hour = [0]*len(stg.acoustic_data) stg.hour = [0]*len(stg.acoustic_data)
for i in range(len(stg.acoustic_data)):
print("i = ", i)
query1 = f'''SELECT acoustic_data, Date, Hour, frequency, sound_attenuation, kt_read, kt_corrected, NbProfiles,
NbProfilesPerSeconds, NbCells, CellSize, PulseLength, NbPingsPerSeconds, NbPingsAveragedPerProfile,
GainRx, GainTx FROM Measure WHERE (acoustic_data = {i})'''
data1 = cur.execute(query1).fetchall()
print("--------------------------------------") for i in range(len(stg.acoustic_data)):
print("data1 ", data1) query1 = f'''
SELECT
acoustic_data, Date, Hour, frequency,
sound_attenuation, kt_read, kt_corrected, NbProfiles,
NbProfilesPerSeconds, NbCells, CellSize, PulseLength,
NbPingsPerSeconds, NbPingsAveragedPerProfile,
GainRx, GainTx
FROM Measure
WHERE (acoustic_data = {i})
'''
data1 = self.execute(query1)
logger.debug(f"data1 for {i}: {data1}")
stg.date[i] = data1[0][1] stg.date[i] = data1[0][1]
stg.hour[i] = data1[0][2] stg.hour[i] = data1[0][2]
stg.freq.append(np.array([x[3] for x in data1])) stg.freq.append(
stg.freq_text.append([str(x[3]*1e-6) + 'MHz' for x in data1]) np.array([x[3] for x in data1])
stg.water_attenuation.append([x[4] for x in data1]) )
stg.kt_read.append([x[5] for x in data1]) stg.freq_text.append(
[str(x[3]*1e-6) + 'MHz' for x in data1]
)
stg.water_attenuation.append(
[x[4] for x in data1]
)
stg.kt_read = [x[5] for x in data1]
stg.kt_corrected = [x[6] for x in data1] stg.kt_corrected = [x[6] for x in data1]
stg.nb_profiles.append([x[7] for x in data1]) stg.nb_profiles.append([x[7] for x in data1])
stg.nb_profiles_per_sec.append([x[8] 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.nb_cells.append([x[9] for x in data1])
stg.cell_size.append([x[10] 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.pulse_length.append([x[11] for x in data1])
stg.nb_pings_per_sec.append([x[12] for x in data1]) stg.nb_pings_per_sec.append(
stg.nb_pings_averaged_per_profile.append([x[13] for x in data1]) [x[12] for x in data1]
)
stg.nb_pings_averaged_per_profile.append(
[x[13] for x in data1]
)
stg.gain_rx.append([x[14] for x in data1]) stg.gain_rx.append([x[14] for x in data1])
stg.gain_tx.append([x[15] for x in data1]) stg.gain_tx.append([x[15] for x in data1])
print(stg.acoustic_data, stg.freq, stg.water_attenuation, stg.kt_read, stg.kt_corrected, stg.nb_profiles, stg.nb_profiles_per_sec, logger.debug("measure:")
stg.nb_cells, stg.cell_size, stg.pulse_length, stg.nb_pings_per_sec, stg.nb_pings_averaged_per_profile, logger.debug(f"- stg.acoustic_data: {stg.acoustic_data}")
stg.gain_rx, stg.gain_tx) logger.debug(f"- stg.freq {stg.freq}")
logger.debug(f"- stg.water_attenuation {stg.water_attenuation}")
logger.debug(f"- stg.kt_read {stg.kt_read}")
logger.debug(f"- stg.kt_corrected {stg.kt_corrected}")
logger.debug(f"- stg.nb_profiles {stg.nb_profiles}")
logger.debug(f"- stg.nb_profiles_per_sec {stg.nb_profiles_per_sec}")
logger.debug(f"- stg.nb_cells {stg.nb_cells}")
logger.debug(f"- stg.cell_size {stg.cell_size}")
logger.debug(f"- stg.pulse_length {stg.pulse_length}")
logger.debug(f"- stg.nb_pings_per_sec {stg.nb_pings_per_sec}")
logger.debug(f"- stg.nb_pings_averaged_per_profile {stg.nb_pings_averaged_per_profile}")
logger.debug(f"- stg.gain_rx {stg.gain_rx}")
logger.debug(f"- stg.gain_tx {stg.gain_tx}")
print(stg.date) logger.debug(f"- {stg.date}")
print(stg.hour) logger.debug(f"- {stg.hour}")
# -------------------------------------------------------------------------------------------------------------- def read_table_BS_raw_data(self):
# +++++++++++++++++++++++ logger.debug(f"len stg.acoustic_data: {len(stg.acoustic_data)}")
# --- Table BSRawData ---
# ++++++++++++++++++++++
print("len stg.acoustic_data ", len(stg.acoustic_data))
for j in range(len(stg.acoustic_data)):
print(f"j = {j}")
query2 = f'''SELECT acoustic_data, time, depth, BS_raw_data,
time_reshape, depth_reshape, BS_raw_data_reshape,
time_cross_section, depth_cross_section,
BS_cross_section, BS_stream_bed,
depth_bottom, val_bottom, ind_bottom,
time_noise, depth_noise, BS_noise_raw_data,
SNR_raw_data, SNR_cross_section, SNR_stream_bed,
BS_raw_data_pre_process_SNR, BS_raw_data_pre_process_average,
BS_cross_section_pre_process_SNR, BS_cross_section_pre_process_average,
BS_stream_bed_pre_process_SNR, BS_stream_bed_pre_process_average, BS_mean
FROM BSRawData WHERE (acoustic_data = {j})'''
data2 = cur.execute(query2).fetchall() for i in range(len(stg.acoustic_data)):
print("len data2 ", len(data2)) query = lambda values: f'''
SELECT
{", ".join(values)}
FROM BSRawData
WHERE (acoustic_data = {i})
'''
stg.time.append(np.frombuffer(data2[0][1], dtype=np.float64).reshape((stg.freq[j].shape[0], -1))) self.read_table_BS_raw_data_raw(query, i)
print("stg.time[0].shape ", stg.time[j].shape, np.frombuffer(data2[0][1], dtype=np.float64).shape) self.read_table_BS_raw_data_cross_section(query, i)
print(stg.time) self.read_table_BS_raw_data_bed(query, i)
stg.depth.append(np.frombuffer(data2[0][2], dtype=np.float64).reshape((stg.freq[j].shape[0], -1))) self.read_table_BS_raw_data_noise(query, i)
print("stg.depth[0].shape ", stg.depth[j].shape) self.read_table_BS_raw_data_SNR(query, i)
print(stg.depth) self.read_table_BS_raw_data_rest(query, i)
stg.BS_raw_data.append(np.frombuffer(data2[0][3], dtype=np.float64).reshape((stg.freq[j].shape[0], stg.depth[j].shape[1], stg.time[j].shape[1]))) self.read_table_BS_raw_data_mean(query, i)
print("BS_raw_data ", stg.BS_raw_data[j].shape)
stg.time_reshape.append(np.frombuffer(data2[0][4], dtype=np.float64).reshape((-1, stg.freq[j].shape[0])))
print("stg.time_reshape[0].shape ", stg.time_reshape[j].shape)
stg.depth_reshape.append(np.frombuffer(data2[0][5], dtype=np.float64).reshape((-1, stg.freq[j].shape[0])))
stg.BS_raw_data_reshape.append(np.frombuffer(data2[0][6], dtype=np.float64).reshape((-1, stg.freq[j].shape[0])))
print("time cross section ", stg.time_cross_section, stg.time_cross_section == [])
print("np.frombuffer(data2[0][9], dtype=np.float64) ", np.frombuffer(data2[0][9], dtype=np.float64)) def read_table_BS_raw_data_raw(self, query, i):
if len(np.frombuffer(data2[0][9], dtype=np.float64)) == 0: np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)
print("Je suis là") data = self.execute(
query(
[
"time", "depth",
"BS_raw_data",
"time_reshape", "depth_reshape",
"BS_raw_data_reshape",
]
)
)[0]
it = iter(data)
time = next(it)
depth = next(it)
BS_raw_data = next(it)
time_reshape = next(it)
depth_reshape = next(it)
BS_raw_data_reshape = next(it)
stg.time.append(
np_f64_parse(time).reshape((stg.freq[i].shape[0], -1))
)
stg.depth.append(np_f64_parse(depth).reshape(
(stg.freq[i].shape[0], -1)
))
stg.BS_raw_data.append(
np_f64_parse(BS_raw_data).reshape(
(
stg.freq[i].shape[0],
stg.depth[i].shape[1],
stg.time[i].shape[1]
)
)
)
stg.time_reshape.append(
np_f64_parse(time_reshape).reshape(
(-1, stg.freq[i].shape[0])
)
)
stg.depth_reshape.append(
np_f64_parse(depth_reshape).reshape(
(-1, stg.freq[i].shape[0])
)
)
stg.BS_raw_data_reshape.append(
np_f64_parse(BS_raw_data_reshape).reshape(
(-1, stg.freq[i].shape[0])
)
)
def read_table_BS_raw_data_cross_section(self, query, i):
np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)
data = self.execute(
query(
[
"time_cross_section",
"depth_cross_section",
"BS_cross_section",
]
)
)[0]
it = iter(data)
time = next(it)
depth = next(it)
BS = np_f64_parse(next(it))
if len(BS) == 0:
stg.time_cross_section.append(np.array([])) stg.time_cross_section.append(np.array([]))
stg.depth_cross_section.append(np.array([])) stg.depth_cross_section.append(np.array([]))
stg.BS_cross_section.append(np.array([])) stg.BS_cross_section.append(np.array([]))
else: else:
print("Je suis ici") stg.time_cross_section.append(
print(stg.freq[j].shape) np_f64_parse(time).reshape(
print(np.frombuffer(data2[0][7], dtype=np.float64).shape) (stg.freq[i].shape[0], -1)
stg.time_cross_section.append(np.frombuffer(data2[0][7], dtype=np.float64).reshape((stg.freq[j].shape[0], -1))) )
print("time cross section ", stg.time_cross_section, stg.time_cross_section[j].shape) )
stg.depth_cross_section.append(np.frombuffer(data2[0][8], dtype=np.float64).reshape((stg.freq[j].shape[0], -1))) stg.depth_cross_section.append(
print("depth cross section ", stg.depth_cross_section, stg.depth_cross_section[j].shape) np_f64_parse(depth).reshape(
stg.BS_cross_section.append(np.frombuffer(data2[0][9], dtype=np.float64).reshape( (stg.freq[i].shape[0], -1)
(stg.freq[j].shape[0], stg.depth_cross_section[j].shape[1], stg.time_cross_section[j].shape[1]))) )
)
if len(np.frombuffer(data2[0][10], dtype=np.float64)) == 0: stg.BS_cross_section.append(
BS.reshape(
(
stg.freq[i].shape[0],
stg.depth_cross_section[i].shape[1],
stg.time_cross_section[i].shape[1]
)
)
)
def read_table_BS_raw_data_bed(self, query, i):
np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)
data = self.execute(
query(
[
"BS_stream_bed",
"depth_bottom", "val_bottom", "ind_bottom",
]
)
)[0]
it = iter(data)
BS = np_f64_parse(next(it))
depth = np_f64_parse(next(it))
val = np_f64_parse(next(it))
ind = np_f64_parse(next(it))
if len(BS) == 0:
stg.BS_stream_bed.append(np.array([])) stg.BS_stream_bed.append(np.array([]))
else: else:
stg.BS_stream_bed.append(np.frombuffer(data2[0][10], dtype=np.float64).reshape( stg.BS_stream_bed.append(
(stg.freq[j].shape[0], stg.depth_cross_section[j].shape[1], stg.time_cross_section[j].shape[1]))) BS.reshape(
(
stg.freq[i].shape[0],
stg.depth_cross_section[i].shape[1],
stg.time_cross_section[i].shape[1]
)
)
)
if len(np.frombuffer(data2[0][11], dtype=np.float64)) == 0: if len(depth) == 0:
stg.depth_bottom.append(np.array([])) stg.depth_bottom.append(np.array([]))
stg.val_bottom.append([]) stg.val_bottom.append([])
stg.ind_bottom.append([]) stg.ind_bottom.append([])
else: else:
stg.depth_bottom.append(np.frombuffer(data2[0][11], dtype=np.float64)) stg.depth_bottom.append(depth)
stg.val_bottom.append(np.frombuffer(data2[0][12], dtype=np.float64).tolist()) stg.val_bottom.append(val.tolist())
stg.ind_bottom.append(np.frombuffer(data2[0][13], dtype=np.float64).tolist()) stg.ind_bottom.append(ind.tolist())
print("stg.depth_bottom ", stg.depth_bottom)
print("stg.val_bottom ", stg.val_bottom)
print("stg.ind_bottom ", stg.ind_bottom)
if len(np.frombuffer(data2[0][14], dtype=np.float64)) == 0: def read_table_BS_raw_data_noise(self, query, i):
np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)
data = self.execute(
query(
[
"time_noise", "depth_noise", "BS_noise_raw_data",
]
)
)[0]
it = iter(data)
time = next(it)
depth = next(it)
BS = np_f64_parse(next(it))
if len(BS) == 0:
stg.time_noise.append(np.array([])) stg.time_noise.append(np.array([]))
stg.depth_noise.append(np.array([])) stg.depth_noise.append(np.array([]))
stg.BS_noise_raw_data.append(np.array([])) stg.BS_noise_raw_data.append(np.array([]))
stg.BS_noise_averaged_data.append(np.array([]))
else: else:
stg.time_noise.append(np.frombuffer(data2[0][14], dtype=np.float64).reshape((stg.freq[j].shape[0], -1))) stg.time_noise.append(
stg.depth_noise.append(np.frombuffer(data2[0][15], dtype=np.float64).reshape((stg.freq[j].shape[0], -1))) np_f64_parse(time).reshape(
stg.BS_noise_raw_data.append(np.frombuffer(data2[0][16], dtype=np.float64).reshape( (stg.freq[i].shape[0], -1)
(stg.freq[j].shape[0], stg.depth_noise[j].shape[1], stg.time_noise[j].shape[1]))) )
)
stg.depth_noise.append(
np_f64_parse(depth).reshape(
(stg.freq[i].shape[0], -1)
)
)
stg.BS_noise_raw_data.append(
BS.reshape(
(
stg.freq[i].shape[0],
stg.depth_noise[i].shape[1],
stg.time_noise[i].shape[1]
)
)
)
stg.BS_noise_averaged_data.append(np.array([]))
if len(np.frombuffer(data2[0][17], dtype=np.float64)) == 0: def read_table_BS_raw_data_SNR(self, query, i):
stg.SNR_raw_data.append(np.array([])) np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)
else: data = self.execute(
stg.SNR_raw_data.append(np.frombuffer(data2[0][17], dtype=np.float64).reshape(stg.BS_raw_data[j].shape)) query(
[
"SNR_raw_data", "SNR_cross_section", "SNR_stream_bed",
]
)
)[0]
if len(np.frombuffer(data2[0][18], dtype=np.float64)) == 0: it = iter(data)
stg.SNR_cross_section.append(np.array([]))
else: SNR_vars = [
stg.SNR_cross_section.append(np.frombuffer(data2[0][18], dtype=np.float64).reshape(stg.BS_cross_section[j].shape)) (stg.SNR_raw_data, stg.BS_raw_data),
(stg.SNR_cross_section, stg.BS_cross_section),
(stg.SNR_stream_bed, stg.BS_stream_bed),
]
if len(np.frombuffer(data2[0][19], dtype=np.float64)) == 0:
stg.SNR_stream_bed.append(np.array([])) stg.SNR_stream_bed.append(np.array([]))
else:
stg.SNR_stream_bed.append(np.frombuffer(data2[0][19], dtype=np.float64).reshape(stg.BS_stream_bed[j].shape))
if len(np.frombuffer(data2[0][20], dtype=np.float64)) == 0: for dest, resh in SNR_vars:
stg.BS_raw_data_pre_process_SNR.append(np.array([])) SNR = np_f64_parse(next(it))
else:
stg.BS_raw_data_pre_process_SNR.append(np.frombuffer(data2[0][20], dtype=np.float64).reshape(stg.BS_raw_data[j].shape))
if len(np.frombuffer(data2[0][21], dtype=np.float64)) == 0: if len(SNR) == 0:
stg.BS_raw_data_pre_process_average.append(np.array([])) dest.append(np.array([]))
else: else:
stg.BS_raw_data_pre_process_average.append(np.frombuffer(data2[0][21], dtype=np.float64).reshape(stg.BS_raw_data[j].shape)) dest.append(SNR.reshape(resh[i].shape))
if len(np.frombuffer(data2[0][22], dtype=np.float64)) == 0: def read_table_BS_raw_data_rest(self, query, i):
stg.BS_cross_section_pre_process_SNR.append(np.array([])) np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)
data = self.execute(
query(
[
"BS_raw_data_pre_process_SNR",
"BS_raw_data_pre_process_average",
"BS_cross_section_pre_process_SNR",
"BS_cross_section_pre_process_average",
"BS_stream_bed_pre_process_SNR",
"BS_stream_bed_pre_process_average",
]
)
)[0]
BS_vars = [
(stg.BS_raw_data_pre_process_SNR, stg.BS_raw_data),
(stg.BS_raw_data_pre_process_average, stg.BS_raw_data),
(stg.BS_cross_section_pre_process_SNR, stg.BS_cross_section),
(stg.BS_cross_section_pre_process_average, stg.BS_cross_section),
(stg.BS_stream_bed_pre_process_SNR, stg.BS_stream_bed),
(stg.BS_stream_bed_pre_process_average, stg.BS_stream_bed),
]
it = iter(data)
for dest, resh in BS_vars:
BS = np_f64_parse(next(it))
if len(BS) == 0:
dest.append(np.array([]))
else: else:
stg.BS_cross_section_pre_process_SNR.append(np.frombuffer(data2[0][22], dtype=np.float64).reshape(stg.BS_cross_section[j].shape)) dest.append(BS.reshape(resh[i].shape))
if len(np.frombuffer(data2[0][23], dtype=np.float64)) == 0: def read_table_BS_raw_data_mean(self, query, i):
stg.BS_cross_section_pre_process_average.append(np.array([])) np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)
else: data = self.execute(
stg.BS_cross_section_pre_process_average.append(np.frombuffer(data2[0][23], dtype=np.float64).reshape(stg.BS_cross_section[j].shape)) query(["BS_mean"])
)[0]
if len(np.frombuffer(data2[0][24], dtype=np.float64)) == 0: BS = np_f64_parse(data[0])
stg.BS_stream_bed_pre_process_SNR.append(np.array([]))
else:
stg.BS_stream_bed_pre_process_SNR.append(np.frombuffer(data2[0][24], dtype=np.float64).reshape(stg.BS_stream_bed[j].shape))
if len(np.frombuffer(data2[0][25], dtype=np.float64)) == 0: if len(BS) == 0:
stg.BS_stream_bed_pre_process_average.append(np.array([]))
else:
stg.BS_stream_bed_pre_process_average.append(np.frombuffer(data2[0][25], dtype=np.float64).reshape(stg.BS_stream_bed[j].shape))
if len(np.frombuffer(data2[0][26], dtype=np.float64)) == 0:
stg.BS_mean.append(np.array([])) stg.BS_mean.append(np.array([]))
else: else:
stg.BS_mean.append(np.frombuffer(data2[0][26], dtype=np.float64).reshape((stg.freq[j].shape[0], -1))) stg.BS_mean.append(
print(stg.BS_mean[j].shape) BS.reshape(
# -------------------------------------------------------------------------------------------------------------- (stg.freq[i].shape[0], -1)
# +++++++++++++++++++++++ )
# --- Table Settings --- )
# +++++++++++++++++++++++
def read_table_settings(self):
for s in range(len(stg.acoustic_data)): for s in range(len(stg.acoustic_data)):
query3 = f'''SELECT acoustic_data, temperature, query3 = f'''
SELECT
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
FROM Settings WHERE (acoustic_data = {s})''' FROM Settings
WHERE (acoustic_data = {s})
'''
data3 = cur.execute(query3).fetchall() data = self.execute(query3)
x = data[0]
stg.temperature = [x[1] for x in data3][0] stg.temperature = [x[1]][0]
stg.tmin.append([(x[2], x[3]) for x in data3]) stg.tmin.append((x[2], x[3]))
stg.tmax.append([(x[4], x[5]) for x in data3]) stg.tmax.append((x[4], x[5]))
stg.rmin.append([(x[6], x[7]) for x in data3]) stg.rmin.append((x[6], x[7]))
stg.rmax.append([(x[8], x[9]) for x in data3]) stg.rmax.append((x[8], x[9]))
stg.freq_bottom_detection.append([(x[10], x[11]) for x in data3]) stg.freq_bottom_detection.append((x[10], x[11]))
stg.SNR_filter_value.append([x[12] for x in data3]) stg.SNR_filter_value.append(x[12])
stg.Nb_cells_to_average_BS_signal.append([x[13] for x in data3]) stg.Nb_cells_to_average_BS_signal.append(x[13])
# -------------------------------------------------------------------------------------------------------------- logger.debug(f"stg.temperature: {stg.temperature}")
# +++++++++++++++++++++++++++ logger.debug(f"stg.tmin: {stg.tmin}")
# --- Table Sediment File --- logger.debug(f"stg.tmin: {stg.tmax}")
# +++++++++++++++++++++++++++ logger.debug(f"stg.SNR_filter_value: {stg.SNR_filter_value}")
query4 = f'''SELECT path_fine, filename_fine, radius_grain_fine, path_sand, filename_sand, radius_grain_sand, def read_table_sediment_file(self):
time_column_label, distance_from_bank_column_label, depth_column_label, query = f'''
SELECT
path_fine, filename_fine, radius_grain_fine,
path_sand, filename_sand, radius_grain_sand,
time_column_label, distance_from_bank_column_label,
depth_column_label,
Ctot_fine_column_label, D50_fine_column_label, Ctot_fine_column_label, D50_fine_column_label,
Ctot_sand_column_label, D50_sand_column_label Ctot_sand_column_label, D50_sand_column_label
from SedimentsFile''' FROM SedimentsFile
'''
data4 = cur.execute(query4).fetchall() data = self.execute(query)[0]
print("data4 ", data4) stg.path_fine = data[0]
stg.filename_fine = data[1]
stg.radius_grain_fine = np.array(
np.frombuffer(data[2], dtype=np.float64)
)
stg.path_sand = data[3]
stg.filename_sand = data[4]
stg.radius_grain_sand = np.array(
np.frombuffer(data[5], dtype=np.float64)
)
stg.columns_fine = (
[data[6], data[7], data[8], data[9], data[10]]
+ list(stg.radius_grain_fine)
)
stg.columns_sand = (
[data[6], data[7], data[8], data[11], data[12]]
+ list(stg.radius_grain_sand)
)
stg.path_fine = data4[0][0] def read_table_table_sediment_data(self):
stg.filename_fine = data4[0][1] np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)
stg.radius_grain_fine = np.array(np.frombuffer(data4[0][2], dtype=np.float64))
stg.path_sand = data4[0][3]
stg.filename_sand = data4[0][4]
stg.radius_grain_sand = np.array(np.frombuffer(data4[0][5], dtype=np.float64))
stg.columns_fine = [data4[0][6], data4[0][7], data4[0][8], data4[0][9], data4[0][10]] + list(stg.radius_grain_fine)
stg.columns_sand = [data4[0][6], data4[0][7], data4[0][8], data4[0][11], data4[0][12]] + list(stg.radius_grain_sand)
print("sediment file : ", stg.path_fine, stg.filename_fine, stg.path_sand, stg.filename_sand) query = f'''
print(stg.radius_grain_fine, stg.radius_grain_sand) SELECT
print('stg.columns_fine ', stg.columns_fine) sample_fine_name, sample_fine_index, distance_from_bank_fine,
depth_fine, time_fine, Ctot_fine, Ctot_fine_per_cent, D50_fine,
frac_vol_fine, frac_vol_fine_cumul,
# -------------------------------------------------------------------------------------------------------------- sample_sand_name, sample_sand_index, distance_from_bank_sand,
# +++++++++++++++++++++++++++ depth_sand, time_sand, Ctot_sand, Ctot_sand_per_cent, D50_sand,
# --- Table Sediment Data --- frac_vol_sand, frac_vol_sand_cumul
# +++++++++++++++++++++++++++ FROM SedimentsData
'''
query5 = f'''SELECT sample_fine_name, sample_fine_index, distance_from_bank_fine, depth_fine, time_fine, data = self.execute(query)
Ctot_fine, Ctot_fine_per_cent, D50_fine, frac_vol_fine, frac_vol_fine_cumul,
sample_sand_name, sample_sand_index, distance_from_bank_sand, depth_sand, time_sand,
Ctot_sand, Ctot_sand_per_cent, D50_sand, frac_vol_sand, frac_vol_sand_cumul
from SedimentsData'''
data5 = cur.execute(query5).fetchall()
stg.frac_vol_fine = [] stg.frac_vol_fine = []
stg.frac_vol_fine_cumul = [] stg.frac_vol_fine_cumul = []
stg.frac_vol_sand = [] stg.frac_vol_sand = []
stg.frac_vol_sand_cumul = [] stg.frac_vol_sand_cumul = []
for f in range(len(data5)): for f in range(len(data)):
stg.sample_fine.append((data5[f][0], data5[f][1])) stg.sample_fine.append((data[f][0], data[f][1]))
stg.distance_from_bank_fine.append(data5[f][2]) stg.distance_from_bank_fine.append(data[f][2])
stg.depth_fine.append(data5[f][3]) stg.depth_fine.append(data[f][3])
stg.time_fine.append(data5[f][4]) stg.time_fine.append(data[f][4])
stg.Ctot_fine.append(data5[f][5]) stg.Ctot_fine.append(data[f][5])
stg.Ctot_fine_per_cent.append(data5[f][6]) stg.Ctot_fine_per_cent.append(data[f][6])
stg.D50_fine.append(data5[f][7]) stg.D50_fine.append(data[f][7])
print("np.frombuffer(data4[f][8], dtype=np.float64) ", np.frombuffer(data5[f][8], dtype=np.float64)) stg.frac_vol_fine.append(
stg.frac_vol_fine.append(np.frombuffer(data5[f][8], dtype=np.float64)) np_f64_parse(data[f][8])
stg.frac_vol_fine_cumul.append(np.frombuffer(data5[f][9], dtype=np.float64)) )
stg.sample_sand.append((data5[f][10], data5[f][11])) stg.frac_vol_fine_cumul.append(
stg.distance_from_bank_sand.append(data5[f][12]) np_f64_parse(data[f][9])
stg.depth_sand.append(data5[f][13]) )
stg.time_sand.append(data5[f][14]) stg.sample_sand.append((data[f][10], data[f][11]))
stg.Ctot_sand.append(data5[f][15]) stg.distance_from_bank_sand.append(data[f][12])
stg.Ctot_sand_per_cent.append(data5[f][16]) stg.depth_sand.append(data[f][13])
stg.D50_sand.append(data5[f][17]) stg.time_sand.append(data[f][14])
stg.frac_vol_sand.append(np.frombuffer(data5[f][18], dtype=np.float64)) stg.Ctot_sand.append(data[f][15])
stg.frac_vol_sand_cumul.append(np.frombuffer(data5[f][19], dtype=np.float64)) stg.Ctot_sand_per_cent.append(data[f][16])
stg.D50_sand.append(data[f][17])
stg.frac_vol_sand.append(
np_f64_parse(data[f][18])
)
stg.frac_vol_sand_cumul.append(
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)
stg.frac_vol_fine_cumul = np.array(stg.frac_vol_fine_cumul) stg.frac_vol_fine_cumul = np.array(stg.frac_vol_fine_cumul)
stg.frac_vol_sand = np.array(stg.frac_vol_sand) stg.frac_vol_sand = np.array(stg.frac_vol_sand)
stg.frac_vol_sand_cumul = np.array(stg.frac_vol_sand_cumul) stg.frac_vol_sand_cumul = np.array(stg.frac_vol_sand_cumul)
# print("data 4 : ", len(data4), data4) logger.debug(f"fine: {stg.Ctot_fine}, sand: {stg.sample_sand}")
print('data 5 :')
print(stg.Ctot_fine, stg.sample_sand)
print(type(stg.frac_vol_fine_cumul), stg.frac_vol_fine_cumul)
# Close database cursor
cur.close()
# Close database connection
cnx.close()
print("read table finished")
def fill_acoustic_data_tab(self):
print("start fill acoustic data tab")
# tab_adt = AcousticDataTab(self.master_widget)
print("1 AcousticDataTab ", id(AcousticDataTab))
print("tab_adt.combobox_ABS_system_choice ", self.tab.combobox_ABS_system_choice)
self.tab.combobox_ABS_system_choice.editTextChanged.connect(self.tab.ABS_system_choice)
if stg.ABS_name[0] == "AQUAscat":
self.tab.combobox_ABS_system_choice.setCurrentText(stg.ABS_name[0])
print("combobox_ABS_system_choice.setCurrentIndex(1)", self.tab.combobox_ABS_system_choice.itemText(1),
self.tab.combobox_ABS_system_choice.itemText(2))
else:
self.tab.combobox_ABS_system_choice.setCurrentText(stg.ABS_name[0])
self.tab.plot_backscattered_acoustic_signal_recording()
# app = QApplication(sys.argv)
# sys.exit(app.exec_())
def reshape_variables(self):
for i in stg.acoustic_data:
for f, _ in enumerate(stg.freq[i]):
if f == 0:
depth_temp = np.array([
stg.depth_reshape[i][np.where(stg.depth_reshape[i][:, f] == stg.depth_reshape[i][0, f])[0][0]:
np.where(stg.depth_reshape[i][:, f] == stg.depth_reshape[i][0, f])[0][1], f]
])
time_temp = np.array([
stg.time_reshape[i][
np.where(stg.depth_reshape[i][:, f] == stg.depth_reshape[i][0, f])[0], f]
])
else:
# print(np.where(stg.depth_reshape[i][:, f] == stg.depth_reshape[i][0, f]))
depth_temp = np.insert(depth_temp,
depth_temp.shape[0],
stg.depth_reshape[i][np.where(stg.depth_reshape[i][:, f] == stg.depth_reshape[i][0, f])[0][0]:
np.where(stg.depth_reshape[i][:, f] == stg.depth_reshape[i][0, f])[0][1], f],
axis=0)
time_temp = np.insert(time_temp,
time_temp.shape[0],
stg.time_reshape[i][
np.where(stg.depth_reshape[i][:, f] == stg.depth_reshape[i][0, f])[0], f],
axis=0)
stg.depth.append(depth_temp)
stg.time.append(time_temp)
stg.BS_raw_data.append(np.reshape(stg.BS_raw_data_reshape[i],
(len(stg.freq[i]), stg.depth[i].shape[1], stg.time[i].shape[1])))

BIN
Tuto_acoused.odp Normal file

Binary file not shown.

BIN
Tuto_acoused.pdf Normal file

Binary file not shown.

Binary file not shown.

View File

@ -23,6 +23,27 @@ 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):
@ -31,12 +52,6 @@ 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")
@ -50,7 +65,8 @@ class AboutWindow(QDialog):
# ---------------------------------------------------------- # ----------------------------------------------------------
self.label_logo_AcouSed = QLabel() 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.gridLayout.addWidget(self.label_logo_AcouSed, 0, 0, 5, 1, Qt.AlignCenter)
self.label_acoused = QLabel() self.label_acoused = QLabel()
@ -64,7 +80,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(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.gridLayout.addWidget(self.label_logo_INRAE, 2, 1, 1, 1, Qt.AlignCenter)
self.label_contact = QLabel() self.label_contact = QLabel()
@ -103,11 +119,17 @@ class AboutWindow(QDialog):
self.button_Copyright.clicked.connect(self.copyright_window) self.button_Copyright.clicked.connect(self.copyright_window)
self.button_Support = QPushButton() self.button_FundsPartners = QPushButton()
self.button_Support.setText("Support") self.button_FundsPartners.setText("Funds/Patners")
self.gridLayout_button.addWidget(self.button_Support, 0, 2, 1, 1) 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): def licence_window(self):
lw = Licence() lw = Licence()
@ -117,8 +139,12 @@ class AboutWindow(QDialog):
cw = Copyright() cw = Copyright()
cw.exec() cw.exec()
def support_window(self): def funds_partners_window(self):
sw = Support() sw = FundsPartners()
sw.exec()
def authors_window(self):
sw = Authors()
sw.exec() sw.exec()
@ -149,7 +175,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):
@ -158,9 +184,6 @@ 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)
@ -175,24 +198,17 @@ class Copyright(QDialog):
"All Rights Reserved.") "All Rights Reserved.")
self.label_INRAE = QLabel() 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) self.gridLayout.addWidget(self.label_INRAE, 1, 0, 1, 1, Qt.AlignCenter)
class Support(QDialog): class FundsPartners(QDialog):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
self.logo_path = "./logos" self.setWindowTitle("Funds/Partners")
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)
@ -200,28 +216,85 @@ class Support(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 was supported by OSR6 and CNR Company.") self.label_support.setText("The development of AcouSed software was funded by OSR, Carnot Eau & Environnement, INRAE and CNR Company. \n "
self.gridLayout.addWidget(self.label_support, 0, 0, 1, 2, Qt.AlignLeft) "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 = 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.gridLayout.addWidget(self.label_OSR, 1, 0, 1, 1, Qt.AlignCenter)
self.label_CNR = QLabel() self.label_EUROPE = QLabel()
self.label_CNR.setPixmap(self.logo_CNR.scaledToHeight(32, Qt.SmoothTransformation)) self.label_EUROPE.setPixmap(QPixmap(logos_inst.logo_europe).scaledToHeight(32, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_CNR, 1, 1, 1, 1, Qt.AlignCenter) self.gridLayout.addWidget(self.label_EUROPE, 1, 1, 1, 1, Qt.AlignCenter)
self.label_collaboration = QLabel() self.label_SAONE_RHONE = QLabel()
self.label_collaboration.setText("It was made in collaboration with Ubertone and EDF Companies.") self.label_SAONE_RHONE.setPixmap(QPixmap(logos_inst.logo_saone_rhone).scaledToHeight(64, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_collaboration, 2, 0, 1, 2, Qt.AlignLeft) 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 = QLabel()
self.label_Ubertone.setPixmap(self.logo_Ubertone.scaledToHeight(48, Qt.SmoothTransformation)) self.label_Ubertone.setPixmap(QPixmap(logos_inst.logo_Ubertone).scaledToHeight(24, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_Ubertone, 3, 0, 1, 1, Qt.AlignCenter) self.gridLayout.addWidget(self.label_Ubertone, 2, 2, 1, 1, Qt.AlignCenter)
self.label_EDF = QLabel() self.label_EDF = QLabel()
self.label_EDF.setPixmap(self.logo_EDF.scaledToHeight(48, Qt.SmoothTransformation)) self.label_EDF.setPixmap(QPixmap(logos_inst.logo_EDF).scaledToHeight(48, Qt.SmoothTransformation))
self.gridLayout.addWidget(self.label_EDF, 3, 1, 1, 1, Qt.AlignCenter) 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__": # if __name__ == "__main__":

View File

@ -733,8 +733,32 @@ class AcousticDataTab(QWidget):
# -------------------- Functions for Acoustic dataTab -------------------- # -------------------- Functions for Acoustic dataTab --------------------
def retranslate_acoustic_data_tab(self): def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)
self.fileListWidget.blockSignals(True)
self.combobox_ABS_system_choice.blockSignals(True)
self.combobox_ABS_system_choice.setCurrentText(stg.ABS_name[0])
self.ABS_system_choice()
self.fileListWidget.addFilenames(stg.filename_BS_raw_data)
self.fill_measurements_information_groupbox()
self.fill_table()
self.plot_backscattered_acoustic_signal_recording()
self.plot_profile()
self.update_frequency_combobox()
self.water_attenuation()
self.compute_tmin_tmax()
self.compute_rmin_rmax()
self.set_range_for_spinboxes_bathymetry()
self.combobox_ABS_system_choice.blockSignals(False)
self.fileListWidget.blockSignals(False)
self.blockSignals(False)
def retranslate_acoustic_data_tab(self):
self.groupbox_info.setTitle(_translate("CONSTANT_STRING", cs.MEASUREMENTS_INFORMATION)) self.groupbox_info.setTitle(_translate("CONSTANT_STRING", cs.MEASUREMENTS_INFORMATION))
self.label_date_acoustic_file.setText(_translate("CONSTANT_STRING", cs.DATE) + ":") self.label_date_acoustic_file.setText(_translate("CONSTANT_STRING", cs.DATE) + ":")
@ -953,7 +977,7 @@ class AcousticDataTab(QWidget):
self.gridLayout_groupbox_info.addWidget(self.lineEdit_temperature, 3, 1, 1, 1, Qt.AlignLeft) self.gridLayout_groupbox_info.addWidget(self.lineEdit_temperature, 3, 1, 1, 1, Qt.AlignLeft)
self.label_temperature_unit.show() self.label_temperature_unit.show()
self.gridLayout_groupbox_info.addWidget(self.label_temperature_unit, 3, 2, 1, 1, Qt.AlignLeft) self.gridLayout_groupbox_info.addWidget(self.label_temperature_unit, 3, 2, 1, 1, Qt.AlignLeft)
self.temperature_value() self.setup_temperature_value()
self.label_speed_of_sound.show() self.label_speed_of_sound.show()
self.gridLayout_groupbox_info.addWidget(self.label_speed_of_sound, 4, 0, 1, 1, Qt.AlignLeft) self.gridLayout_groupbox_info.addWidget(self.label_speed_of_sound, 4, 0, 1, 1, Qt.AlignLeft)
@ -1216,25 +1240,31 @@ class AcousticDataTab(QWidget):
self.pushbutton_distance_from_ABS_to_free_surface.blockSignals(False) self.pushbutton_distance_from_ABS_to_free_surface.blockSignals(False)
def temperature_value(self): def setup_temperature_value(self):
self.water_velocity()
self.water_attenuation()
def temperature_value(self):
if findall(r",", self.lineEdit_temperature.text()): if findall(r",", self.lineEdit_temperature.text()):
stg.temperature = float(self.lineEdit_temperature.text().replace(',', '.')) stg.temperature = float(self.lineEdit_temperature.text().replace(',', '.'))
self.lineEdit_temperature.setText(self.lineEdit_temperature.text().replace(',', '.')) self.lineEdit_temperature.setText(self.lineEdit_temperature.text().replace(',', '.'))
else: else:
stg.temperature = float(self.lineEdit_temperature.text()) stg.temperature = float(self.lineEdit_temperature.text())
self.lineEdit_temperature.setText(self.lineEdit_temperature.text()) self.lineEdit_temperature.setText(self.lineEdit_temperature.text())
self.water_velocity() self.water_velocity()
self.water_attenuation() self.water_attenuation()
def water_velocity(self): def water_velocity(self):
"""Computing sond speed from Bilaniuk and Wong 1993""" """Computing sond speed from Bilaniuk and Wong 1993"""
temp = float(self.lineEdit_temperature.text())
C = (1.40238744 * 1e3 + C = (1.40238744 * 1e3 +
5.03836171 * float(self.lineEdit_temperature.text()) - 5.03836171 * temp -
5.81172916 * 1e-2 * float(self.lineEdit_temperature.text()) ** 2 + 5.81172916 * 1e-2 * temp ** 2 +
3.34638117 * 1e-4 * float(self.lineEdit_temperature.text()) ** 3 - 3.34638117 * 1e-4 * temp ** 3 -
1.48259672 * 1e-6 * float(self.lineEdit_temperature.text()) ** 4 + 1.48259672 * 1e-6 * temp ** 4 +
3.16585020 * 1e-9 * float(self.lineEdit_temperature.text()) ** 5) 3.16585020 * 1e-9 * temp ** 5)
stg.water_velocity = C stg.water_velocity = C
self.lineEdit_speed_of_sound.setText(str(round(stg.water_velocity, 2))) self.lineEdit_speed_of_sound.setText(str(round(stg.water_velocity, 2)))
@ -1286,26 +1316,29 @@ class AcousticDataTab(QWidget):
# -------- Computing water attenuation coefficient ----------- # # -------- Computing water attenuation coefficient ----------- #
def water_attenuation(self): def water_attenuation(self):
"""Computing attenuation from François and Garrison 1982""" """Computing attenuation from François and Garrison 1982"""
temp = float(self.lineEdit_temperature.text())
file_id = self.fileListWidget.currentRow()
if self.fileListWidget.count() > 0: if self.fileListWidget.count() > 0:
stg.water_attenuation[self.fileListWidget.currentRow()].clear() stg.water_attenuation[file_id].clear()
for f in stg.freq[self.fileListWidget.currentRow()]: for f in stg.freq[file_id]:
if float(self.lineEdit_temperature.text()) > 20: if temp > 20:
alpha = ((3.964 * 1e-4 - alpha = ((3.964 * 1e-4 -
1.146 * 1e-5 * float(self.lineEdit_temperature.text()) + 1.146 * 1e-5 * temp +
1.45 * 1e-7 * float(self.lineEdit_temperature.text()) ** 2 - 1.45 * 1e-7 * temp ** 2 -
6.5 * 1e-10 * float(self.lineEdit_temperature.text()) ** 3) * 6.5 * 1e-10 * temp ** 3) *
1e-3 * (np.log(10) / 20) * (f * 1e-3) ** 2) 1e-3 * (np.log(10) / 20) * (f * 1e-3) ** 2)
else: else:
alpha = ((4.937 * 1e-4 - alpha = ((4.937 * 1e-4 -
2.59 * 1e-5 * float(self.lineEdit_temperature.text()) + 2.59 * 1e-5 * temp +
9.11 * 1e-7 * float(self.lineEdit_temperature.text()) ** 2 - 9.11 * 1e-7 * temp ** 2 -
1.5 * 1e-8 * float(self.lineEdit_temperature.text()) ** 3) * 1.5 * 1e-8 * temp ** 3) *
1e-3 * (np.log(10) / 20) * (f * 1e-3) ** 2) 1e-3 * (np.log(10) / 20) * (f * 1e-3) ** 2)
stg.water_attenuation[self.fileListWidget.currentRow()].append(alpha) stg.water_attenuation[file_id].append(alpha)
self.lineEdit_sound_attenuation.setText( self.lineEdit_sound_attenuation.setText(
str("%.6f" % stg.water_attenuation[self.fileListWidget.currentRow()][ str("%.6f" % stg.water_attenuation[file_id][
self.combobox_frequency_information.currentIndex()])) self.combobox_frequency_information.currentIndex()]))
def open_dialog_box(self): def open_dialog_box(self):
@ -1642,9 +1675,9 @@ class AcousticDataTab(QWidget):
stg.gain_tx.append(acoustic_data._gain_tx) stg.gain_tx.append(acoustic_data._gain_tx)
stg.water_attenuation.append([]) stg.water_attenuation.append([])
# --- The other acoustic variables lists are filled with empty object. --- self.initiate_setting_parameters_new_others()
# --- They will be used for pre- and post-processing ---
def initiate_setting_parameters_new_others(self):
stg.BS_cross_section.append(np.array([])) stg.BS_cross_section.append(np.array([]))
stg.depth_cross_section.append(np.array([])) stg.depth_cross_section.append(np.array([]))
stg.time_cross_section.append(np.array([])) stg.time_cross_section.append(np.array([]))
@ -1704,6 +1737,9 @@ class AcousticDataTab(QWidget):
self.fill_measurements_information_groupbox_cells() self.fill_measurements_information_groupbox_cells()
self.fill_measurements_information_groupbox_kt() self.fill_measurements_information_groupbox_kt()
self.water_velocity()
self.water_attenuation()
def fill_measurements_information_groupbox_datetime(self): def fill_measurements_information_groupbox_datetime(self):
file_id = self.fileListWidget.currentRow() file_id = self.fileListWidget.currentRow()
print("file_id ", file_id) print("file_id ", file_id)
@ -1741,6 +1777,7 @@ class AcousticDataTab(QWidget):
.currentIndexChanged\ .currentIndexChanged\
.connect(self.combobox_frequency_information_update) .connect(self.combobox_frequency_information_update)
logger.debug(f"Set temperature = {stg.temperature}")
self.lineEdit_temperature.setText(str(stg.temperature)) self.lineEdit_temperature.setText(str(stg.temperature))
self.label_profiles_value.setText( self.label_profiles_value.setText(

View File

@ -21,6 +21,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
import logging
import numpy as np import numpy as np
import pandas as pd import pandas as pd
from math import isinf from math import isinf
@ -50,6 +51,7 @@ from Model.acoustic_inversion_method_high_concentration import AcousticInversion
_translate = QCoreApplication.translate _translate = QCoreApplication.translate
logger = logging.getLogger("acoused")
class AcousticInversionTab(QWidget): class AcousticInversionTab(QWidget):
@ -369,6 +371,14 @@ class AcousticInversionTab(QWidget):
# ------------------------------------ Functions for Acoustic Inversion Tab ---------------------------------------- # ------------------------------------ Functions for Acoustic Inversion Tab ----------------------------------------
# ================================================================================================================== # ==================================================================================================================
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)
# TODO: Update all widgets
self.blockSignals(False)
def update_acoustic_data_choice(self): def update_acoustic_data_choice(self):
self.combobox_acoustic_data_choice.clear() self.combobox_acoustic_data_choice.clear()

View File

@ -21,6 +21,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
import time
import pickle
import logging
import numpy as np
import pandas as pd
from subprocess import Popen
# Form implementation generated from reading ui file 'mainwindow.ui' # Form implementation generated from reading ui file 'mainwindow.ui'
# #
@ -38,12 +45,7 @@ from Model.calibration_constant_kt import CalibrationConstantKt
from View.about_window import AboutWindow from View.about_window import AboutWindow
import settings as stg import settings as stg
import numpy as np logger = logging.getLogger("acoused")
import pandas as pd
from subprocess import Popen
import time
class Ui_MainWindow(object): class Ui_MainWindow(object):
def setupUi(self, MainWindow): def setupUi(self, MainWindow):
@ -170,7 +172,7 @@ class Ui_MainWindow(object):
self.actionAbout.setObjectName("actionAbout") self.actionAbout.setObjectName("actionAbout")
self.actionUserManual = QtWidgets.QAction(self.mainwindow) self.actionUserManual = QtWidgets.QAction(self.mainwindow)
self.actionUserManual.setText("User Manual") self.actionUserManual.setText("Tuto Acoused")
self.action_AcousticInversionTheory = QtWidgets.QAction(self.mainwindow) self.action_AcousticInversionTheory = QtWidgets.QAction(self.mainwindow)
self.action_AcousticInversionTheory.setText("Acoustic inversion theory") self.action_AcousticInversionTheory.setText("Acoustic inversion theory")
@ -310,6 +312,7 @@ class Ui_MainWindow(object):
) )
def open_doc_file(self, filename): def open_doc_file(self, filename):
print(self.current_file_path("filename.pdf"))
QtGui.QDesktopServices.openUrl( QtGui.QDesktopServices.openUrl(
QtCore.QUrl( QtCore.QUrl(
f"file://{self.current_file_path(filename)}" f"file://{self.current_file_path(filename)}"
@ -317,7 +320,7 @@ class Ui_MainWindow(object):
) )
def user_manual(self): def user_manual(self):
self.open_doc_file('AcouSed_UserManual.pdf') self.open_doc_file('Tuto_acoused.pdf')
def inversion_acoustic_theory(self): def inversion_acoustic_theory(self):
self.open_doc_file('Acoustic_Inversion_theory.pdf') self.open_doc_file('Acoustic_Inversion_theory.pdf')

View File

@ -1,3 +1,5 @@
import logging
from PyQt5.QtWidgets import ( from PyQt5.QtWidgets import (
QApplication, QWidget, QVBoxLayout, QHBoxLayout, QApplication, QWidget, QVBoxLayout, QHBoxLayout,
QTextEdit, QPushButton, QSpacerItem, QSpinBox, QTextEdit, QPushButton, QSpacerItem, QSpinBox,
@ -8,6 +10,8 @@ from PyQt5.QtCore import Qt
import settings as stg import settings as stg
logger = logging.getLogger("acoused")
class NoteTab(QWidget): class NoteTab(QWidget):
''' This class generates a enhanced notepad in Note Tab ''' ''' This class generates a enhanced notepad in Note Tab '''
@ -17,6 +21,9 @@ class NoteTab(QWidget):
path_icon = "./icons/" path_icon = "./icons/"
# FIXME: The note are disabled because there are never saved
widget_tab.setEnabled(False)
self.verticalLayout_main_note_tab = QVBoxLayout(widget_tab) self.verticalLayout_main_note_tab = QVBoxLayout(widget_tab)
self.horizontalLayout_toolbar = QHBoxLayout() self.horizontalLayout_toolbar = QHBoxLayout()
@ -130,6 +137,14 @@ class NoteTab(QWidget):
## ------------------------------- ## -------------------------------
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)
# TODO: Update all widgets
self.blockSignals(False)
# def new_text(self): # def new_text(self):
# window = self.ui_mainwindow.tab5 # window = self.ui_mainwindow.tab5
# window.show() # window.show()

View File

@ -28,6 +28,7 @@ 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
@ -189,6 +190,9 @@ 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()
@ -246,6 +250,9 @@ 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 --------------------
@ -271,6 +278,24 @@ 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))
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)
self.fill_comboboxes_and_plot_transect()
self.lineEdit_fine_sediment.setText(stg.filename_fine)
self.lineEdit_fine_sediment.setToolTip(stg.path_fine)
self.fill_table_fine()
self.lineEdit_sand_sediment.setText(stg.filename_sand)
self.lineEdit_sand_sediment.setToolTip(stg.path_sand)
self.fill_table_sand()
#self.plot_sample_position_on_transect()
self.plot_total_concentration()
self.plot_PSD_fine_and_sand_sediments()
self.blockSignals(False)
def last_opened_file_path(self, priority="sand"): def last_opened_file_path(self, priority="sand"):
lst = [] lst = []
@ -317,6 +342,10 @@ class SampleDataTab(QWidget):
self.lineEdit_fine_sediment.setToolTip(stg.path_fine) self.lineEdit_fine_sediment.setToolTip(stg.path_fine)
self.fill_table_fine() self.fill_table_fine()
self.plot_sample_position_on_transect()
self.plot_total_concentration()
self.plot_PSD_fine_and_sand_sediments()
def open_dialog_box_sand_sediment(self): def open_dialog_box_sand_sediment(self):
filename_sand_sediment = QFileDialog.getOpenFileName( filename_sand_sediment = QFileDialog.getOpenFileName(
self, "Sand sediment file", self, "Sand sediment file",
@ -342,6 +371,10 @@ class SampleDataTab(QWidget):
self.lineEdit_sand_sediment.setToolTip(stg.path_sand) self.lineEdit_sand_sediment.setToolTip(stg.path_sand)
self.fill_table_sand() self.fill_table_sand()
self.plot_sample_position_on_transect()
self.plot_total_concentration()
self.plot_PSD_fine_and_sand_sediments()
def load_fine_sediment_data(self): def load_fine_sediment_data(self):
fine_granulo_data = GranuloLoader( fine_granulo_data = GranuloLoader(
os.path.join(stg.path_fine, stg.filename_fine) os.path.join(stg.path_fine, stg.filename_fine)
@ -396,7 +429,7 @@ class SampleDataTab(QWidget):
horizontal_header = list( horizontal_header = list(
itertools.chain( itertools.chain(
["Color", "Sample"], ["Color", "Sample"],
list(map(str, stg.columns_fine[[0, 2]])), [str(stg.columns_fine[0]), str(stg.columns_fine[2])],
list(map(str, stg.columns_fine[3:])) list(map(str, stg.columns_fine[3:]))
) )
) )
@ -424,6 +457,8 @@ 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)
@ -469,12 +504,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.plot_sample_position_on_transect()
self.plot_total_concentration()
self.plot_PSD_fine_and_sand_sediments()
self.tableWidget_fine.blockSignals(False) self.tableWidget_fine.blockSignals(False)
else: else:
@ -495,7 +526,7 @@ class SampleDataTab(QWidget):
horizontal_header = list( horizontal_header = list(
itertools.chain( itertools.chain(
["Color", "Sample"], ["Color", "Sample"],
list(map(str, stg.columns_sand[[0, 2]])), [str(stg.columns_fine[0]), str(stg.columns_fine[2])],
list(map(str, stg.columns_sand[3:])) list(map(str, stg.columns_sand[3:]))
) )
) )
@ -521,6 +552,8 @@ 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,10 +607,6 @@ class SampleDataTab(QWidget):
self.combobox_y_axis.currentIndexChanged\ self.combobox_y_axis.currentIndexChanged\
.connect(self.plot_total_concentration) .connect(self.plot_total_concentration)
self.plot_sample_position_on_transect()
self.plot_total_concentration()
self.plot_PSD_fine_and_sand_sediments()
self.tableWidget_sand.blockSignals(False) self.tableWidget_sand.blockSignals(False)
# --- Function to extract position of sample from table checkboxes to update plots --- # --- Function to extract position of sample from table checkboxes to update plots ---
@ -738,13 +767,19 @@ class SampleDataTab(QWidget):
self.combobox_acoustic_data.clear() self.combobox_acoustic_data.clear()
for n, m in enumerate(stg.noise_method): for n, m in enumerate(stg.noise_method):
if stg.noise_method[n] == 0: if stg.noise_method[n] == 0:
self.combobox_acoustic_data.addItem(stg.filename_BS_raw_data[n]) self.combobox_acoustic_data\
.addItem(stg.filename_BS_raw_data[n])
elif stg.noise_method[n] != 0: elif stg.noise_method[n] != 0:
self.combobox_acoustic_data.addItem(stg.data_preprocessed[n]) self.combobox_acoustic_data\
.addItem(stg.data_preprocessed[n])
self.plot_sample_position_on_transect() self.plot_sample_position_on_transect()
self.combobox_acoustic_data.currentIndexChanged.connect(self.update_plot_sample_position_on_transect) self.combobox_acoustic_data\
self.combobox_frequencies.currentIndexChanged.connect(self.update_plot_sample_position_on_transect) .currentIndexChanged\
.connect(self.update_plot_sample_position_on_transect)
self.combobox_frequencies\
.currentIndexChanged\
.connect(self.update_plot_sample_position_on_transect)
def plot_sample_position_on_transect(self): def plot_sample_position_on_transect(self):
self.verticalLayout_groupbox_plot_transect\ self.verticalLayout_groupbox_plot_transect\
@ -998,7 +1033,7 @@ class SampleDataTab(QWidget):
self.axis_plot_sample_position_on_transect.text( self.axis_plot_sample_position_on_transect.text(
1, .85, stg.freq_text[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()], 1, .85, stg.freq_text[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()],
fontsize=14, fontweight='bold', fontname="Ubuntu", c="black", alpha=0.5, fontsize=14, fontweight='bold', fontname="DejaVu Sans", c="black", alpha=0.5,
horizontalalignment='right', verticalalignment='bottom', horizontalalignment='right', verticalalignment='bottom',
transform=self.axis_plot_sample_position_on_transect.transAxes) transform=self.axis_plot_sample_position_on_transect.transAxes)
@ -1006,11 +1041,11 @@ class SampleDataTab(QWidget):
self.axis_plot_sample_position_on_transect.tick_params(axis='both', labelsize=8) self.axis_plot_sample_position_on_transect.tick_params(axis='both', labelsize=8)
self.axis_plot_sample_position_on_transect.text(.98, .03, "Time (sec)", self.axis_plot_sample_position_on_transect.text(.98, .03, "Time (sec)",
fontsize=10, fontweight='bold', fontname="Ubuntu", c="black", alpha=0.9, fontsize=10, fontweight='bold', fontname="DejaVu Sans", c="black", alpha=0.9,
horizontalalignment='right', verticalalignment='bottom', rotation='horizontal', horizontalalignment='right', verticalalignment='bottom', rotation='horizontal',
transform=self.axis_plot_sample_position_on_transect.transAxes) transform=self.axis_plot_sample_position_on_transect.transAxes)
self.axis_plot_sample_position_on_transect.text(.04, .53, "Depth (m)", self.axis_plot_sample_position_on_transect.text(.04, .53, "Depth (m)",
fontsize=10, fontweight='bold', fontname="Ubuntu", c="black", alpha=0.9, fontsize=10, fontweight='bold', fontname="DejaVu Sans", c="black", alpha=0.9,
horizontalalignment='right', verticalalignment='bottom', rotation='vertical', horizontalalignment='right', verticalalignment='bottom', rotation='vertical',
transform=self.axis_plot_sample_position_on_transect.transAxes) transform=self.axis_plot_sample_position_on_transect.transAxes)
@ -1324,7 +1359,7 @@ class SampleDataTab(QWidget):
self.axis_plot_sample_position_on_transect.text( self.axis_plot_sample_position_on_transect.text(
1, .85, stg.freq_text[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()], 1, .85, stg.freq_text[self.combobox_acoustic_data.currentIndex()][self.combobox_frequencies.currentIndex()],
fontsize=14, fontweight='bold', fontname="Ubuntu", c="black", alpha=0.5, fontsize=14, fontweight='bold', fontname="DejaVu Sans", c="black", alpha=0.5,
horizontalalignment='right', verticalalignment='bottom', horizontalalignment='right', verticalalignment='bottom',
transform=self.axis_plot_sample_position_on_transect.transAxes) transform=self.axis_plot_sample_position_on_transect.transAxes)
@ -1332,13 +1367,13 @@ class SampleDataTab(QWidget):
self.axis_plot_sample_position_on_transect.tick_params(axis='both', labelsize=8) self.axis_plot_sample_position_on_transect.tick_params(axis='both', labelsize=8)
self.axis_plot_sample_position_on_transect.text(.98, .03, "Time (sec)", self.axis_plot_sample_position_on_transect.text(.98, .03, "Time (sec)",
fontsize=10, fontweight='bold', fontname="Ubuntu", c="black", fontsize=10, fontweight='bold', fontname="DejaVu Sans", c="black",
alpha=0.9, alpha=0.9,
horizontalalignment='right', verticalalignment='bottom', horizontalalignment='right', verticalalignment='bottom',
rotation='horizontal', rotation='horizontal',
transform=self.axis_plot_sample_position_on_transect.transAxes) transform=self.axis_plot_sample_position_on_transect.transAxes)
self.axis_plot_sample_position_on_transect.text(.04, .53, "Depth (m)", self.axis_plot_sample_position_on_transect.text(.04, .53, "Depth (m)",
fontsize=10, fontweight='bold', fontname="Ubuntu", c="black", fontsize=10, fontweight='bold', fontname="DejaVu Sans", c="black",
alpha=0.9, alpha=0.9,
horizontalalignment='right', verticalalignment='bottom', horizontalalignment='right', verticalalignment='bottom',
rotation='vertical', rotation='vertical',
@ -1367,6 +1402,11 @@ 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)
@ -1632,6 +1672,11 @@ 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

@ -857,6 +857,14 @@ class SedimentCalibrationTab(QWidget):
# ----------------------------------- Functions for Signal processing Tab -------------------------------------- # ----------------------------------- Functions for Signal processing Tab --------------------------------------
# ============================================================================================================== # ==============================================================================================================
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)
self.function_pushbutton_update_acoustic_file()
self.blockSignals(False)
def function_pushbutton_update_acoustic_file(self): def function_pushbutton_update_acoustic_file(self):
if len(stg.data_preprocessed) == 0: if len(stg.data_preprocessed) == 0:
return return
@ -1776,10 +1784,6 @@ class SedimentCalibrationTab(QWidget):
) )
def update_label_kt_value_for_calibration(self): def update_label_kt_value_for_calibration(self):
print("self.combobox_freq1.currentIndex() ",
self.combobox_freq1.currentIndex(),
self.combobox_freq1.currentText())
freq_1 = self.combobox_freq1.currentIndex() freq_1 = self.combobox_freq1.currentIndex()
freq_2 = self.combobox_freq2.currentIndex() freq_2 = self.combobox_freq2.currentIndex()

View File

@ -511,12 +511,31 @@ 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"))
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)
self.combobox_acoustic_data_choice.blockSignals(True)
# -------------------------------------------------------------------------------------------------------------- self.full_update_fill_text()
# -------------------------------------------------------------------------------------------------------------- self.update_SignalPreprocessingTab()
# +++++++++ FUNCTION +++++++++
# -------------------------------------------------------------------------------------------------------------- self.combobox_acoustic_data_choice.blockSignals(False)
# -------------------------------------------------------------------------------------------------------------- self.blockSignals(False)
def full_update_fill_text(self):
data_id = self.combobox_acoustic_data_choice.currentIndex()
self.lineEdit_profile_tail_value.setText(
str(stg.noise_value[data_id])
)
self.lineEdit_SNR_criterion.setText(
str(stg.SNR_filter_value[data_id])
)
self.lineEdit_horizontal_average.setText(
str(stg.Nb_cells_to_average_BS_signal[data_id])
)
def update_SignalPreprocessingTab(self): def update_SignalPreprocessingTab(self):
@ -564,6 +583,33 @@ class SignalProcessingTab(QWidget):
self.combobox_freq_noise_from_profile_tail.blockSignals(False) self.combobox_freq_noise_from_profile_tail.blockSignals(False)
self.combobox_acoustic_data_choice.blockSignals(False) self.combobox_acoustic_data_choice.blockSignals(False)
def _is_correct_shape(self, data):
data_id = self.combobox_acoustic_data_choice.currentIndex()
if stg.time_cross_section[data_id].shape != (0,):
x_time = stg.time_cross_section[data_id]
else:
x_time = stg.time[data_id]
if stg.depth_cross_section[data_id].shape != (0,):
y_depth = stg.depth_cross_section[data_id]
else:
y_depth = stg.depth[data_id]
time_shape, = x_time[data_id].shape
depth_shape, = y_depth[data_id].shape
logger.debug(f"_is_correct_shape: time shape: {time_shape}")
logger.debug(f"_is_correct_shape: depth shape: {depth_shape}")
logger.debug(f"_is_correct_shape: data shape: {data[data_id].shape}")
if data[data_id].shape == (0,):
return False
_, y, z = data[data_id].shape
return (y == depth_shape and z == time_shape)
def recompute(self): def recompute(self):
data_id = self.combobox_acoustic_data_choice.currentIndex() data_id = self.combobox_acoustic_data_choice.currentIndex()
@ -784,9 +830,17 @@ class SignalProcessingTab(QWidget):
self.compute_average_profile_tail() self.compute_average_profile_tail()
self.lineEdit_SNR_criterion.setText(str(stg.SNR_filter_value[self.combobox_acoustic_data_choice.currentIndex()])) self.lineEdit_SNR_criterion.setText(
str(stg.SNR_filter_value[
self.combobox_acoustic_data_choice.currentIndex()
])
)
self.lineEdit_horizontal_average.setText(str(stg.Nb_cells_to_average_BS_signal[self.combobox_acoustic_data_choice.currentIndex()])) self.lineEdit_horizontal_average.setText(
str(stg.Nb_cells_to_average_BS_signal[
self.combobox_acoustic_data_choice.currentIndex()
])
)
self.combobox_frequency_profile.clear() self.combobox_frequency_profile.clear()
self.combobox_frequency_profile.addItems( self.combobox_frequency_profile.addItems(
@ -808,28 +862,29 @@ class SignalProcessingTab(QWidget):
if len(stg.filename_BS_raw_data) == 0: if len(stg.filename_BS_raw_data) == 0:
pass pass
else: else:
data_id = self.combobox_acoustic_data_choice.currentIndex()
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()] = np.array([]) stg.BS_noise_raw_data[data_id] = np.array([])
stg.BS_noise_averaged_data[self.combobox_acoustic_data_choice.currentIndex()] = np.array([]) stg.BS_noise_averaged_data[data_id] = np.array([])
stg.SNR_raw_data[self.combobox_acoustic_data_choice.currentIndex()] = np.array([]) stg.SNR_raw_data[data_id] = np.array([])
stg.SNR_cross_section[self.combobox_acoustic_data_choice.currentIndex()] = np.array([]) stg.SNR_cross_section[data_id] = np.array([])
stg.SNR_stream_bed[self.combobox_acoustic_data_choice.currentIndex()] = np.array([]) stg.SNR_stream_bed[data_id] = np.array([])
stg.time_noise[self.combobox_acoustic_data_choice.currentIndex()] = np.array([]) stg.time_noise[data_id] = np.array([])
stg.SNR_filter_value[self.combobox_acoustic_data_choice.currentIndex()] = 0 stg.SNR_filter_value[data_id] = 0
stg.BS_raw_data_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()] = np.array([]) stg.BS_raw_data_pre_process_SNR[data_id] = np.array([])
stg.BS_raw_data_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = np.array([]) stg.BS_raw_data_pre_process_average[data_id] = np.array([])
stg.BS_cross_section_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()] = np.array([]) stg.BS_cross_section_pre_process_SNR[data_id] = np.array([])
stg.BS_cross_section_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = np.array([]) stg.BS_cross_section_pre_process_average[data_id] = np.array([])
stg.BS_stream_bed_pre_process_SNR[self.combobox_acoustic_data_choice.currentIndex()] = np.array([]) stg.BS_stream_bed_pre_process_SNR[data_id] = np.array([])
stg.BS_stream_bed_pre_process_average[self.combobox_acoustic_data_choice.currentIndex()] = np.array([]) stg.BS_stream_bed_pre_process_average[data_id] = np.array([])
print("stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()]", stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()]) print("stg.noise_method[data_id]", stg.noise_method[data_id])
if stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 0: if stg.noise_method[data_id] == 0:
self.lineEdit_noise_file.clear() self.lineEdit_noise_file.clear()
elif stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] == 1: elif stg.noise_method[data_id] == 1:
self.lineEdit_val1.clear() self.lineEdit_val1.clear()
self.lineEdit_val1.setText("0.00") self.lineEdit_val1.setText("0.00")
@ -946,136 +1001,140 @@ class SignalProcessingTab(QWidget):
def load_noise_data_and_compute_SNR(self): def load_noise_data_and_compute_SNR(self):
data_id = self.combobox_acoustic_data_choice.currentIndex()
stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] = 0 stg.noise_method[data_id] = 0
noise_data = AcousticDataLoader(stg.path_BS_noise_data[self.combobox_acoustic_data_choice.currentIndex()] + noise_data = AcousticDataLoader(stg.path_BS_noise_data[data_id] +
"/" + "/" +
stg.filename_BS_noise_data[self.combobox_acoustic_data_choice.currentIndex()]) stg.filename_BS_noise_data[data_id])
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()] = noise_data._BS_raw_data stg.BS_noise_raw_data[data_id] = noise_data._BS_raw_data
stg.time_noise[self.combobox_acoustic_data_choice.currentIndex()] = noise_data._time stg.time_noise[data_id] = noise_data._time
stg.depth_noise[self.combobox_acoustic_data_choice.currentIndex()] = noise_data._r stg.depth_noise[data_id] = noise_data._r
if stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): if stg.BS_stream_bed[data_id].shape != (0,):
noise = np.zeros(stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()].shape) noise = np.zeros(stg.BS_stream_bed[data_id].shape)
for f, _ in enumerate(noise_data._freq): for f, _ in enumerate(noise_data._freq):
noise[f, :, :] = np.mean( noise[f, :, :] = np.mean(
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()][f, :, :], axis=(0, 1)) stg.BS_noise_raw_data[data_id][f, :, :], axis=(0, 1))
stg.BS_noise_averaged_data[self.combobox_acoustic_data_choice.currentIndex()] = noise stg.BS_noise_averaged_data[data_id] = noise
stg.SNR_stream_bed[self.combobox_acoustic_data_choice.currentIndex()] = ( stg.SNR_stream_bed[data_id] = (
np.divide((stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()] - np.divide((stg.BS_stream_bed[data_id] -
stg.BS_noise_averaged_data[self.combobox_acoustic_data_choice.currentIndex()]) ** 2, stg.BS_noise_averaged_data[data_id]) ** 2,
stg.BS_noise_averaged_data[self.combobox_acoustic_data_choice.currentIndex()] ** 2)) stg.BS_noise_averaged_data[data_id] ** 2))
elif stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): elif stg.BS_cross_section[data_id].shape != (0,):
noise = np.zeros(stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape) noise = np.zeros(stg.BS_cross_section[data_id].shape)
for f, _ in enumerate(noise_data._freq): for f, _ in enumerate(noise_data._freq):
noise[f, :, :] = np.mean( noise[f, :, :] = np.mean(
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()][f, :, :], axis=(0, 1)) stg.BS_noise_raw_data[data_id][f, :, :], axis=(0, 1))
stg.BS_noise_averaged_data[self.combobox_acoustic_data_choice.currentIndex()] = noise stg.BS_noise_averaged_data[data_id] = noise
stg.SNR_cross_section[self.combobox_acoustic_data_choice.currentIndex()] = ( stg.SNR_cross_section[data_id] = (
np.divide((stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()] - np.divide((stg.BS_cross_section[data_id] -
stg.BS_noise_averaged_data[self.combobox_acoustic_data_choice.currentIndex()]) ** 2, stg.BS_noise_averaged_data[data_id]) ** 2,
stg.BS_noise_averaged_data[self.combobox_acoustic_data_choice.currentIndex()] ** 2)) stg.BS_noise_averaged_data[data_id] ** 2))
# stg.SNR_reshape = np.reshape(stg.SNR_cross_section, (stg.r.shape[1] * stg.t.shape[1], stg.freq.shape[0]), order="F") # stg.SNR_reshape = np.reshape(stg.SNR_cross_section, (stg.r.shape[1] * stg.t.shape[1], stg.freq.shape[0]), order="F")
else: else:
noise = np.zeros(stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()].shape) noise = np.zeros(stg.BS_raw_data[data_id].shape)
for f, _ in enumerate(noise_data._freq): for f, _ in enumerate(noise_data._freq):
noise[f, :, :] = np.mean( noise[f, :, :] = np.mean(
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()][f, :, :], axis=(0, 1)) stg.BS_noise_raw_data[data_id][f, :, :], axis=(0, 1))
stg.BS_noise_averaged_data[self.combobox_acoustic_data_choice.currentIndex()] = noise stg.BS_noise_averaged_data[data_id] = noise
stg.SNR_raw_data[self.combobox_acoustic_data_choice.currentIndex()] = ( stg.SNR_raw_data[data_id] = (
np.divide((stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()] - np.divide((stg.BS_raw_data[data_id] -
stg.BS_noise_averaged_data[self.combobox_acoustic_data_choice.currentIndex()]) ** 2, stg.BS_noise_averaged_data[data_id]) ** 2,
stg.BS_noise_averaged_data[self.combobox_acoustic_data_choice.currentIndex()] ** 2)) stg.BS_noise_averaged_data[data_id] ** 2))
def open_plot_noise_window(self): def open_plot_noise_window(self):
pnw = PlotNoiseWindow() pnw = PlotNoiseWindow()
pnw.exec() pnw.exec()
def compute_noise_from_profile_tail_value(self): def compute_noise_from_profile_tail_value(self):
data_id = self.combobox_acoustic_data_choice.currentIndex()
stg.noise_method[self.combobox_acoustic_data_choice.currentIndex()] = 1 stg.noise_method[data_id] = 1
stg.noise_value[data_id] = (
float(self.lineEdit_profile_tail_value.text().replace(",", "."))
)
stg.noise_value[self.combobox_acoustic_data_choice.currentIndex()] = ( if stg.time_cross_section[data_id].shape != (0,):
float(self.lineEdit_profile_tail_value.text().replace(",", "."))) stg.time_noise[data_id] = (
stg.time_cross_section[data_id]
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): )
stg.time_noise[self.combobox_acoustic_data_choice.currentIndex()] = (
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()])
else: else:
stg.time_noise[self.combobox_acoustic_data_choice.currentIndex()] = ( stg.time_noise[data_id] = (
stg.time[self.combobox_acoustic_data_choice.currentIndex()]) stg.time[data_id]
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): )
stg.depth_noise[self.combobox_acoustic_data_choice.currentIndex()] = ( if stg.depth_cross_section[data_id].shape != (0,):
stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()]) stg.depth_noise[data_id] = (
stg.depth_cross_section[data_id]
)
else: else:
stg.depth_noise[self.combobox_acoustic_data_choice.currentIndex()] = ( stg.depth_noise[data_id] = (
stg.depth[self.combobox_acoustic_data_choice.currentIndex()]) stg.depth[data_id]
)
# --- Compute noise from value and compute SNR --- # --- Compute noise from value and compute SNR ---
if self._is_correct_shape(stg.BS_stream_bed):
if stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): stg.BS_noise_raw_data[data_id] = np.array([])
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()] = np.array([]) stg.BS_noise_raw_data[data_id] = (
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()] = ( np.full(stg.BS_stream_bed[data_id].shape,
np.full(stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()].shape,
float(self.lineEdit_profile_tail_value.text().replace(",", ".")))) float(self.lineEdit_profile_tail_value.text().replace(",", "."))))
stg.BS_noise_averaged_data[self.combobox_acoustic_data_choice.currentIndex()] = ( stg.BS_noise_averaged_data[data_id] = (
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()][:, :, stg.BS_noise_raw_data[data_id][:, :,
:stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()].shape[2]]) :stg.BS_stream_bed[data_id].shape[2]])
stg.SNR_stream_bed[self.combobox_acoustic_data_choice.currentIndex()] = ( stg.SNR_stream_bed[data_id] = (
np.divide((stg.BS_stream_bed[self.combobox_acoustic_data_choice.currentIndex()] np.divide((stg.BS_stream_bed[data_id]
- stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()]) ** 2, - stg.BS_noise_raw_data[data_id]) ** 2,
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()] ** 2)) stg.BS_noise_raw_data[data_id] ** 2))
elif stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): elif self._is_correct_shape(stg.BS_cross_section):
stg.BS_noise_raw_data[data_id] = (
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()] = ( np.full(stg.BS_cross_section[data_id].shape,
np.full(stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape,
float(self.lineEdit_profile_tail_value.text().replace(",", ".")))) float(self.lineEdit_profile_tail_value.text().replace(",", "."))))
stg.BS_noise_averaged_data[self.combobox_acoustic_data_choice.currentIndex()] = ( stg.BS_noise_averaged_data[data_id] = (
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()][:, :, stg.BS_noise_raw_data[data_id][:, :,
:stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape[2]]) :stg.BS_cross_section[data_id].shape[2]])
stg.SNR_cross_section[self.combobox_acoustic_data_choice.currentIndex()] = ( stg.SNR_cross_section[data_id] = (
np.divide((stg.BS_cross_section[self.combobox_acoustic_data_choice.currentIndex()] np.divide((stg.BS_cross_section[data_id]
- stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()]) ** 2, - stg.BS_noise_raw_data[data_id]) ** 2,
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()] ** 2)) # stg.BS_noise_raw_data[data_id] ** 2)) #
else: else:
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()] = ( stg.BS_noise_raw_data[data_id] = (
np.full(stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()].shape, np.full(stg.BS_raw_data[data_id].shape,
float(self.lineEdit_profile_tail_value.text().replace(",", ".")))) float(self.lineEdit_profile_tail_value.text().replace(",", "."))))
stg.BS_noise_averaged_data[self.combobox_acoustic_data_choice.currentIndex()] = ( stg.BS_noise_averaged_data[data_id] = (
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()]) stg.BS_noise_raw_data[data_id])
stg.SNR_raw_data[self.combobox_acoustic_data_choice.currentIndex()] = ( stg.SNR_raw_data[data_id] = (
np.divide((stg.BS_raw_data[self.combobox_acoustic_data_choice.currentIndex()] np.divide((stg.BS_raw_data[data_id]
- stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()]) ** 2, - stg.BS_noise_raw_data[data_id]) ** 2,
stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()] ** 2)) stg.BS_noise_raw_data[data_id] ** 2))
self.combobox_frequency_profile.clear() self.combobox_frequency_profile.clear()
self.combobox_frequency_profile.addItems( self.combobox_frequency_profile.addItems(
[f for f in stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()]]) [f for f in stg.freq_text[data_id]])
# --- Trigger graphic widgets --- # --- Trigger graphic widgets ---
if stg.SNR_filter_value[self.combobox_acoustic_data_choice.currentIndex()] == 0: if stg.SNR_filter_value[data_id] == 0:
self.lineEdit_SNR_criterion.setText("0.00") self.lineEdit_SNR_criterion.setText("0.00")
else: else:
self.lineEdit_SNR_criterion.setText(str(stg.SNR_filter_value[self.combobox_acoustic_data_choice.currentIndex()])) self.lineEdit_SNR_criterion.setText(str(stg.SNR_filter_value[data_id]))
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): if stg.time_cross_section[data_id].shape != (0,):
self.slider.setMaximum(stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape[1]) self.slider.setMaximum(stg.time_cross_section[data_id].shape[1])
else: else:
self.slider.setMaximum(stg.time[self.combobox_acoustic_data_choice.currentIndex()].shape[1]) self.slider.setMaximum(stg.time[data_id].shape[1])
# self.activate_list_of_pre_processed_data() # self.activate_list_of_pre_processed_data()
@ -1123,14 +1182,17 @@ class SignalProcessingTab(QWidget):
# elif self.canvas_SNR == None: # elif self.canvas_SNR == None:
else: else:
data_id = self.combobox_acoustic_data_choice.currentIndex()
if ((self.combobox_acoustic_data_choice.currentIndex() != -1) if ((data_id != -1)
and (stg.BS_noise_raw_data[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,))): and (stg.BS_noise_raw_data[data_id].shape != (0,))):
self.verticalLayout_groupbox_plot_SNR.removeWidget(self.toolbar_SNR) self.verticalLayout_groupbox_plot_SNR.removeWidget(self.toolbar_SNR)
self.verticalLayout_groupbox_plot_SNR.removeWidget(self.scroll_SNR) self.verticalLayout_groupbox_plot_SNR.removeWidget(self.scroll_SNR)
self.fig_SNR, self.axis_SNR = plt.subplots(nrows=stg.freq[self.combobox_acoustic_data_choice.currentIndex()].shape[0], ncols=1, sharex=True, sharey=False, layout='constrained') self.fig_SNR, self.axis_SNR = plt.subplots(
nrows=stg.freq[data_id].shape[0], ncols=1,
sharex=True, sharey=False, layout='constrained'
)
self.canvas_SNR = FigureCanvas(self.fig_SNR) self.canvas_SNR = FigureCanvas(self.fig_SNR)
self.toolbar_SNR = NavigationToolBar(self.canvas_SNR, self) self.toolbar_SNR = NavigationToolBar(self.canvas_SNR, self)
@ -1139,158 +1201,82 @@ class SignalProcessingTab(QWidget):
self.verticalLayout_groupbox_plot_SNR.addWidget(self.toolbar_SNR) self.verticalLayout_groupbox_plot_SNR.addWidget(self.toolbar_SNR)
self.verticalLayout_groupbox_plot_SNR.addWidget(self.scroll_SNR) self.verticalLayout_groupbox_plot_SNR.addWidget(self.scroll_SNR)
for f, _ in enumerate(stg.freq[self.combobox_acoustic_data_choice.currentIndex()]): for f, _ in enumerate(stg.freq[data_id]):
if stg.SNR_stream_bed[data_id].shape != (0,):
if stg.SNR_stream_bed[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): SNR_data = stg.SNR_stream_bed
elif stg.SNR_cross_section[data_id].shape != (0,):
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): SNR_data = stg.SNR_cross_section
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
x, y = np.meshgrid(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][f, :],
stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][f, :])
elif stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
x, y = np.meshgrid(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][f, :],
stg.depth[self.combobox_acoustic_data_choice.currentIndex()][f, :])
if stg.time_cross_section[data_id].shape != (0,):
time_data = stg.time_cross_section
else: else:
time_data = stg.time
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): if stg.depth_cross_section[data_id].shape != (0,):
depth_data = stg.depth_cross_section
elif stg.depth[data_id].shape != (0,):
depth_data = stg.depth
x, y = np.meshgrid( x, y = np.meshgrid(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][f, :], time_data[data_id][f, :],
stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][f, :]) depth_data[data_id][f, :]
)
elif stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): val_min = np.nanmin(SNR_data[data_id][f, :, :])
val_max = np.nanmax(SNR_data[data_id][f, :, :])
x, y = np.meshgrid(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][f, :],
stg.depth[self.combobox_acoustic_data_choice.currentIndex()][f, :])
val_min = np.nanmin(stg.SNR_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][f, :, :])
val_max = np.nanmax(stg.SNR_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][f, :, :])
if val_min == val_max:
levels = np.array([00.1, 1, 2, 10, 100, 1000, 1e6]) levels = np.array([00.1, 1, 2, 10, 100, 1000, 1e6])
bounds = [00.1, 1, 2, 10, 100, 1000, val_max * 1.2] bounds = [00.1, 1, 2, 10, 100, 1000, val_max * 1.2]
norm = BoundaryNorm(boundaries=bounds, ncolors=300)
else: if val_min != val_max:
if val_min == 0: if val_min == 0:
val_min = 1e-5 val_min = 1e-5
if val_max > 1000:
levels = np.array([00.1, 1, 2, 10, 100, 1000, 1e6])
bounds = [00.1, 1, 2, 10, 100, 1000, val_max * 1.2]
norm = BoundaryNorm(boundaries=bounds, ncolors=300)
else: else:
levels = np.array([00.1, 1, 2, 10, 100, 1000, val_max * 1000 + 1]) levels = np.array(
bounds = [00.1, 1, 2, 10, 100, 1000, val_max * 1000 + 1] [00.1, 1, 2, 10, 100, 1000, val_max * 1000 + 1]
)
bounds = [
00.1, 1, 2, 10, 100, 1000,
val_max * 1000 + 1
]
norm = BoundaryNorm(boundaries=bounds, ncolors=300) norm = BoundaryNorm(boundaries=bounds, ncolors=300)
cf = (self.axis_SNR[f].contourf(x, -y, cf = self.axis_SNR[f].contourf(
stg.SNR_stream_bed[self.combobox_acoustic_data_choice.currentIndex()][f, :, :], x, -y,
SNR_data[data_id][f, :, :],
levels, cmap='gist_rainbow', levels, cmap='gist_rainbow',
norm=norm)) norm=norm
)
elif stg.SNR_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): self.axis_SNR[f].text(
1, .70, stg.freq_text[data_id][f],
if stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): fontsize=14, fontweight='bold', fontname="DejaVu Sans",
c="black", alpha=0.5,
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,): horizontalalignment='right',
verticalalignment='bottom',
x, y = np.meshgrid( transform=self.axis_SNR[f].transAxes
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][f, :], )
stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][f, :])
elif stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
x, y = np.meshgrid(
stg.time_cross_section[self.combobox_acoustic_data_choice.currentIndex()][f, :],
stg.depth[self.combobox_acoustic_data_choice.currentIndex()][f, :])
else:
if stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
x, y = np.meshgrid(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][f, :],
stg.depth_cross_section[self.combobox_acoustic_data_choice.currentIndex()][f, :])
elif stg.depth[self.combobox_acoustic_data_choice.currentIndex()].shape != (0,):
x, y = np.meshgrid(
stg.time[self.combobox_acoustic_data_choice.currentIndex()][f, :],
stg.depth[self.combobox_acoustic_data_choice.currentIndex()][f, :])
val_min = np.nanmin(stg.SNR_cross_section[self.combobox_acoustic_data_choice.currentIndex()][f, :, :])
val_max = np.nanmax(stg.SNR_cross_section[self.combobox_acoustic_data_choice.currentIndex()][f, :, :])
if val_min == val_max:
levels = np.array([00.1, 1, 2, 10, 100, 1000, 1e6])
bounds = [00.1, 1, 2, 10, 100, 1000, val_max * 1.2]
norm = BoundaryNorm(boundaries=bounds, ncolors=300)
else:
if val_min == 0:
val_min = 1e-5
if val_max > 1000:
levels = np.array([00.1, 1, 2, 10, 100, 1000, 1e6])
bounds = [00.1, 1, 2, 10, 100, 1000, val_max * 1.2]
norm = BoundaryNorm(boundaries=bounds, ncolors=300)
else:
levels = np.array([00.1, 1, 2, 10, 100, 1000, val_max * 1000 + 1])
bounds = [00.1, 1, 2, 10, 100, 1000, val_max * 1000 + 1]
norm = BoundaryNorm(boundaries=bounds, ncolors=300)
cf = (self.axis_SNR[f].contourf(x, -y,
stg.SNR_cross_section[
self.combobox_acoustic_data_choice.currentIndex()][f, :, :],
levels, cmap='gist_rainbow', norm=norm))
else:
x, y = np.meshgrid(stg.time[self.combobox_acoustic_data_choice.currentIndex()][0, :],
stg.depth[self.combobox_acoustic_data_choice.currentIndex()][0, :])
val_min = np.nanmin(stg.SNR_raw_data[self.combobox_acoustic_data_choice.currentIndex()][f, :, :])
val_max = np.nanmax(stg.SNR_raw_data[self.combobox_acoustic_data_choice.currentIndex()][f, :, :])
if val_min == val_max:
levels = np.array([00.1, 1, 2, 10, 100, 1000, 1e6])
bounds = [00.1, 1, 2, 10, 100, 1000, val_max * 1.2]
norm = BoundaryNorm(boundaries=bounds, ncolors=300)
else:
if val_min == 0:
val_min = 1e-5
if val_max > 1000:
levels = np.array([00.1, 1, 2, 10, 100, 1000, 1e6])
bounds = [00.1, 1, 2, 10, 100, 1000, val_max * 1.2]
norm = BoundaryNorm(boundaries=bounds, ncolors=300)
else:
levels = np.array([00.1, 1, 2, 10, 100, 1000, val_max*1000 + 1])
bounds = [00.1, 1, 2, 10, 100, 1000, val_max * 1000 + 1]
norm = BoundaryNorm(boundaries=bounds, ncolors=300)
cf = (self.axis_SNR[f].contourf(x, -y,
stg.SNR_raw_data[
self.combobox_acoustic_data_choice.currentIndex()][f, :, :],
levels, cmap='gist_rainbow', norm=norm))
self.axis_SNR[f].text(1, .70, stg.freq_text[self.combobox_acoustic_data_choice.currentIndex()][f],
fontsize=14, fontweight='bold', fontname="DejaVu Sans", c="black", alpha=0.5,
horizontalalignment='right', verticalalignment='bottom',
transform=self.axis_SNR[f].transAxes)
self.fig_SNR.supxlabel('Time (sec)', fontsize=10) self.fig_SNR.supxlabel('Time (sec)', fontsize=10)
self.fig_SNR.supylabel('Depth (m)', fontsize=10) self.fig_SNR.supylabel('Depth (m)', fontsize=10)
cbar = self.fig_SNR.colorbar(cf, ax=self.axis_SNR[:], shrink=1, location='right') cbar = self.fig_SNR.colorbar(
cbar.set_label(label='Signal to Noise Ratio', rotation=270, labelpad=10) cf, ax=self.axis_SNR[:],
cbar.set_ticklabels(['0', '1', '2', '10', '100', r'10$^3$', r'10$^6$']) shrink=1, location='right'
)
cbar.set_label(
label='Signal to Noise Ratio',
rotation=270, labelpad=10
)
cbar.set_ticklabels(
[
'0', '1', '2', '10', '100',
r'10$^3$', r'10$^6$'
]
)
self.fig_SNR.canvas.draw_idle() self.fig_SNR.canvas.draw_idle()
else: else:
self.verticalLayout_groupbox_plot_SNR.removeWidget(self.toolbar_SNR) self.verticalLayout_groupbox_plot_SNR.removeWidget(self.toolbar_SNR)
self.verticalLayout_groupbox_plot_SNR.removeWidget(self.scroll_SNR) self.verticalLayout_groupbox_plot_SNR.removeWidget(self.scroll_SNR)
@ -1412,9 +1398,6 @@ class SignalProcessingTab(QWidget):
x_time = stg.time[data_id] x_time = stg.time[data_id]
y_depth = stg.depth[data_id] y_depth = stg.depth[data_id]
logger.debug(f"x_time: {x_time[data_id].shape}")
logger.debug(f"y_depth: {y_depth[data_id].shape}")
for f, _ in enumerate(stg.freq[data_id]): for f, _ in enumerate(stg.freq[data_id]):
if stg.BS_stream_bed_pre_process_average[data_id].shape != (0,): if stg.BS_stream_bed_pre_process_average[data_id].shape != (0,):
BS_data = stg.BS_stream_bed_pre_process_average BS_data = stg.BS_stream_bed_pre_process_average
@ -1435,8 +1418,6 @@ class SignalProcessingTab(QWidget):
elif stg.BS_raw_data[data_id].shape != (0,): elif stg.BS_raw_data[data_id].shape != (0,):
BS_data = stg.BS_raw_data BS_data = stg.BS_raw_data
logger.debug(f"BS_data: {BS_data[data_id].shape}")
val_min = np.nanmin( val_min = np.nanmin(
BS_data[data_id][f, :, :] BS_data[data_id][f, :, :]
) )
@ -1539,19 +1520,9 @@ class SignalProcessingTab(QWidget):
) )
) )
if stg.time_cross_section[data_id].shape != (0,):
if stg.depth_cross_section[data_id].shape != (0,): if stg.depth_cross_section[data_id].shape != (0,):
x_time = stg.time_cross_section[data_id]
y_depth = stg.depth_cross_section[data_id] y_depth = stg.depth_cross_section[data_id]
elif stg.depth[data_id].shape != (0,): elif stg.depth[data_id].shape != (0,):
x_time = stg.time_cross_section[data_id]
y_depth = stg.depth[data_id]
else:
if stg.depth_cross_section[data_id].shape != (0,):
x_time = stg.time[data_id]
y_depth = stg.depth_cross_section[data_id]
elif stg.depth[data_id].shape != (0,):
x_time = stg.time[data_id]
y_depth = stg.depth[data_id] y_depth = stg.depth[data_id]
BS = [ BS = [
@ -1572,11 +1543,6 @@ class SignalProcessingTab(QWidget):
stg.BS_raw_data_pre_process_average, stg.BS_raw_data_pre_process_average,
] ]
time_shape, = x_time[data_id].shape
depth_shape, = y_depth[data_id].shape
logger.debug(f"time_shape: {time_shape}")
logger.debug(f"depth_shape: {depth_shape}")
BS_data = stg.BS_raw_data BS_data = stg.BS_raw_data
BS_data_ppa = stg.BS_raw_data_pre_process_average BS_data_ppa = stg.BS_raw_data_pre_process_average
for i in range(len(BS)): for i in range(len(BS)):
@ -1585,8 +1551,7 @@ class SignalProcessingTab(QWidget):
if bs[data_id].shape == (0,): if bs[data_id].shape == (0,):
continue continue
x, y, z = bs[data_id].shape if self._is_correct_shape(bs):
if y == depth_shape and z == time_shape:
BS_data = bs BS_data = bs
BS_data_ppa = BS_ppa[i] BS_data_ppa = BS_ppa[i]
break break

View File

@ -27,5 +27,10 @@ class UserManualTab(QWidget):
# self.label_picture_theory.resize(np.int(pic.width()/100), np.int(pic.height()/100)) # self.label_picture_theory.resize(np.int(pic.width()/100), np.int(pic.height()/100))
# self.verticalLayout_main.addWidget(self.label_picture_theory) # self.verticalLayout_main.addWidget(self.label_picture_theory)
def full_update(self):
logger.debug(f"{__name__}: Update")
self.blockSignals(True)
# TODO: Update all widgets
self.blockSignals(False)

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

24
main.py
View File

@ -95,6 +95,15 @@ class MainApplication(QMainWindow):
# self.user_manual_tab = UserManualTab(self.ui_mainwindow.tab7) # self.user_manual_tab = UserManualTab(self.ui_mainwindow.tab7)
self.tabs = [
self.acoustic_data_tab,
self.signal_processing_tab,
self.sample_data_tab,
self.sediment_calibration_tab,
self.acoustic_inversion_tab,
self.note_tab
]
# ************************************************** # **************************************************
# ---------------- Text File Error ----------------- # ---------------- Text File Error -----------------
@ -108,14 +117,17 @@ class MainApplication(QMainWindow):
# traceback.TracebackException.from_exception(e).print(file=sortie) # traceback.TracebackException.from_exception(e).print(file=sortie)
def open_study_update_tabs(self): def open_study_update_tabs(self):
self.acoustic_data_tab.combobox_ABS_system_choice.setCurrentText(stg.ABS_name[0]) for tab in self.tabs:
self.acoustic_data_tab.fileListWidget.addFilenames(stg.filename_BS_raw_data) tab.full_update()
self.signal_processing_tab.combobox_acoustic_data_choice.addItems(stg.filename_BS_raw_data) # self.acoustic_data_tab.combobox_ABS_system_choice.setCurrentText(stg.ABS_name[0])
# self.acoustic_data_tab.fileListWidget.addFilenames(stg.filename_BS_raw_data)
self.sample_data_tab.fill_comboboxes_and_plot_transect() # self.signal_processing_tab.combobox_acoustic_data_choice.addItems(stg.filename_BS_raw_data)
self.sample_data_tab.lineEdit_fine_sediment.setText(stg.filename_fine)
self.sample_data_tab.lineEdit_fine_sediment.setToolTip(stg.path_fine) # self.sample_data_tab.fill_comboboxes_and_plot_transect()
# self.sample_data_tab.lineEdit_fine_sediment.setText(stg.filename_fine)
# self.sample_data_tab.lineEdit_fine_sediment.setToolTip(stg.path_fine)
# self.sample_data_tab.fill_table_fine() # self.sample_data_tab.fill_table_fine()
if __name__ == '__main__': if __name__ == '__main__':

View File

@ -36,14 +36,14 @@
;;; We replace python-numba package by package variant without tests ;;; We replace python-numba package by package variant without tests
(define python-numba-no-check ;; (define python-numba-no-check
(package ;; (package
(inherit python-numba) ;; (inherit python-numba)
(arguments `(#:tests? #f)))) ;; (arguments `(#:tests? #f))))
(define rewrite-numba ;; (define rewrite-numba
(package-input-rewriting/spec `(("python-numba" . ;; (package-input-rewriting/spec `(("python-numba" .
,(const python-numba-no-check))))) ;; ,(const python-numba-no-check)))))
;;; New packages ;;; New packages
@ -204,9 +204,9 @@ user-defined extensions).")
(concatenate-manifests (concatenate-manifests
(list (packages->manifest (list python-pyqt-file-list-widget (list (packages->manifest (list python-pyqt-file-list-widget
python-qtrangeslider python-qtrangeslider
(rewrite-numba python-astropy))) python-astropy))
(specifications->manifest (specifications->manifest
(list "python" "python-dateutil" (list "python" "python-dateutil" "python-numba"
"python-scipy" "python-scikit-learn" "python-scipy" "python-scikit-learn"
"python-pyqt@5" "python-pyqt5-sip" "python-pyqt@5" "python-pyqt5-sip"
"python-numpy@1" "python-pandas@1.5" "python-numpy@1" "python-pandas@1.5"