Compare commits
4 Commits
a6e81b3329
...
817be64558
| Author | SHA1 | Date |
|---|---|---|
|
|
817be64558 | |
|
|
1e8925fbb3 | |
|
|
fea4957f61 | |
|
|
bf8640fb30 |
|
|
@ -21,18 +21,17 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
from PyQt5.QtWidgets import (QWidget, QVBoxLayout, QDialog, QTabWidget, QGridLayout, QScrollArea,
|
from PyQt5.QtWidgets import (
|
||||||
QFileDialog, QMessageBox, QLabel)
|
QWidget, QVBoxLayout, QDialog, QTabWidget, QGridLayout,
|
||||||
|
QScrollArea, QFileDialog, QMessageBox, QLabel
|
||||||
|
)
|
||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtCore import Qt
|
||||||
|
|
||||||
class CalibrationConstantKt(QDialog):
|
class CalibrationConstantKt(QDialog):
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
|
|
||||||
super(CalibrationConstantKt, self).__init__(parent)
|
super(CalibrationConstantKt, self).__init__(parent)
|
||||||
|
|
||||||
self.setGeometry(400, 200, 300, 400)
|
self.setGeometry(400, 200, 300, 400)
|
||||||
|
|
||||||
self.setWindowTitle("Calibration constant kt")
|
self.setWindowTitle("Calibration constant kt")
|
||||||
|
|
||||||
self.verticalLayout_Main = QVBoxLayout()
|
self.verticalLayout_Main = QVBoxLayout()
|
||||||
|
|
@ -41,15 +40,18 @@ class CalibrationConstantKt(QDialog):
|
||||||
self.verticalLayout_Main.addWidget(self.tab)
|
self.verticalLayout_Main.addWidget(self.tab)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.data_ABS = pd.read_excel("ABS_calibration_constant_kt.xlsx", header=0, sheet_name=None)
|
self.data_ABS = pd.read_excel(
|
||||||
|
"ABS_calibration_constant_kt.xlsx",
|
||||||
|
header=0, sheet_name=None
|
||||||
|
)
|
||||||
except FileNotFoundError as e:
|
except FileNotFoundError as e:
|
||||||
|
|
||||||
msgBox = QMessageBox()
|
msgBox = QMessageBox()
|
||||||
msgBox.setWindowTitle("File Not Found Error")
|
msgBox.setWindowTitle("File Not Found Error")
|
||||||
msgBox.setIcon(QMessageBox.Warning)
|
msgBox.setIcon(QMessageBox.Warning)
|
||||||
msgBox.setText("Please check Excel file name for the calibration constant kt \n"
|
msgBox.setText(
|
||||||
"It should be an excel file named : 'ABS_calibration_constant_kt.xlsx'")
|
"Please check Excel file name for the calibration constant kt \n"
|
||||||
|
"It should be an excel file named : 'ABS_calibration_constant_kt.xlsx'"
|
||||||
|
)
|
||||||
msgBox.setStandardButtons(QMessageBox.Ok)
|
msgBox.setStandardButtons(QMessageBox.Ok)
|
||||||
msgBox.exec()
|
msgBox.exec()
|
||||||
|
|
||||||
|
|
@ -57,9 +59,11 @@ class CalibrationConstantKt(QDialog):
|
||||||
self.load_freq_and_kt_values()
|
self.load_freq_and_kt_values()
|
||||||
|
|
||||||
def open_dialog_box(self):
|
def open_dialog_box(self):
|
||||||
filename = QFileDialog.getOpenFileNames(self, "Calibration file", "", "Calibration file (*.xlsx)",
|
filename = QFileDialog.getOpenFileNames(
|
||||||
options=QFileDialog.DontUseNativeDialog)
|
self, "Calibration file", "", "Calibration file (*.xlsx)",
|
||||||
print(filename)
|
options=QFileDialog.DontUseNativeDialog
|
||||||
|
)
|
||||||
|
|
||||||
dir_name = os.path.dirname(filename[0][0])
|
dir_name = os.path.dirname(filename[0][0])
|
||||||
file_name = os.path.basename(filename[0][0])
|
file_name = os.path.basename(filename[0][0])
|
||||||
print(f"dir name : {dir_name} & file name : {file_name}")
|
print(f"dir name : {dir_name} & file name : {file_name}")
|
||||||
|
|
@ -71,43 +75,58 @@ class CalibrationConstantKt(QDialog):
|
||||||
self.load_freq_and_kt_values()
|
self.load_freq_and_kt_values()
|
||||||
|
|
||||||
def load_freq_and_kt_values(self):
|
def load_freq_and_kt_values(self):
|
||||||
|
|
||||||
for t in range(len(self.data_ABS.keys())):
|
for t in range(len(self.data_ABS.keys())):
|
||||||
self.tab.removeTab(t)
|
self.tab.removeTab(t)
|
||||||
|
|
||||||
for t_index, t_value in enumerate(list(self.data_ABS.keys())):
|
for t_index, t_value in enumerate(list(self.data_ABS.keys())):
|
||||||
|
tab_calib = QWidget()
|
||||||
|
self.tab.addTab(tab_calib, t_value)
|
||||||
|
|
||||||
exec("self.tab_calib_" + str(t_index) + "= QWidget()")
|
verticalLayout = QVBoxLayout(tab_calib)
|
||||||
eval("self.tab.addTab(self.tab_calib_" + str(t_index) + ", '" + str(t_value) + "')")
|
|
||||||
|
|
||||||
exec("self.verticalLayout_tab_" + str(t_index) + "= QVBoxLayout(self.tab_calib_" + str(t_index) + ")")
|
scrollarea = QScrollArea(tab_calib)
|
||||||
|
scrollarea.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
|
||||||
|
scrollarea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||||
|
scrollarea.setWidgetResizable(True)
|
||||||
|
|
||||||
exec("self.scrollarea_tab_" + str(t_index) + " = QScrollArea(self.tab_calib_" + str(t_index) + ")")
|
verticalLayout.addWidget(scrollarea)
|
||||||
eval("self.scrollarea_tab_" + str(t_index) + ".setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)")
|
gridLayout = QGridLayout(scrollarea)
|
||||||
eval("self.scrollarea_tab_" + str(t_index) + ".setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)")
|
|
||||||
eval("self.scrollarea_tab_" + str(t_index) + ".setWidgetResizable(True)")
|
|
||||||
|
|
||||||
eval("self.verticalLayout_tab_" + str(t_index) + ".addWidget(self.scrollarea_tab_" + str(t_index) + ")")
|
|
||||||
|
|
||||||
exec("self.gridLayout_tab_" + str(t_index) + " = QGridLayout(self.scrollarea_tab_" + str(t_index) + ")")
|
|
||||||
if [*self.data_ABS.values()][t_index].columns.any():
|
if [*self.data_ABS.values()][t_index].columns.any():
|
||||||
exec("self.label_freq_" + str(t_index) + " = QLabel('" + str([*self.data_ABS.values()][t_index].columns[0]) + " (MHz)')")
|
label_freq = QLabel(
|
||||||
exec("self.label_kt_" + str(t_index) + " = QLabel('" + str([*self.data_ABS.values()][t_index].columns[1]) + " (V.m<sup>1.5</sup>)')")
|
f"{[*self.data_ABS.values()][t_index].columns[0]} (MHz)"
|
||||||
|
)
|
||||||
|
label_kt = QLabel(
|
||||||
|
f"{[*self.data_ABS.values()][t_index].columns[1]} "
|
||||||
|
+ "(V.m<sup>1.5</sup>)"
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
exec("self.label_freq_" + str(t_index) + " = QLabel('Frequency (MHz)')")
|
label_freq = QLabel('Frequency (MHz)')
|
||||||
exec("self.label_kt_" + str(t_index) + " = QLabel('kt (V.m<sup>1.5</sup>)')")
|
label_kt = QLabel('kt (V.m<sup>1.5</sup>)')
|
||||||
eval("self.gridLayout_tab_" + str(t_index) + ".addWidget(self.label_freq_" + str(t_index) + ", 0, 0, 1, 1, Qt.AlignCenter)")
|
|
||||||
eval("self.gridLayout_tab_" + str(t_index) + ".addWidget(self.label_kt_" + str(t_index) + ", 0, 1, 1, 1, Qt.AlignCenter)")
|
gridLayout.addWidget(
|
||||||
|
label_freq, 0, 0, 1, 1, Qt.AlignCenter
|
||||||
|
)
|
||||||
|
gridLayout.addWidget(
|
||||||
|
label_kt, 0, 1, 1, 1, Qt.AlignCenter
|
||||||
|
)
|
||||||
|
|
||||||
for x in range(self.data_ABS[t_value].shape[0]):
|
for x in range(self.data_ABS[t_value].shape[0]):
|
||||||
exec("self.label_freq_" + str(x) + "_ABS_" + str(t_index) + " = QLabel()")
|
label_freq_ABS = QLabel()
|
||||||
# print(eval("self.label_freq_" + str(x) + "_ABS_" + str(t_index) + ".setText('" + str(self.data_ABS[t_value].iloc[x][0]*1e-6) + " MHz')"))
|
|
||||||
eval("self.label_freq_" + str(x) + "_ABS_" + str(t_index) + ".setText('" + str(self.data_ABS[t_value].iloc[x][0]*1e-6) + " (MHz)')")
|
label_freq_ABS.setText(
|
||||||
# eval("self.label_freq_" + str(x) + "_ABS_" + str(t_index) + ".setDisabled(True)")
|
f"{self.data_ABS[t_value].iloc[x][0]*1e-6}" + "(MHz)"
|
||||||
eval("self.gridLayout_tab_" + str(t_index) + ".addWidget(self.label_freq_" + str(x) + "_ABS_" + str(t_index) +
|
)
|
||||||
", " + str(x + 1) + ", 0, 1, 1,Qt.AlignCenter)")
|
gridLayout.addWidget(
|
||||||
exec("self.label_kt_" + str(x) + "_ABS_" + str(t_index) + " = QLabel()")
|
label_freq_ABS, x + 1, 0, 1, 1,Qt.AlignCenter
|
||||||
exec("self.label_kt_" + str(x) + "_ABS_" + str(t_index) + ".setText('" + str(self.data_ABS[t_value].iloc[x][1]) + "V.m<sup>1.5</sup>')")
|
)
|
||||||
eval("self.label_kt_" + str(x) + "_ABS_" + str(t_index) + ".setStyleSheet('border: 1px solid black;')")
|
|
||||||
eval("self.gridLayout_tab_" + str(t_index) + ".addWidget(self.label_kt_" + str(x) + "_ABS_" + str(t_index) +
|
label_kt_ABS = QLabel()
|
||||||
", " + str(x+1) + ", 1, 1, 1, Qt.AlignCenter)")
|
|
||||||
|
label_kt_ABS.setText(
|
||||||
|
f"{self.data_ABS[t_value].iloc[x][1]} V.m<sup>1.5</sup>"
|
||||||
|
)
|
||||||
|
label_kt_ABS.setStyleSheet('border: 1px solid black;')
|
||||||
|
gridLayout.addWidget(
|
||||||
|
label_kt_ABS, x + 1 , 1, 1, 1, Qt.AlignCenter
|
||||||
|
)
|
||||||
|
|
|
||||||
|
|
@ -27,20 +27,24 @@ import os
|
||||||
|
|
||||||
|
|
||||||
class Logos():
|
class Logos():
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.logo_AcouSed = os.path.join('logos', "AcouSed.png")
|
def path_logo(icon):
|
||||||
|
return os.path.join(
|
||||||
|
os.path.dirname(__file__), "..", "logos", icon
|
||||||
|
)
|
||||||
|
|
||||||
self.logo_INRAE = os.path.join('logos', "BlocMarque-INRAE-Inter.jpg")
|
self.logo_AcouSed = path_logo("AcouSed.png")
|
||||||
|
|
||||||
self.logo_OSR = os.path.join('logos', "OSR.png")
|
self.logo_INRAE = path_logo("BlocMarque-INRAE-Inter.jpg")
|
||||||
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_OSR = path_logo("OSR.png")
|
||||||
self.logo_EDF = os.path.join('logos', "EDF.png")
|
self.logo_europe = path_logo("Europe.png")
|
||||||
self.logo_Ubertone = os.path.join('logos', "Ubertone.jpg")
|
self.logo_saone_rhone = path_logo("plan_Rhone_Saone.png")
|
||||||
|
self.logo_carnot = path_logo("Carnot_EE.png")
|
||||||
|
|
||||||
|
self.logo_CNR = path_logo("CNR.png")
|
||||||
|
self.logo_EDF = path_logo("EDF.png")
|
||||||
|
self.logo_Ubertone = path_logo("Ubertone.jpg")
|
||||||
|
|
||||||
logos_inst = Logos()
|
logos_inst = Logos()
|
||||||
|
|
||||||
|
|
@ -291,7 +295,7 @@ class Authors(QDialog):
|
||||||
self.gridLayout.addWidget(self.label_brahim, 4, 0, 1, 1)
|
self.gridLayout.addWidget(self.label_brahim, 4, 0, 1, 1)
|
||||||
|
|
||||||
self.label_PA = QLabel()
|
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.label_PA.setText("TECC company (< a href = https://parouby.fr/ > https://parouby.fr/ </a>) was involved in 2025 to debugging the program.")
|
||||||
self.gridLayout.addWidget(self.label_PA, 5, 0, 1, 1)
|
self.gridLayout.addWidget(self.label_PA, 5, 0, 1, 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -718,7 +718,7 @@ class AcousticDataTab(QWidget):
|
||||||
def _setup_icons(self):
|
def _setup_icons(self):
|
||||||
def path_icon(icon):
|
def path_icon(icon):
|
||||||
return os.path.join(
|
return os.path.join(
|
||||||
"icons", icon
|
os.path.dirname(__file__), "..", "icons", icon
|
||||||
)
|
)
|
||||||
|
|
||||||
self.icon_folder = QIcon(path_icon("folder.png"))
|
self.icon_folder = QIcon(path_icon("folder.png"))
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,9 @@ class AcousticInversionTab(QWidget):
|
||||||
self._setup_connections()
|
self._setup_connections()
|
||||||
|
|
||||||
def _path_icon(self, icon):
|
def _path_icon(self, icon):
|
||||||
return os.path.join("icons", icon)
|
return os.path.join(
|
||||||
|
os.path.dirname(__file__), "..", "icons", icon
|
||||||
|
)
|
||||||
|
|
||||||
def _setup_icons(self):
|
def _setup_icons(self):
|
||||||
self.icon_folder = QIcon(self._path_icon("folder.png"))
|
self.icon_folder = QIcon(self._path_icon("folder.png"))
|
||||||
|
|
|
||||||
|
|
@ -132,28 +132,33 @@ class Ui_MainWindow(object):
|
||||||
self.toolBar.setObjectName("toolBar")
|
self.toolBar.setObjectName("toolBar")
|
||||||
self.mainwindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
|
self.mainwindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
|
||||||
|
|
||||||
|
def path_icon(icon):
|
||||||
|
return os.path.join(
|
||||||
|
os.path.dirname(__file__), "..", "icons", icon
|
||||||
|
)
|
||||||
|
|
||||||
self.actionOpen = QtWidgets.QAction(self.mainwindow)
|
self.actionOpen = QtWidgets.QAction(self.mainwindow)
|
||||||
icon1 = QtGui.QIcon()
|
icon1 = QtGui.QIcon()
|
||||||
icon1.addPixmap(QtGui.QPixmap("icons/icon_folder.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
icon1.addPixmap(QtGui.QPixmap(path_icon("icon_folder.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
self.actionOpen.setIcon(icon1)
|
self.actionOpen.setIcon(icon1)
|
||||||
self.actionOpen.setObjectName("actionOpen")
|
self.actionOpen.setObjectName("actionOpen")
|
||||||
|
|
||||||
self.actionSave = QtWidgets.QAction(self.mainwindow)
|
self.actionSave = QtWidgets.QAction(self.mainwindow)
|
||||||
icon2 = QtGui.QIcon()
|
icon2 = QtGui.QIcon()
|
||||||
icon2.addPixmap(QtGui.QPixmap("icons/save.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
icon2.addPixmap(QtGui.QPixmap(path_icon("save.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
self.actionSave.setIcon(icon2)
|
self.actionSave.setIcon(icon2)
|
||||||
self.actionSave.setObjectName("actionSave")
|
self.actionSave.setObjectName("actionSave")
|
||||||
|
|
||||||
self.actionEnglish = QtWidgets.QAction(self.mainwindow)
|
self.actionEnglish = QtWidgets.QAction(self.mainwindow)
|
||||||
icon6 = QtGui.QIcon()
|
icon6 = QtGui.QIcon()
|
||||||
icon6.addPixmap(QtGui.QPixmap("icons/en.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
icon6.addPixmap(QtGui.QPixmap(path_icon("en.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
self.actionEnglish.setIcon(icon6)
|
self.actionEnglish.setIcon(icon6)
|
||||||
self.actionEnglish.setObjectName("actionEnglish")
|
self.actionEnglish.setObjectName("actionEnglish")
|
||||||
self.actionEnglish.setEnabled(False)
|
self.actionEnglish.setEnabled(False)
|
||||||
|
|
||||||
self.actionFrench = QtWidgets.QAction(self.mainwindow)
|
self.actionFrench = QtWidgets.QAction(self.mainwindow)
|
||||||
icon7 = QtGui.QIcon()
|
icon7 = QtGui.QIcon()
|
||||||
icon7.addPixmap(QtGui.QPixmap("icons/fr.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
icon7.addPixmap(QtGui.QPixmap(path_icon("fr.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
self.actionFrench.setIcon(icon7)
|
self.actionFrench.setIcon(icon7)
|
||||||
self.actionFrench.setObjectName("actionFrench")
|
self.actionFrench.setObjectName("actionFrench")
|
||||||
self.actionFrench.setEnabled(False)
|
self.actionFrench.setEnabled(False)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
|
|
||||||
from PyQt5.QtGui import QIcon, QPixmap
|
from PyQt5.QtGui import QIcon, QPixmap
|
||||||
from PyQt5.QtWidgets import (QWidget, QLabel, QHBoxLayout, QVBoxLayout, QApplication, QMainWindow, QGridLayout,
|
from PyQt5.QtWidgets import (
|
||||||
QDialog, QFrame, QTabWidget, QScrollArea)
|
QWidget, QLabel, QHBoxLayout, QVBoxLayout, QApplication,
|
||||||
|
QMainWindow, QGridLayout, QDialog, QFrame, QTabWidget,
|
||||||
|
QScrollArea
|
||||||
|
)
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
|
@ -14,9 +17,7 @@ import settings as stg
|
||||||
|
|
||||||
|
|
||||||
class PlotNoiseWindow(QDialog):
|
class PlotNoiseWindow(QDialog):
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
|
|
||||||
super(PlotNoiseWindow, self).__init__(parent)
|
super(PlotNoiseWindow, self).__init__(parent)
|
||||||
|
|
||||||
self.setGeometry(400, 200, 700, 500)
|
self.setGeometry(400, 200, 700, 500)
|
||||||
|
|
@ -29,65 +30,60 @@ class PlotNoiseWindow(QDialog):
|
||||||
self.tab = QTabWidget()
|
self.tab = QTabWidget()
|
||||||
self.verticalLayout_Main.addWidget(self.tab)
|
self.verticalLayout_Main.addWidget(self.tab)
|
||||||
|
|
||||||
|
self.tabs = []
|
||||||
|
|
||||||
for i in range(len(stg.filename_BS_raw_data)):
|
for i in range(len(stg.filename_BS_raw_data)):
|
||||||
|
self.tabs.append(QWidget())
|
||||||
|
|
||||||
exec("self.tab" + str(i) + "= QWidget()")
|
self.tab.addTab(self.tabs[i], stg.filename_BS_raw_data[i])
|
||||||
exec("self.tab.addTab(self.tab" + str(i) + ", stg.filename_BS_raw_data[" + str(i) + "])")
|
|
||||||
|
|
||||||
exec("self.verticalLayout_tab" + str(i) + "= QVBoxLayout()")
|
verticalLayout = QVBoxLayout()
|
||||||
exec("self.tab" + str(i) + ".setLayout(self.verticalLayout_tab" + str(i) + ")")
|
self.tabs[i].setLayout(verticalLayout)
|
||||||
|
|
||||||
exec("self.fig" + str(i) + ", self.ax" + str(i) +
|
fig, ax = plt.subplots(
|
||||||
"= plt.subplots(nrows=stg.freq[" + str(i) + "].shape[0], ncols=1, layout='constrained')")
|
nrows=stg.freq[i].shape[0], ncols=1, layout='constrained'
|
||||||
|
)
|
||||||
|
|
||||||
if stg.BS_noise_raw_data[i].shape != (0,):
|
if stg.BS_noise_raw_data[i].shape != (0,):
|
||||||
|
|
||||||
for freq_ind, freq_val in enumerate(stg.freq[i]):
|
for freq_ind, freq_val in enumerate(stg.freq[i]):
|
||||||
|
ax[freq_ind].cla()
|
||||||
eval("self.ax" + str(i) + "[" + str(freq_ind) + "]" + ".cla()")
|
|
||||||
|
|
||||||
val_min = np.nanmin(stg.BS_noise_raw_data[i][freq_ind, :, :])
|
val_min = np.nanmin(stg.BS_noise_raw_data[i][freq_ind, :, :])
|
||||||
val_max = np.nanmax(stg.BS_noise_raw_data[i][freq_ind, :, :])
|
val_max = np.nanmax(stg.BS_noise_raw_data[i][freq_ind, :, :])
|
||||||
|
|
||||||
if val_min == val_max:
|
if val_min != val_max:
|
||||||
exec("pcm = self.ax" + str(i) + "[" + str(freq_ind) + "]" + ".pcolormesh(" +
|
|
||||||
"stg.time_noise[" + str(i) + "][" + str(freq_ind) + ", :]," +
|
|
||||||
"-stg.depth_noise[" + str(i) + "][" + str(freq_ind) + ", :]," +
|
|
||||||
"stg.BS_noise_raw_data[" + str(i) + "][" + str(freq_ind) + ", :, :]," +
|
|
||||||
"cmap='hsv')")
|
|
||||||
else:
|
|
||||||
val_min = 0
|
val_min = 0
|
||||||
val_max = 1e-5
|
val_max = 1e-5
|
||||||
exec("pcm = self.ax" + str(i) + "[" + str(freq_ind) + "]" + ".pcolormesh(" +
|
|
||||||
"stg.time_noise[" + str(i) + "][" + str(freq_ind) + ", :]," +
|
|
||||||
"-stg.depth_noise[" + str(i) + "][" + str(freq_ind) + ", :]," +
|
|
||||||
"stg.BS_noise_raw_data[" + str(i) + "][" + str(freq_ind) + ", :, :]," +
|
|
||||||
"cmap='hsv')")
|
|
||||||
|
|
||||||
eval("self.ax" + str(i) + "[" + str(freq_ind) + "]" + ".text(1, .70, stg.freq_text[" + str(i) +
|
pcm = ax[freq_ind].pcolormesh(
|
||||||
"][" + str(freq_ind) + "]," +
|
stg.time_noise[i][freq_ind, :],
|
||||||
"fontsize=10, fontweight='bold', fontname='DejaVu Sans', c='black', alpha=0.5," +
|
-stg.depth_noise[i][freq_ind, :],
|
||||||
"horizontalalignment='right', verticalalignment='bottom'," +
|
stg.BS_noise_raw_data[i][freq_ind, :, :],
|
||||||
"transform=self.ax" + str(i) + "[" + str(freq_ind) + "].transAxes)")
|
cmap='hsv'
|
||||||
|
)
|
||||||
|
|
||||||
exec("self.fig" + str(i) + ".supxlabel('Time (sec)', fontsize=10)")
|
ax[freq_ind].text(
|
||||||
exec("self.fig" + str(i) + ".supylabel('Depth (m)', fontsize=10)")
|
1, .70, stg.freq_text[i][freq_ind],
|
||||||
|
fontsize=10, fontweight='bold',
|
||||||
|
fontname='DejaVu Sans', c='black', alpha=0.5,
|
||||||
|
horizontalalignment='right', verticalalignment='bottom',
|
||||||
|
transform=ax[freq_ind].transAxes
|
||||||
|
)
|
||||||
|
|
||||||
exec("cbar = self.fig" + str(i) + ".colorbar(pcm, ax=self.ax" + str(i) + "[:] ," +
|
fig.supxlabel('Time (sec)', fontsize=10)
|
||||||
"shrink=1, location='right')")
|
fig.supylabel('Depth (m)', fontsize=10)
|
||||||
eval("cbar.set_label(label='Noise signal (V)', rotation=270, labelpad=8)")
|
|
||||||
|
|
||||||
exec("self.fig" + str(i) + ".canvas.draw_idle()")
|
cbar = fig.colorbar(
|
||||||
|
pcm, ax=ax[:], shrink=1, location='right'
|
||||||
|
)
|
||||||
|
cbar.set_label(label='Noise signal (V)', rotation=270, labelpad=8)
|
||||||
|
fig.canvas.draw_idle()
|
||||||
|
|
||||||
else:
|
canvas = FigureCanvas(fig)
|
||||||
|
toolbar = NavigationToolBar(canvas, self)
|
||||||
|
|
||||||
pass
|
scroll = QScrollArea()
|
||||||
|
scroll.setWidget(canvas)
|
||||||
|
|
||||||
exec("self.canvas" + str(i) + "= FigureCanvas(self.fig" + str(i) + ")")
|
verticalLayout.addWidget(toolbar)
|
||||||
exec("self.toolbar" + str(i) + "= NavigationToolBar(self.canvas" + str(i) + ", self)")
|
verticalLayout.addWidget(scroll)
|
||||||
|
|
||||||
exec("self.scroll" + str(i) + "= QScrollArea()")
|
|
||||||
exec("self.scroll" + str(i) + ".setWidget(self.canvas" + str(i) + ")")
|
|
||||||
|
|
||||||
exec("self.verticalLayout_tab" + str(i) + ".addWidget(self.toolbar" + str(i) + ")")
|
|
||||||
exec("self.verticalLayout_tab" + str(i) + ".addWidget(self.scroll" + str(i) + ")")
|
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,9 @@ class SampleDataTab(QWidget):
|
||||||
def __init__(self, widget_tab):
|
def __init__(self, widget_tab):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
icon_folder = QIcon(os.path.join("icons", "folder.png"))
|
icon_folder = QIcon(os.path.join(
|
||||||
|
os.path.dirname(__file__), "..", "icons", "folder.png"
|
||||||
|
))
|
||||||
self._setup_attrs()
|
self._setup_attrs()
|
||||||
|
|
||||||
### --- General layout of widgets ---
|
### --- General layout of widgets ---
|
||||||
|
|
|
||||||
|
|
@ -498,7 +498,7 @@ class SignalProcessingTab(QWidget):
|
||||||
def _setup_icons(self):
|
def _setup_icons(self):
|
||||||
def path_icon(icon):
|
def path_icon(icon):
|
||||||
return os.path.join(
|
return os.path.join(
|
||||||
"icons", icon
|
os.path.dirname(__file__), "..", "icons", icon
|
||||||
)
|
)
|
||||||
|
|
||||||
self.icon_folder = QIcon(path_icon("folder.png"))
|
self.icon_folder = QIcon(path_icon("folder.png"))
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
#/bin/sh
|
||||||
|
|
||||||
|
export WINEPREFIX=$PWD/wine
|
||||||
|
export WINEDEBUG=-all
|
||||||
|
|
||||||
|
wine $@
|
||||||
|
|
@ -8,20 +8,6 @@ rem Build windows version
|
||||||
mkdir acoused_packaging
|
mkdir acoused_packaging
|
||||||
pyinstaller --name "acoused" ..\main.py -y
|
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
|
rem move exe
|
||||||
move /y dist\AcouSed\acoused.exe acoused_packaging
|
move /y dist\AcouSed\acoused.exe acoused_packaging
|
||||||
move /y dist\acoused\_internal acoused_packaging
|
move /y dist\acoused\_internal acoused_packaging
|
||||||
|
|
@ -30,6 +16,21 @@ rmdir /s /q build
|
||||||
rmdir /s /q dist
|
rmdir /s /q dist
|
||||||
del /q AcouSed.spec
|
del /q AcouSed.spec
|
||||||
|
|
||||||
|
rem Icons
|
||||||
|
mkdir acoused_packaging\_internal\icons
|
||||||
|
copy /y ..\icons\*.png acoused_packaging\_internal\icons
|
||||||
|
|
||||||
|
rem Logos
|
||||||
|
mkdir acoused_packaging\_internal\logos
|
||||||
|
copy /y ..\logos\* acoused_packaging\_internal\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
|
||||||
|
|
||||||
set PATH=%PATH%;C:\Program Files (x86)/7-Zip
|
set PATH=%PATH%;C:\Program Files (x86)/7-Zip
|
||||||
7z a -tzip acoused_packaging.zip acoused_packaging
|
7z a -tzip acoused_packaging.zip acoused_packaging
|
||||||
|
|
||||||
|
pause
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue