Compare commits

...

26 Commits

Author SHA1 Message Date
brahim 60b367b7ef correction fusion 2025-03-20 13:23:15 +01:00
brahim ac1ffcef58 windows comand to zip the file is added 2025-03-20 13:20:23 +01:00
Pierre-Antoine dea9042ed1 Merge branch 'dev-parouby' into dev 2025-03-20 11:56:28 +01:00
Pierre-Antoine b52acafd29 Sediment calibration: Add test on fine data selection for interpolate. 2025-03-20 11:55:26 +01:00
brahim e87bb9731d fusion repared 2025-03-20 11:06:08 +01:00
brahim d076054375 fusion finished 2025-03-20 11:01:14 +01:00
Pierre-Antoine 998e1e7f8f Signal processing: Fix #8 and clean debug display code. 2025-03-20 10:33:16 +01:00
brahim 1e9116bd0d File requirements.txt and folder vritual_env are deleted 2025-03-20 10:06:00 +01:00
Pierre-Antoine be7627d93f Signal processing: Refactoring with recompute and replot method. 2025-03-19 18:08:33 +01:00
brahim 1fffdc714e scripts to generate acoused release 2025-03-19 16:14:25 +01:00
Pierre-Antoine 225c40c6c1 Signal processing: Some minor refactoring. 2025-03-19 16:13:15 +01:00
Pierre-Antoine 8a39bba7b1 Signal processing: Some refactoring. 2025-03-19 15:31:06 +01:00
Pierre-Antoine ad865e2829 tools: Add new file. 2025-03-19 15:30:56 +01:00
Pierre-Antoine 99ff7c5fed Acoused: Use a specific logger. 2025-03-19 14:12:35 +01:00
Pierre-Antoine 64230540c7 Signal processing: Change plot font. 2025-03-19 13:44:53 +01:00
Pierre-Antoine 44bf348ee5 Signal processing: Block signals during tab update. 2025-03-19 13:43:37 +01:00
Pierre-Antoine c521738567 Acoutic data: Minor change. 2025-03-17 18:06:09 +01:00
Pierre-Antoine b5338366cf Merge branch 'dev-parouby' into dev 2025-03-17 17:34:25 +01:00
Pierre-Antoine 752697db86 gitignore: Add '.exe' files. 2025-03-17 17:26:50 +01:00
Pierre-Antoine b9669d9cbf Acoustic data: Refactorise 'remove_file_from_ListWidget' method. 2025-03-17 17:25:19 +01:00
Pierre-Antoine b9ca307c59 Acoustic data: Remove useless 'eval' or 'exec'. 2025-03-17 17:18:02 +01:00
Pierre-Antoine f0150443e3 Acoustic data: Clear 'clear_files_from_ListWidget' method. 2025-03-17 17:14:00 +01:00
Pierre-Antoine 4c024cbb42 Acoustic data: Disable unused distance from bank (#39). 2025-03-17 16:35:32 +01:00
Pierre-Antoine 496937bde2 Acoustic data: Disable unused groupbox gps. 2025-03-17 16:26:50 +01:00
Pierre-Antoine 11ced0a263 Mainwindow: Minor change. 2025-03-17 10:44:49 +01:00
Pierre-Antoine 5cf87a5e7b Mainwindow: Fix table export. 2025-03-17 10:41:38 +01:00
14 changed files with 738 additions and 754 deletions

3
.gitignore vendored
View File

@ -1,6 +1,9 @@
TAGS TAGS
Error_file.txt Error_file.txt
# Windows executable file
*.exe
# Created by https://www.toptal.com/developers/gitignore/api/python # Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python # Edit at https://www.toptal.com/developers/gitignore?templates=python

View File

@ -32,7 +32,7 @@ from PyQt5.QtWidgets import QFileDialog, QApplication, QMessageBox
import settings as stg import settings as stg
from settings import ABS_name from settings import ABS_name
logger = logging.getLogger() logger = logging.getLogger("acoused")
class CreateTableForSaveAs: class CreateTableForSaveAs:

View File

@ -34,7 +34,7 @@ from settings import BS_raw_data, acoustic_data
from View.acoustic_data_tab import AcousticDataTab from View.acoustic_data_tab import AcousticDataTab
logger = logging.getLogger() logger = logging.getLogger("acoused")
class ReadTableForOpen: class ReadTableForOpen:

View File

@ -64,7 +64,7 @@ locale.setlocale(locale.LC_ALL, '')
_translate = QCoreApplication.translate _translate = QCoreApplication.translate
logger = logging.getLogger() logger = logging.getLogger("acoused")
class AcousticDataTab(QWidget): class AcousticDataTab(QWidget):
COMPTEUR = 1 COMPTEUR = 1
@ -294,6 +294,8 @@ class AcousticDataTab(QWidget):
self.groupbox_gps = QGroupBox() self.groupbox_gps = QGroupBox()
self.groupbox_gps.setTitle("Convert recording time to distance from bank") self.groupbox_gps.setTitle("Convert recording time to distance from bank")
self.horizontal_gps_input_data = QHBoxLayout(self.groupbox_gps) self.horizontal_gps_input_data = QHBoxLayout(self.groupbox_gps)
self.groupbox_gps.setEnabled(False)
self.verticalLayout_groupbox_display_option.addWidget(self.groupbox_gps) self.verticalLayout_groupbox_display_option.addWidget(self.groupbox_gps)
@ -445,34 +447,61 @@ class AcousticDataTab(QWidget):
# --------------------------------- # ---------------------------------
self.label_distance_from_bank = QLabel("Distance from bank") self.label_distance_from_bank = QLabel("Distance from bank")
self.gridLayout_groupbox_display_option_limits.addWidget(self.label_distance_from_bank, 3, 0, 1, 1, Qt.AlignRight) self.gridLayout_groupbox_display_option_limits.addWidget(
self.label_distance_from_bank,
3, 0, 1, 1, Qt.AlignRight
)
self.label_distance_from_bank.setEnabled(False)
self.label_distance_from_bank_min = QLabel() self.label_distance_from_bank_min = QLabel()
self.label_distance_from_bank_min.setText("0.00") self.label_distance_from_bank_min.setText("0.00")
self.gridLayout_groupbox_display_option_limits.addWidget(self.label_distance_from_bank_min, 3, 1, 1, 1, Qt.AlignCenter) self.gridLayout_groupbox_display_option_limits.addWidget(
self.label_distance_from_bank_min,
3, 1, 1, 1, Qt.AlignCenter
)
self.label_distance_from_bank_min.setEnabled(False)
self.lineEdit_distance_from_bank_min_limits = QLineEdit() self.lineEdit_distance_from_bank_min_limits = QLineEdit()
self.lineEdit_distance_from_bank_min_limits.setText("0.00") self.lineEdit_distance_from_bank_min_limits.setText("0.00")
self.lineEdit_distance_from_bank_min_limits.setMaximumWidth(80) self.lineEdit_distance_from_bank_min_limits.setMaximumWidth(80)
self.gridLayout_groupbox_display_option_limits.addWidget(self.lineEdit_distance_from_bank_min_limits, 3, 2, 1, 1, self.gridLayout_groupbox_display_option_limits.addWidget(
Qt.AlignCenter) self.lineEdit_distance_from_bank_min_limits,
3, 2, 1, 1, Qt.AlignCenter
)
self.lineEdit_distance_from_bank_min_limits.setEnabled(False)
self.lineEdit_distance_from_bank_max_limits = QLineEdit() self.lineEdit_distance_from_bank_max_limits = QLineEdit()
self.lineEdit_distance_from_bank_max_limits.setText("0.00") self.lineEdit_distance_from_bank_max_limits.setText("0.00")
self.lineEdit_distance_from_bank_max_limits.setMaximumWidth(80) self.lineEdit_distance_from_bank_max_limits.setMaximumWidth(80)
self.gridLayout_groupbox_display_option_limits.addWidget(self.lineEdit_distance_from_bank_max_limits, 3, 3, 1, 1, self.gridLayout_groupbox_display_option_limits.addWidget(
Qt.AlignCenter) self.lineEdit_distance_from_bank_max_limits,
3, 3, 1, 1, Qt.AlignCenter
)
self.lineEdit_distance_from_bank_max_limits.setEnabled(False)
self.label_distance_from_bank_max = QLabel() self.label_distance_from_bank_max = QLabel()
self.label_distance_from_bank_max.setText("0.00") self.label_distance_from_bank_max.setText("0.00")
self.gridLayout_groupbox_display_option_limits.addWidget(self.label_distance_from_bank_max, 3, 4, 1, 1, Qt.AlignCenter) self.gridLayout_groupbox_display_option_limits.addWidget(
self.label_distance_from_bank_max,
3, 4, 1, 1, Qt.AlignCenter
)
self.label_distance_from_bank_max.setEnabled(False)
self.label_distance_from_bank_unit_meter = QLabel("meters") self.label_distance_from_bank_unit_meter = QLabel("meters")
self.gridLayout_groupbox_display_option_limits.addWidget(self.label_distance_from_bank_unit_meter, 3, 5, 1, 1, Qt.AlignCenter) self.gridLayout_groupbox_display_option_limits.addWidget(
self.label_distance_from_bank_unit_meter,
3, 5, 1, 1, Qt.AlignCenter
)
self.label_distance_from_bank_unit_meter.setEnabled(False)
self.pushbutton_apply_distance_from_bank_limits = QPushButton() self.pushbutton_apply_distance_from_bank_limits = QPushButton()
self.pushbutton_apply_distance_from_bank_limits.setIcon(self.icon_apply_limits) self.pushbutton_apply_distance_from_bank_limits.setIcon(self.icon_apply_limits)
self.gridLayout_groupbox_display_option_limits.addWidget(self.pushbutton_apply_distance_from_bank_limits, 3, 6, 1, 1) self.gridLayout_groupbox_display_option_limits.addWidget(
self.pushbutton_apply_distance_from_bank_limits,
3, 6, 1, 1
)
self.pushbutton_apply_distance_from_bank_limits.setEnabled(False)
# --------------------------------------- # ---------------------------------------
@ -747,6 +776,7 @@ class AcousticDataTab(QWidget):
self.groupbox_transect_2Dplot_raw_BS_data.setTitle(_translate("CONSTANT_STRING", cs.RAW_ACOUSTIC_DATA_2D_FIELD)) self.groupbox_transect_2Dplot_raw_BS_data.setTitle(_translate("CONSTANT_STRING", cs.RAW_ACOUSTIC_DATA_2D_FIELD))
def fileListWidget_event(self): def fileListWidget_event(self):
self.fileListWidget.blockSignals(True)
self.print_selected_file() self.print_selected_file()
self.fill_measurements_information_groupbox() self.fill_measurements_information_groupbox()
@ -760,6 +790,8 @@ class AcousticDataTab(QWidget):
self.update_plot_profile() self.update_plot_profile()
self.set_range_for_spinboxes_bathymetry() self.set_range_for_spinboxes_bathymetry()
self.fileListWidget.blockSignals(False)
def print_selected_file(self): def print_selected_file(self):
print(f"Selected file in list widget : {self.fileListWidget.selectedItems()}") print(f"Selected file in list widget : {self.fileListWidget.selectedItems()}")
print("self.fileListWidget.selectedItems()[1:] : ", self.fileListWidget.selectedItems()[1:]) print("self.fileListWidget.selectedItems()[1:] : ", self.fileListWidget.selectedItems()[1:])
@ -1359,7 +1391,6 @@ class AcousticDataTab(QWidget):
self.fileListWidget.blockSignals(False) self.fileListWidget.blockSignals(False)
def rename_file_in_ListWidget(self, event): def rename_file_in_ListWidget(self, event):
if event == QEvent.MouseButtonPress: if event == QEvent.MouseButtonPress:
print("c'est bon") print("c'est bon")
if event.button == Qt.RightButton: if event.button == Qt.RightButton:
@ -1372,7 +1403,10 @@ class AcousticDataTab(QWidget):
menu.addAction('Rename') menu.addAction('Rename')
def remove_file_from_ListWidget(self): def remove_file_from_ListWidget(self):
if self.fileListWidget.count() > 0: if self.fileListWidget.count() <= 0:
return
self.fileListWidget.blockSignals(True)
# --- Clear files included in list Widget --- # --- Clear files included in list Widget ---
current_row = self.fileListWidget.currentRow() current_row = self.fileListWidget.currentRow()
@ -1382,134 +1416,56 @@ class AcousticDataTab(QWidget):
# --- Clear variables --- # --- Clear variables ---
list_to_pop1 = [ list_to_pop1 = [
"stg.acoustic_data", "stg.date", "stg.hour", stg.acoustic_data, stg.date, stg.hour,
"stg.freq", "stg.freq_text", stg.freq, stg.freq_text,
"stg.nb_profiles", "stg.nb_profiles_per_sec", stg.nb_profiles, stg.nb_profiles_per_sec,
"stg.nb_cells", "stg.cell_size", stg.nb_cells, stg.cell_size,
"stg.pulse_length", "stg.nb_pings_per_sec", stg.pulse_length, stg.nb_pings_per_sec,
"stg.nb_pings_averaged_per_profile", stg.nb_pings_averaged_per_profile,
"stg.kt_read", "stg.kt_corrected", "stg.gain_rx", "stg.gain_tx", stg.kt_read, stg.kt_corrected, stg.gain_rx, stg.gain_tx,
"stg.filename_BS_raw_data", "stg.path_BS_raw_data", stg.filename_BS_raw_data, stg.path_BS_raw_data,
"stg.BS_raw_data", "stg.time", "stg.depth", stg.BS_raw_data, stg.time, stg.depth,
"stg.BS_raw_data_reshape", "stg.time_reshape", "stg.depth_reshape" stg.BS_raw_data_reshape, stg.time_reshape, stg.depth_reshape
] ]
for p in list_to_pop1: for p in list_to_pop1:
if isinstance(eval(p), list): if isinstance(p, list):
exec(p + ".pop(current_row)") p.pop(current_row)
if stg.BS_cross_section: if stg.BS_cross_section:
list_to_pop2 = [
list_to_pop2 = ["stg.rmin", "stg.rmax", "stg.tmin", "stg.tmax", stg.rmin, stg.rmax, stg.tmin, stg.tmax,
"stg.time_cross_section", "stg.depth_cross_section", "stg.BS_cross_section"] stg.time_cross_section, stg.depth_cross_section,
stg.BS_cross_section
for k in list_to_pop2:
exec(k + ".pop(current_row)")
if stg.BS_stream_bed:
list_to_pop3 = ["stg.BS_stream_bed", "stg.depth_bottom",
"stg.val_bottom", "stg.ind_bottom", "stg.freq_bottom_detection"]
for s in list_to_pop3:
exec(s + ".pop(current_row)")
if self.fileListWidget.count() == 0:
# --- Clear measurements information ---
self.label_date_acoustic_file.clear()
self.label_date_acoustic_file.setText("Date: ")
self.label_hour_acoustic_file.clear()
self.label_hour_acoustic_file.setText("Hour: ")
self.lineEdit_sound_attenuation.setText("0.00")
self.combobox_frequency_information.clear()
self.label_profiles_value.clear()
self.label_profiles_per_sec_value.clear()
self.label_cells_value.clear()
self.label_cell_size_value.clear()
self.label_pulse_length_value.clear()
self.label_pings_per_sec_value.clear()
self.label_pings_per_profile_value.clear()
self.lineEdit_kt.setText("0.00")
self.lineEdit_rx.setText("0.00")
self.lineEdit_tx.setText("0.00")
# --- Clear display options ---
self.label_time_min.setText("0.00")
self.lineEdit_time_min_limits.setText("0.00")
self.lineEdit_time_max_limits.setText("0.00")
self.label_time_max.setText("0.00")
self.label_depth_min.setText("0.00")
self.lineEdit_depth_min_limits.setText("0.00")
self.lineEdit_depth_max_limits.setText("0.00")
self.label_depth_max.setText("0.00")
self.label_distance_from_bank_min.setText("0.00")
self.lineEdit_distance_from_bank_min_limits.setText("0.00")
self.lineEdit_distance_from_bank_max_limits.setText("0.00")
self.label_distance_from_bank_max.setText("0.00")
self.combobox_frequency_bathymetry.clear()
self.lineEdit_depth_min_bathy.setText("0.00")
self.lineEdit_depth_max_bathy.setText("0.00")
self.lineEdit_next_cell_bathy.setText("0.00")
# --- Clear table of values ---
self.tableView.reset()
data = pd.DataFrame(np.zeros((10, 10)))
self.tableModel = TableModel(data)
self.tableView.setModel(self.tableModel)
# --- Clear figure : 2D plot of the acoustic recording ---
self.verticalLayout_groupbox_transect_2Dplot_raw_BS_data.removeWidget(self.scroll_BS)
self.verticalLayout_groupbox_transect_2Dplot_raw_BS_data.removeWidget(self.toolbar_BS)
self.canvas_BS = FigureCanvas()
self.toolbar_BS = NavigationToolBar(self.canvas_BS, self)
self.scroll_BS.setWidget(self.canvas_BS)
self.verticalLayout_groupbox_transect_2Dplot_raw_BS_data.addWidget(self.toolbar_BS)
self.verticalLayout_groupbox_transect_2Dplot_raw_BS_data.addWidget(self.scroll_BS)
# --- Clear figure : profile ---
self.combobox_frequency_profile.clear()
self.verticalLayout_groupbox_plot_profile.removeWidget(self.canvas_plot_profile)
self.verticalLayout_groupbox_plot_profile.removeWidget(self.toolbar_profile)
self.canvas_plot_profile = FigureCanvas()
self.toolbar_profile = NavigationToolBar(self.canvas_plot_profile, self)
self.verticalLayout_groupbox_plot_profile.addWidget(self.toolbar_profile)
self.verticalLayout_groupbox_plot_profile.addWidget(self.canvas_plot_profile)
self.slider.setValue(0)
self.slider.setMaximum(10)
def clear_files_from_ListWidget(self):
list_to_clear = [
"stg.acoustic_data", "stg.date", "stg.hour",
"stg.freq", "stg.freq_text",
"stg.nb_profiles", "stg.nb_profiles_per_sec",
"stg.nb_cells", "stg.cell_size",
"stg.pulse_length", "stg.nb_pings_per_sec",
"stg.nb_pings_averaged_per_profile",
"stg.kt_read", "stg.kt_corrected", "stg.gain_rx", "stg.gain_tx",
"stg.filename_BS_raw_data", "stg.path_BS_raw_data",
"stg.BS_raw_data", "stg.time", "stg.depth",
"stg.BS_raw_data_reshape", "stg.time_reshape", "stg.depth_reshape",
"stg.rmin", "stg.rmax", "stg.tmin", "stg.tmax",
"stg.time_cross_section", "stg.depth_cross_section",
"stg.BS_cross_section", "stg.BS_stream_bed"
] ]
for k in list_to_clear: for k in list_to_pop2:
if isinstance(eval(k), list): k.pop(current_row)
exec(k + ".clear()")
if stg.BS_stream_bed:
list_to_pop3 = [
stg.BS_stream_bed, stg.depth_bottom,
stg.val_bottom, stg.ind_bottom,
stg.freq_bottom_detection
]
for s in list_to_pop3:
s.pop(current_row)
if self.fileListWidget.count() == 0:
self.clear_files_from_ListWidget_reset()
self.fileListWidget.blockSignals(False)
def clear_files_from_ListWidget(self):
self.fileListWidget.blockSignals(True)
self.clear_files_data()
self.clear_files_from_ListWidget_reset()
self.fileListWidget.blockSignals(False)
def clear_files_from_ListWidget_reset(self):
self.fileListWidget.clear() self.fileListWidget.clear()
# self.fileListWidget.takeItem(0) # self.fileListWidget.takeItem(0)
@ -1586,6 +1542,27 @@ class AcousticDataTab(QWidget):
self.slider.setValue(0) self.slider.setValue(0)
self.slider.setMaximum(10) self.slider.setMaximum(10)
def clear_files_data(self):
list_to_clear = [
stg.acoustic_data, stg.date, stg.hour,
stg.freq, stg.freq_text,
stg.nb_profiles, stg.nb_profiles_per_sec,
stg.nb_cells, stg.cell_size,
stg.pulse_length, stg.nb_pings_per_sec,
stg.nb_pings_averaged_per_profile,
stg.kt_read, stg.kt_corrected, stg.gain_rx, stg.gain_tx,
stg.filename_BS_raw_data, stg.path_BS_raw_data,
stg.BS_raw_data, stg.time, stg.depth,
stg.BS_raw_data_reshape, stg.time_reshape, stg.depth_reshape,
stg.rmin, stg.rmax, stg.tmin, stg.tmax,
stg.time_cross_section, stg.depth_cross_section,
stg.BS_cross_section, stg.BS_stream_bed
]
for k in list_to_clear:
if isinstance(k, list):
k.clear()
def load_BS_acoustic_raw_data(self): def load_BS_acoustic_raw_data(self):
if self.fileListWidget.count() == 0: if self.fileListWidget.count() == 0:
for p, f in zip(stg.path_BS_raw_data, for p, f in zip(stg.path_BS_raw_data,
@ -1972,7 +1949,7 @@ class AcousticDataTab(QWidget):
14, 1, 1, 1, Qt.AlignLeft 14, 1, 1, 1, Qt.AlignLeft
) )
if self.checkbox_kt.isChecked(): if self.checkbox_kt.isChecked() and len(stg.kt_corrected) > freq_id:
if self.combobox_frequency_information.count() > 0: if self.combobox_frequency_information.count() > 0:
self.lineEdit_kt.setText( self.lineEdit_kt.setText(
str("%.4f" % stg.kt_corrected[freq_id]) str("%.4f" % stg.kt_corrected[freq_id])

View File

@ -39,6 +39,7 @@ from View.about_window import AboutWindow
import settings as stg import settings as stg
import numpy as np import numpy as np
import pandas as pd
from subprocess import Popen from subprocess import Popen
import time import time
@ -325,23 +326,21 @@ class Ui_MainWindow(object):
self.open_doc_file('Tutorial_AQUAscat_software.pdf') self.open_doc_file('Tutorial_AQUAscat_software.pdf')
def export_table_of_acoustic_BS_values_to_excel_or_libreOfficeCalc_file(self): def export_table_of_acoustic_BS_values_to_excel_or_libreOfficeCalc_file(self):
if len(stg.BS_raw_data_reshape) != 0: if len(stg.BS_raw_data_reshape) != 0:
name = QtWidgets.QFileDialog.getExistingDirectory(
# --- Open file dialog to select the directory --- caption="Select Directory - Acoustic BS raw data Table"
)
name = QtWidgets.QFileDialog.getExistingDirectory(caption="Select Directory - Acoustic BS raw data Table")
print("name table to save ", name) print("name table to save ", name)
# --- Save the raw acoustic backscatter data from a Dataframe to csv file --- # --- Save the raw acoustic backscatter data from a
# --- Dataframe to csv file ---
t0 = time.time() t0 = time.time()
print("len(stg.BS_raw_data_reshape) ", len(stg.BS_raw_data_reshape)) print("len(stg.BS_raw_data_reshape) ",
len(stg.BS_raw_data_reshape))
if name: if name:
for i in range(len(stg.BS_raw_data_reshape)): for i in range(len(stg.BS_raw_data_reshape)):
header_list = [] header_list = []
header_list.clear() header_list.clear()
table_data = np.array([[]]) table_data = np.array([[]])
@ -351,27 +350,42 @@ class Ui_MainWindow(object):
header_list.append("BS - " + freq_value) header_list.append("BS - " + freq_value)
if freq_ind == 0: if freq_ind == 0:
table_data = np.vstack((np.vstack((stg.time_reshape[i][:, freq_ind], table_data = np.vstack(
stg.depth_reshape[i][:, freq_ind])), (
stg.BS_raw_data_reshape[i][:, freq_ind])) np.vstack(
else:
table_data = np.vstack((table_data,
np.vstack((np.vstack(
(stg.time_reshape[i][:, freq_ind], (stg.time_reshape[i][:, freq_ind],
stg.depth_reshape[i][:, freq_ind])), stg.depth_reshape[i][:, freq_ind])),
stg.BS_raw_data_reshape[i][:, freq_ind])) stg.BS_raw_data_reshape[i][:, freq_ind]
)
)
else:
table_data = np.vstack(
(
table_data,
np.vstack((
np.vstack((
stg.time_reshape[i][:, freq_ind],
stg.depth_reshape[i][:, freq_ind]
)),
stg.BS_raw_data_reshape[i][:, freq_ind]
)) ))
)
)
exec("DataFrame_acoustic_" + str(i) + "= pd.DataFrame(None)") DataFrame_acoustic = pd.DataFrame(None)
exec("DataFrame_acoustic_" + str(i) + "= pd.DataFrame(data=table_data.transpose(), columns=header_list)") DataFrame_acoustic = pd.DataFrame(
data=table_data.transpose(), columns=header_list
)
exec("DataFrame_acoustic_" + str(i) + ".to_csv(" + DataFrame_acoustic.to_csv(
"path_or_buf=" + path_or_buf=os.path.join(
"'" + name + "/" + "Table_" + name,
str(stg.filename_BS_raw_data[i][:-4]) + ".csv'" + ", " + f"Table_{str(stg.filename_BS_raw_data[i][:-4])}.csv"
"sep=" + "',' " + ", " + ),
"header=DataFrame_acoustic_" + str(i) + ".columns" + ")") header=DataFrame_acoustic.columns,
sep=',',
)
t1 = time.time() - t0 t1 = time.time() - t0
print("time duration export BS ", t1) print("time duration export BS ", t1)

View File

@ -50,7 +50,7 @@ import settings as stg
_translate = QCoreApplication.translate _translate = QCoreApplication.translate
logger = logging.getLogger() logger = logging.getLogger("acoused")
class SampleDataTab(QWidget): class SampleDataTab(QWidget):

View File

@ -48,7 +48,7 @@ import settings as stg
from View.checkable_combobox import CheckableComboBox from View.checkable_combobox import CheckableComboBox
from Model.acoustic_inversion_method_high_concentration import AcousticInversionMethodHighConcentration from Model.acoustic_inversion_method_high_concentration import AcousticInversionMethodHighConcentration
logger = logging.getLogger() logger = logging.getLogger("acoused")
class SedimentCalibrationTab(QWidget): class SedimentCalibrationTab(QWidget):
@ -1569,6 +1569,10 @@ class SedimentCalibrationTab(QWidget):
self._data_validity_message_box() self._data_validity_message_box()
return return
if len(stg.fine_sample_profile) == 0:
self._data_validity_message_box()
return
data_choice = self.combobox_acoustic_data_choice\ data_choice = self.combobox_acoustic_data_choice\
.currentIndex() .currentIndex()
@ -1659,8 +1663,8 @@ class SedimentCalibrationTab(QWidget):
.scaledToHeight(32, Qt.SmoothTransformation) .scaledToHeight(32, Qt.SmoothTransformation)
) )
msgBox.setText( msgBox.setText(
"Please select and valid the sample data with" "Please select and valid the find and sand"
+ "click on 'sample plot' button" + "sample data with click on 'sample plot' button"
) )
msgBox.setStandardButtons(QMessageBox.Ok) msgBox.setStandardButtons(QMessageBox.Ok)
msgBox.exec() msgBox.exec()
@ -2762,4 +2766,3 @@ class SedimentCalibrationTab(QWidget):
self.lineEdit_slider_FCB.setText( self.lineEdit_slider_FCB.setText(
str(stg.time[self.combobox_acoustic_data_choice.currentIndex()][ str(stg.time[self.combobox_acoustic_data_choice.currentIndex()][
self.combobox_frequency_FCB.currentIndex(), self.slider_FCB.value()-1])) self.combobox_frequency_FCB.currentIndex(), self.slider_FCB.value()-1]))

File diff suppressed because it is too large Load Diff

View File

@ -28,13 +28,13 @@ PERCENT_SCREEN_SIZE = 0.85
_translate = QCoreApplication.translate _translate = QCoreApplication.translate
logging.basicConfig( logging.basicConfig(
level=logging.DEBUG, level=logging.INFO,
format=('[AcouSed][%(levelname)s] %(message)s') format=('[AcouSed][%(levelname)s] %(message)s')
) )
logger = logging.getLogger() logger = logging.getLogger("acoused")
# logger.setLevel(logging.DEBUG) logger.setLevel(logging.DEBUG)
logger.setLevel(logging.INFO) #logger.setLevel(logging.INFO)
class MainApplication(QMainWindow): class MainApplication(QMainWindow):

5
packages/debug.bat Normal file
View File

@ -0,0 +1,5 @@
@ECHO OFF
start cmd /c test3\Acoused.exe

35
packages/windows.bat Normal file
View File

@ -0,0 +1,35 @@
@ECHO OFF
rem Python environment (-U = update python packages / -r = texte file)
python -m pip install -U -r ..\virtualenv\requirements.txt
rem Build windows version
mkdir acoused_packaging
pyinstaller --name "acoused" ..\main.py -y
rem Icons
mkdir acoused_packaging\icons
copy /y ..\icons\*.png acoused_packaging\icons
rem Logos
mkdir acoused_packaging\logos
copy /y ..\logos\* acoused_packaging\logos
rem Doc
copy /y ..\ABS_calibration_constant_kt.xlsx acoused_packaging
copy /y ..\AcouSed_UserManual.pdf acoused_packaging
copy /y ..\Acoustic_Inversion_theory.pdf acoused_packaging
copy /y ..\Tutorial_AQUAscat_software.pdf acoused_packaging
rem move exe
move /y dist\AcouSed\acoused.exe acoused_packaging
move /y dist\acoused\_internal acoused_packaging
copy debug.bat acoused_packaging
rmdir /s /q build
rmdir /s /q dist
del /q AcouSed.spec
set PATH=%PATH%;C:\Program Files (x86)/7-Zip
7z a -tzip acoused_packaging.zip acoused_packaging

View File

@ -1,13 +0,0 @@
matplotlib==3.6.3
numpy==1.23.5
pandas==1.5.3
PyQt5==5.15.9
PyQt5-Qt5==5.15.2
PyQt5-sip==12.11.0
python-dateutil==2.8.2
scikit-learn==1.2.1
scipy==1.10.0
pyqt-file-list-widget==0.0.1
qtrangeslider==0.1.5
astropy==6.1.7
odfpy==1.4.1

45
tools.py Normal file
View File

@ -0,0 +1,45 @@
import os
import time
import logging
import traceback
from datetime import datetime, timedelta
from pathlib import Path
from functools import wraps
###########
# LOGGING #
###########
logger = logging.getLogger("acoused")
#########
# WRAPS #
#########
def trace(func):
@wraps(func)
def wrapper(*args, **kwargs):
t = time.time()
head = f"[TRACE]"
logger.debug(
f"{head} Call {func.__module__}." +
f"{func.__qualname__}({args}, {kwargs})"
)
value = func(*args, **kwargs)
t1 = time.time()
logger.debug(
f"{head} Return {func.__module__}." +
f"{func.__qualname__}: {value}"
)
logger.debug(
f"{head}[TIME] {func.__module__}." +
f"{func.__qualname__}: {t1-t} sec"
)
return value
return wrapper

View File

@ -1,33 +0,0 @@
contourpy==1.0.7
cycler==0.11.0
defusedxml==0.7.1
et-xmlfile==1.1.0
fonttools==4.38.0
importlib-resources==5.12.0
joblib==1.2.0
kiwisolver==1.4.4
llvmlite==0.39.1
matplotlib==3.6.3
numba==0.56.4
numpy==1.23.5
odfpy==1.4.1
openpyxl==3.0.10
packaging==23.0
pandas==1.5.3
Pillow==9.4.0
profilehooks==1.12.0
pyparsing==3.0.9
pyqt-checkbox-table-widget==0.0.14
PyQt5==5.15.9
PyQt5-Qt5==5.15.2
PyQt5-sip==12.11.0
python-dateutil==2.8.2
pytz==2022.7.1
scikit-learn==1.2.1
scipy==1.10.0
six==1.16.0
threadpoolctl==3.1.0
utm==0.7.0
xlrd==2.0.1
xmltodict==0.13.0
zipp==3.15.0