Compare commits
No commits in common. "60b367b7ef0ebce0ff6bac3c5d170b1dbcf1e618" and "fbc46f334463ec78b7befe20c2d613938a0190d8" have entirely different histories.
60b367b7ef
...
fbc46f3344
|
|
@ -1,9 +1,6 @@
|
||||||
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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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("acoused")
|
logger = logging.getLogger()
|
||||||
|
|
||||||
class CreateTableForSaveAs:
|
class CreateTableForSaveAs:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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("acoused")
|
logger = logging.getLogger()
|
||||||
|
|
||||||
class ReadTableForOpen:
|
class ReadTableForOpen:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ locale.setlocale(locale.LC_ALL, '')
|
||||||
|
|
||||||
_translate = QCoreApplication.translate
|
_translate = QCoreApplication.translate
|
||||||
|
|
||||||
logger = logging.getLogger("acoused")
|
logger = logging.getLogger()
|
||||||
|
|
||||||
class AcousticDataTab(QWidget):
|
class AcousticDataTab(QWidget):
|
||||||
COMPTEUR = 1
|
COMPTEUR = 1
|
||||||
|
|
@ -294,8 +294,6 @@ 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)
|
||||||
|
|
||||||
|
|
@ -447,61 +445,34 @@ 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.gridLayout_groupbox_display_option_limits.addWidget(self.label_distance_from_bank, 3, 0, 1, 1, Qt.AlignRight)
|
||||||
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.gridLayout_groupbox_display_option_limits.addWidget(self.label_distance_from_bank_min, 3, 1, 1, 1, Qt.AlignCenter)
|
||||||
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.gridLayout_groupbox_display_option_limits.addWidget(self.lineEdit_distance_from_bank_min_limits, 3, 2, 1, 1,
|
||||||
self.lineEdit_distance_from_bank_min_limits,
|
Qt.AlignCenter)
|
||||||
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.gridLayout_groupbox_display_option_limits.addWidget(self.lineEdit_distance_from_bank_max_limits, 3, 3, 1, 1,
|
||||||
self.lineEdit_distance_from_bank_max_limits,
|
Qt.AlignCenter)
|
||||||
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.gridLayout_groupbox_display_option_limits.addWidget(self.label_distance_from_bank_max, 3, 4, 1, 1, Qt.AlignCenter)
|
||||||
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.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,
|
|
||||||
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.gridLayout_groupbox_display_option_limits.addWidget(self.pushbutton_apply_distance_from_bank_limits, 3, 6, 1, 1)
|
||||||
self.pushbutton_apply_distance_from_bank_limits,
|
|
||||||
3, 6, 1, 1
|
|
||||||
)
|
|
||||||
self.pushbutton_apply_distance_from_bank_limits.setEnabled(False)
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
|
|
||||||
|
|
@ -776,7 +747,6 @@ 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()
|
||||||
|
|
@ -790,8 +760,6 @@ 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:])
|
||||||
|
|
@ -1391,6 +1359,7 @@ 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:
|
||||||
|
|
@ -1403,69 +1372,144 @@ 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 ---
|
||||||
|
current_row = self.fileListWidget.currentRow()
|
||||||
|
if current_row >= 0:
|
||||||
|
current_item = self.fileListWidget.takeItem(current_row)
|
||||||
|
del current_item
|
||||||
|
|
||||||
# --- Clear files included in list Widget ---
|
# --- Clear variables ---
|
||||||
current_row = self.fileListWidget.currentRow()
|
list_to_pop1 = [
|
||||||
if current_row >= 0:
|
"stg.acoustic_data", "stg.date", "stg.hour",
|
||||||
current_item = self.fileListWidget.takeItem(current_row)
|
"stg.freq", "stg.freq_text",
|
||||||
del current_item
|
"stg.nb_profiles", "stg.nb_profiles_per_sec",
|
||||||
|
"stg.nb_cells", "stg.cell_size",
|
||||||
# --- Clear variables ---
|
"stg.pulse_length", "stg.nb_pings_per_sec",
|
||||||
list_to_pop1 = [
|
"stg.nb_pings_averaged_per_profile",
|
||||||
stg.acoustic_data, stg.date, stg.hour,
|
"stg.kt_read", "stg.kt_corrected", "stg.gain_rx", "stg.gain_tx",
|
||||||
stg.freq, stg.freq_text,
|
"stg.filename_BS_raw_data", "stg.path_BS_raw_data",
|
||||||
stg.nb_profiles, stg.nb_profiles_per_sec,
|
"stg.BS_raw_data", "stg.time", "stg.depth",
|
||||||
stg.nb_cells, stg.cell_size,
|
"stg.BS_raw_data_reshape", "stg.time_reshape", "stg.depth_reshape"
|
||||||
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
|
|
||||||
]
|
|
||||||
|
|
||||||
for p in list_to_pop1:
|
|
||||||
if isinstance(p, list):
|
|
||||||
p.pop(current_row)
|
|
||||||
|
|
||||||
if stg.BS_cross_section:
|
|
||||||
list_to_pop2 = [
|
|
||||||
stg.rmin, stg.rmax, stg.tmin, stg.tmax,
|
|
||||||
stg.time_cross_section, stg.depth_cross_section,
|
|
||||||
stg.BS_cross_section
|
|
||||||
]
|
]
|
||||||
|
|
||||||
for k in list_to_pop2:
|
for p in list_to_pop1:
|
||||||
k.pop(current_row)
|
if isinstance(eval(p), list):
|
||||||
|
exec(p + ".pop(current_row)")
|
||||||
|
|
||||||
if stg.BS_stream_bed:
|
if stg.BS_cross_section:
|
||||||
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:
|
list_to_pop2 = ["stg.rmin", "stg.rmax", "stg.tmin", "stg.tmax",
|
||||||
s.pop(current_row)
|
"stg.time_cross_section", "stg.depth_cross_section", "stg.BS_cross_section"]
|
||||||
|
|
||||||
if self.fileListWidget.count() == 0:
|
for k in list_to_pop2:
|
||||||
self.clear_files_from_ListWidget_reset()
|
exec(k + ".pop(current_row)")
|
||||||
|
|
||||||
self.fileListWidget.blockSignals(False)
|
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):
|
def clear_files_from_ListWidget(self):
|
||||||
self.fileListWidget.blockSignals(True)
|
|
||||||
|
|
||||||
self.clear_files_data()
|
list_to_clear = [
|
||||||
self.clear_files_from_ListWidget_reset()
|
"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"
|
||||||
|
]
|
||||||
|
|
||||||
self.fileListWidget.blockSignals(False)
|
for k in list_to_clear:
|
||||||
|
if isinstance(eval(k), list):
|
||||||
|
exec(k + ".clear()")
|
||||||
|
|
||||||
def clear_files_from_ListWidget_reset(self):
|
|
||||||
self.fileListWidget.clear()
|
self.fileListWidget.clear()
|
||||||
# self.fileListWidget.takeItem(0)
|
# self.fileListWidget.takeItem(0)
|
||||||
|
|
||||||
|
|
@ -1542,27 +1586,6 @@ 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,
|
||||||
|
|
@ -1949,7 +1972,7 @@ class AcousticDataTab(QWidget):
|
||||||
14, 1, 1, 1, Qt.AlignLeft
|
14, 1, 1, 1, Qt.AlignLeft
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.checkbox_kt.isChecked() and len(stg.kt_corrected) > freq_id:
|
if self.checkbox_kt.isChecked():
|
||||||
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])
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ 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
|
||||||
|
|
@ -326,21 +325,23 @@ 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(
|
|
||||||
caption="Select Directory - Acoustic BS raw data Table"
|
# --- Open file dialog to select the directory ---
|
||||||
)
|
|
||||||
|
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
|
# --- Save the raw acoustic backscatter data from a Dataframe to csv file ---
|
||||||
# --- Dataframe to csv file ---
|
|
||||||
|
|
||||||
t0 = time.time()
|
t0 = time.time()
|
||||||
print("len(stg.BS_raw_data_reshape) ",
|
print("len(stg.BS_raw_data_reshape) ", 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([[]])
|
||||||
|
|
@ -350,42 +351,27 @@ 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(
|
table_data = np.vstack((np.vstack((stg.time_reshape[i][:, freq_ind],
|
||||||
(
|
stg.depth_reshape[i][:, freq_ind])),
|
||||||
np.vstack(
|
stg.BS_raw_data_reshape[i][:, freq_ind]))
|
||||||
(stg.time_reshape[i][:, freq_ind],
|
|
||||||
stg.depth_reshape[i][:, freq_ind])),
|
|
||||||
stg.BS_raw_data_reshape[i][:, freq_ind]
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
table_data = np.vstack(
|
table_data = np.vstack((table_data,
|
||||||
(
|
np.vstack((np.vstack(
|
||||||
table_data,
|
(stg.time_reshape[i][:, freq_ind],
|
||||||
np.vstack((
|
stg.depth_reshape[i][:, freq_ind])),
|
||||||
np.vstack((
|
stg.BS_raw_data_reshape[i][:, freq_ind]))
|
||||||
stg.time_reshape[i][:, freq_ind],
|
))
|
||||||
stg.depth_reshape[i][:, freq_ind]
|
|
||||||
)),
|
|
||||||
stg.BS_raw_data_reshape[i][:, freq_ind]
|
|
||||||
))
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
DataFrame_acoustic = pd.DataFrame(None)
|
exec("DataFrame_acoustic_" + str(i) + "= pd.DataFrame(None)")
|
||||||
DataFrame_acoustic = pd.DataFrame(
|
exec("DataFrame_acoustic_" + str(i) + "= pd.DataFrame(data=table_data.transpose(), columns=header_list)")
|
||||||
data=table_data.transpose(), columns=header_list
|
|
||||||
)
|
|
||||||
|
|
||||||
DataFrame_acoustic.to_csv(
|
exec("DataFrame_acoustic_" + str(i) + ".to_csv(" +
|
||||||
path_or_buf=os.path.join(
|
"path_or_buf=" +
|
||||||
name,
|
"'" + name + "/" + "Table_" +
|
||||||
f"Table_{str(stg.filename_BS_raw_data[i][:-4])}.csv"
|
str(stg.filename_BS_raw_data[i][:-4]) + ".csv'" + ", " +
|
||||||
),
|
"sep=" + "',' " + ", " +
|
||||||
header=DataFrame_acoustic.columns,
|
"header=DataFrame_acoustic_" + str(i) + ".columns" + ")")
|
||||||
sep=',',
|
|
||||||
)
|
|
||||||
|
|
||||||
t1 = time.time() - t0
|
t1 = time.time() - t0
|
||||||
print("time duration export BS ", t1)
|
print("time duration export BS ", t1)
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ import settings as stg
|
||||||
|
|
||||||
_translate = QCoreApplication.translate
|
_translate = QCoreApplication.translate
|
||||||
|
|
||||||
logger = logging.getLogger("acoused")
|
logger = logging.getLogger()
|
||||||
|
|
||||||
class SampleDataTab(QWidget):
|
class SampleDataTab(QWidget):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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("acoused")
|
logger = logging.getLogger()
|
||||||
|
|
||||||
class SedimentCalibrationTab(QWidget):
|
class SedimentCalibrationTab(QWidget):
|
||||||
|
|
||||||
|
|
@ -1569,10 +1569,6 @@ 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()
|
||||||
|
|
||||||
|
|
@ -1663,8 +1659,8 @@ class SedimentCalibrationTab(QWidget):
|
||||||
.scaledToHeight(32, Qt.SmoothTransformation)
|
.scaledToHeight(32, Qt.SmoothTransformation)
|
||||||
)
|
)
|
||||||
msgBox.setText(
|
msgBox.setText(
|
||||||
"Please select and valid the find and sand"
|
"Please select and valid the sample data with"
|
||||||
+ "sample data with click on 'sample plot' button"
|
+ "click on 'sample plot' button"
|
||||||
)
|
)
|
||||||
msgBox.setStandardButtons(QMessageBox.Ok)
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||||
msgBox.exec()
|
msgBox.exec()
|
||||||
|
|
@ -2766,3 +2762,4 @@ 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
8
main.py
8
main.py
|
|
@ -28,13 +28,13 @@ PERCENT_SCREEN_SIZE = 0.85
|
||||||
_translate = QCoreApplication.translate
|
_translate = QCoreApplication.translate
|
||||||
|
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logging.INFO,
|
level=logging.DEBUG,
|
||||||
format=('[AcouSed][%(levelname)s] %(message)s')
|
format=('[AcouSed][%(levelname)s] %(message)s')
|
||||||
)
|
)
|
||||||
|
|
||||||
logger = logging.getLogger("acoused")
|
logger = logging.getLogger()
|
||||||
logger.setLevel(logging.DEBUG)
|
# logger.setLevel(logging.DEBUG)
|
||||||
#logger.setLevel(logging.INFO)
|
logger.setLevel(logging.INFO)
|
||||||
|
|
||||||
class MainApplication(QMainWindow):
|
class MainApplication(QMainWindow):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
|
|
||||||
@ECHO OFF
|
|
||||||
|
|
||||||
start cmd /c test3\Acoused.exe
|
|
||||||
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
|
|
||||||
@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
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
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
45
tools.py
|
|
@ -1,45 +0,0 @@
|
||||||
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
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
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
|
||||||
Loading…
Reference in New Issue