add hodge fit
This commit is contained in:
parent
8a96e0472d
commit
1d9bf600ba
@ -14,7 +14,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(1041, 773)
|
||||
Dialog.resize(1094, 829)
|
||||
self.gridLayout = QtWidgets.QGridLayout(Dialog)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
|
||||
@ -61,27 +61,30 @@ class Ui_Dialog(object):
|
||||
self.dsc_plot.setSizePolicy(sizePolicy)
|
||||
self.dsc_plot.setObjectName("dsc_plot")
|
||||
self.gridLayout.addWidget(self.dsc_plot, 0, 1, 1, 1)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.calctg_button = QtWidgets.QPushButton(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.calctg_button = QtWidgets.QToolButton(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.calctg_button.sizePolicy().hasHeightForWidth())
|
||||
self.calctg_button.setSizePolicy(sizePolicy)
|
||||
self.calctg_button.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
|
||||
self.calctg_button.setArrowType(QtCore.Qt.RightArrow)
|
||||
self.calctg_button.setObjectName("calctg_button")
|
||||
self.horizontalLayout_2.addWidget(self.calctg_button)
|
||||
self.pushButton_2 = QtWidgets.QPushButton(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
|
||||
self.verticalLayout_2.addWidget(self.calctg_button)
|
||||
self.toolButton_2 = QtWidgets.QToolButton(Dialog)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.pushButton_2.sizePolicy().hasHeightForWidth())
|
||||
self.pushButton_2.setSizePolicy(sizePolicy)
|
||||
self.pushButton_2.setObjectName("pushButton_2")
|
||||
self.horizontalLayout_2.addWidget(self.pushButton_2)
|
||||
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_2.addItem(spacerItem)
|
||||
self.gridLayout.addLayout(self.horizontalLayout_2, 2, 1, 1, 1)
|
||||
sizePolicy.setHeightForWidth(self.toolButton_2.sizePolicy().hasHeightForWidth())
|
||||
self.toolButton_2.setSizePolicy(sizePolicy)
|
||||
self.toolButton_2.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
|
||||
self.toolButton_2.setAutoRaise(False)
|
||||
self.toolButton_2.setArrowType(QtCore.Qt.RightArrow)
|
||||
self.toolButton_2.setObjectName("toolButton_2")
|
||||
self.verticalLayout_2.addWidget(self.toolButton_2)
|
||||
self.gridLayout.addLayout(self.verticalLayout_2, 0, 2, 1, 1)
|
||||
self.tabWidget = QtWidgets.QTabWidget(Dialog)
|
||||
self.tabWidget.setTabPosition(QtWidgets.QTabWidget.East)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
@ -89,37 +92,57 @@ class Ui_Dialog(object):
|
||||
self.tabWidgetPage1.setObjectName("tabWidgetPage1")
|
||||
self.gridLayout_3 = QtWidgets.QGridLayout(self.tabWidgetPage1)
|
||||
self.gridLayout_3.setObjectName("gridLayout_3")
|
||||
self.tg_export_check = QtWidgets.QCheckBox(self.tabWidgetPage1)
|
||||
self.tg_export_check.setChecked(True)
|
||||
self.tg_export_check.setObjectName("tg_export_check")
|
||||
self.gridLayout_3.addWidget(self.tg_export_check, 2, 1, 1, 1)
|
||||
self.tglines_export_check = QtWidgets.QCheckBox(self.tabWidgetPage1)
|
||||
self.tglines_export_check.setChecked(True)
|
||||
self.tglines_export_check.setObjectName("tglines_export_check")
|
||||
self.gridLayout_3.addWidget(self.tglines_export_check, 2, 2, 1, 1)
|
||||
self.label_6 = QtWidgets.QLabel(self.tabWidgetPage1)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.gridLayout_3.addWidget(self.label_6, 4, 1, 1, 1)
|
||||
self.gridLayout_3.addWidget(self.tglines_export_check, 2, 3, 1, 1)
|
||||
self.checkBox_6 = QtWidgets.QCheckBox(self.tabWidgetPage1)
|
||||
self.checkBox_6.setChecked(True)
|
||||
self.checkBox_6.setObjectName("checkBox_6")
|
||||
self.gridLayout_3.addWidget(self.checkBox_6, 6, 3, 1, 1)
|
||||
self.new_graph_tau_combo = QtWidgets.QComboBox(self.tabWidgetPage1)
|
||||
self.new_graph_tau_combo.setObjectName("new_graph_tau_combo")
|
||||
self.gridLayout_3.addWidget(self.new_graph_tau_combo, 5, 2, 1, 1)
|
||||
self.new_graph_tau_check = QtWidgets.QCheckBox(self.tabWidgetPage1)
|
||||
self.new_graph_tau_check.setChecked(True)
|
||||
self.new_graph_tau_check.setObjectName("new_graph_tau_check")
|
||||
self.gridLayout_3.addWidget(self.new_graph_tau_check, 5, 1, 1, 1)
|
||||
self.gridLayout_3.addWidget(self.new_graph_tau_combo, 8, 3, 1, 1)
|
||||
self.line = QtWidgets.QFrame(self.tabWidgetPage1)
|
||||
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.line.setObjectName("line")
|
||||
self.gridLayout_3.addWidget(self.line, 3, 1, 1, 2)
|
||||
self.hodge_selection = CheckCombobox(self.tabWidgetPage1)
|
||||
self.hodge_selection.setObjectName("hodge_selection")
|
||||
self.hodge_selection.addItem("")
|
||||
self.hodge_selection.addItem("")
|
||||
self.hodge_selection.addItem("")
|
||||
self.hodge_selection.addItem("")
|
||||
self.hodge_selection.addItem("")
|
||||
self.gridLayout_3.addWidget(self.hodge_selection, 4, 2, 1, 1)
|
||||
self.gridLayout_3.addWidget(self.line, 3, 2, 1, 2)
|
||||
self.checkBox = QtWidgets.QCheckBox(self.tabWidgetPage1)
|
||||
self.checkBox.setChecked(True)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.gridLayout_3.addWidget(self.checkBox, 5, 2, 1, 1)
|
||||
self.tg_export_check = QtWidgets.QCheckBox(self.tabWidgetPage1)
|
||||
self.tg_export_check.setChecked(True)
|
||||
self.tg_export_check.setObjectName("tg_export_check")
|
||||
self.gridLayout_3.addWidget(self.tg_export_check, 2, 2, 1, 1)
|
||||
self.new_graph_tau_check = QtWidgets.QCheckBox(self.tabWidgetPage1)
|
||||
self.new_graph_tau_check.setChecked(True)
|
||||
self.new_graph_tau_check.setObjectName("new_graph_tau_check")
|
||||
self.gridLayout_3.addWidget(self.new_graph_tau_check, 8, 2, 1, 1)
|
||||
self.checkBox_5 = QtWidgets.QCheckBox(self.tabWidgetPage1)
|
||||
self.checkBox_5.setChecked(True)
|
||||
self.checkBox_5.setObjectName("checkBox_5")
|
||||
self.gridLayout_3.addWidget(self.checkBox_5, 6, 2, 1, 1)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout_3.addItem(spacerItem, 10, 3, 1, 1)
|
||||
self.label_6 = QtWidgets.QLabel(self.tabWidgetPage1)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.gridLayout_3.addWidget(self.label_6, 4, 2, 1, 2)
|
||||
self.checkBox_4 = QtWidgets.QCheckBox(self.tabWidgetPage1)
|
||||
self.checkBox_4.setChecked(True)
|
||||
self.checkBox_4.setObjectName("checkBox_4")
|
||||
self.gridLayout_3.addWidget(self.checkBox_4, 5, 3, 1, 1)
|
||||
self.checkBox_7 = QtWidgets.QCheckBox(self.tabWidgetPage1)
|
||||
self.checkBox_7.setChecked(True)
|
||||
self.checkBox_7.setObjectName("checkBox_7")
|
||||
self.gridLayout_3.addWidget(self.checkBox_7, 7, 2, 1, 1)
|
||||
self.pushButton_4 = QtWidgets.QPushButton(self.tabWidgetPage1)
|
||||
self.pushButton_4.setObjectName("pushButton_4")
|
||||
self.gridLayout_3.addWidget(self.pushButton_4, 9, 2, 1, 2)
|
||||
self.tghodge_graph = PlotWidget(self.tabWidgetPage1)
|
||||
self.tghodge_graph.setObjectName("tghodge_graph")
|
||||
self.gridLayout_3.addWidget(self.tghodge_graph, 2, 1, 9, 1)
|
||||
self.tau_plot = PlotWidget(self.tabWidgetPage1)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.MinimumExpanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
@ -127,44 +150,39 @@ class Ui_Dialog(object):
|
||||
sizePolicy.setHeightForWidth(self.tau_plot.sizePolicy().hasHeightForWidth())
|
||||
self.tau_plot.setSizePolicy(sizePolicy)
|
||||
self.tau_plot.setObjectName("tau_plot")
|
||||
self.gridLayout_3.addWidget(self.tau_plot, 0, 0, 8, 1)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout_3.addItem(spacerItem1, 7, 2, 1, 1)
|
||||
self.pushButton_4 = QtWidgets.QPushButton(self.tabWidgetPage1)
|
||||
self.pushButton_4.setObjectName("pushButton_4")
|
||||
self.gridLayout_3.addWidget(self.pushButton_4, 6, 1, 1, 2)
|
||||
self.gridLayout_3.addWidget(self.tau_plot, 2, 0, 9, 1)
|
||||
self.tabWidget.addTab(self.tabWidgetPage1, "")
|
||||
self.tabWidgetPage2 = QtWidgets.QWidget()
|
||||
self.tabWidgetPage2.setObjectName("tabWidgetPage2")
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.tabWidgetPage2)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.pushButton_3 = QtWidgets.QPushButton(self.tabWidgetPage2)
|
||||
self.pushButton_3.setObjectName("pushButton_3")
|
||||
self.gridLayout_2.addWidget(self.pushButton_3, 1, 1, 1, 2)
|
||||
self.fit_tnhm_fitbutton = QtWidgets.QPushButton(self.tabWidgetPage2)
|
||||
self.fit_tnhm_fitbutton.setObjectName("fit_tnhm_fitbutton")
|
||||
self.gridLayout_2.addWidget(self.fit_tnhm_fitbutton, 1, 1, 1, 2)
|
||||
self.graphicsView_2 = PlotWidget(self.tabWidgetPage2)
|
||||
self.graphicsView_2.setObjectName("graphicsView_2")
|
||||
self.gridLayout_2.addWidget(self.graphicsView_2, 0, 0, 9, 1)
|
||||
self.checkBox = QtWidgets.QCheckBox(self.tabWidgetPage2)
|
||||
self.checkBox.setChecked(True)
|
||||
self.checkBox.setObjectName("checkBox")
|
||||
self.gridLayout_2.addWidget(self.checkBox, 5, 1, 1, 1)
|
||||
self.new_graph_tnmh_check = QtWidgets.QCheckBox(self.tabWidgetPage2)
|
||||
self.new_graph_tnmh_check.setChecked(True)
|
||||
self.new_graph_tnmh_check.setObjectName("new_graph_tnmh_check")
|
||||
self.gridLayout_2.addWidget(self.new_graph_tnmh_check, 5, 1, 1, 1)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label_2 = QtWidgets.QLabel(self.tabWidgetPage2)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.horizontalLayout.addWidget(self.label_2)
|
||||
self.comboBox = QtWidgets.QComboBox(self.tabWidgetPage2)
|
||||
self.comboBox.setObjectName("comboBox")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.comboBox.addItem("")
|
||||
self.horizontalLayout.addWidget(self.comboBox)
|
||||
self.tnmh_tg_combo = QtWidgets.QComboBox(self.tabWidgetPage2)
|
||||
self.tnmh_tg_combo.setObjectName("tnmh_tg_combo")
|
||||
self.tnmh_tg_combo.addItem("")
|
||||
self.tnmh_tg_combo.addItem("")
|
||||
self.tnmh_tg_combo.addItem("")
|
||||
self.tnmh_tg_combo.addItem("")
|
||||
self.tnmh_tg_combo.addItem("")
|
||||
self.horizontalLayout.addWidget(self.tnmh_tg_combo)
|
||||
self.gridLayout_2.addLayout(self.horizontalLayout, 0, 1, 1, 2)
|
||||
self.comboBox_2 = QtWidgets.QComboBox(self.tabWidgetPage2)
|
||||
self.comboBox_2.setObjectName("comboBox_2")
|
||||
self.gridLayout_2.addWidget(self.comboBox_2, 5, 2, 1, 1)
|
||||
self.new_graph_tnmh_combo = QtWidgets.QComboBox(self.tabWidgetPage2)
|
||||
self.new_graph_tnmh_combo.setObjectName("new_graph_tnmh_combo")
|
||||
self.gridLayout_2.addWidget(self.new_graph_tnmh_combo, 5, 2, 1, 1)
|
||||
self.line_2 = QtWidgets.QFrame(self.tabWidgetPage2)
|
||||
self.line_2.setMinimumSize(QtCore.QSize(0, 0))
|
||||
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
@ -177,13 +195,13 @@ class Ui_Dialog(object):
|
||||
self.checkBox_3 = QtWidgets.QCheckBox(self.tabWidgetPage2)
|
||||
self.checkBox_3.setObjectName("checkBox_3")
|
||||
self.gridLayout_2.addWidget(self.checkBox_3, 4, 1, 1, 2)
|
||||
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout_2.addItem(spacerItem2, 8, 1, 1, 1)
|
||||
spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.gridLayout_2.addItem(spacerItem1, 8, 1, 1, 1)
|
||||
self.pushButton = QtWidgets.QPushButton(self.tabWidgetPage2)
|
||||
self.pushButton.setObjectName("pushButton")
|
||||
self.gridLayout_2.addWidget(self.pushButton, 7, 1, 1, 2)
|
||||
self.tabWidget.addTab(self.tabWidgetPage2, "")
|
||||
self.gridLayout.addWidget(self.tabWidget, 4, 1, 1, 1)
|
||||
self.gridLayout.addWidget(self.tabWidget, 4, 1, 1, 2)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
@ -197,29 +215,28 @@ class Ui_Dialog(object):
|
||||
self.label.setText(_translate("Dialog", "<html><head/><body><p><span style=\" font-weight:600;\">Tg values:</span></p></body></html>"))
|
||||
self.label_4.setText(_translate("Dialog", "<html><head/><body><p><span style=\" font-weight:600;\">TNMH parameter:</span></p></body></html>"))
|
||||
self.calctg_button.setText(_translate("Dialog", "Calculate Tg"))
|
||||
self.pushButton_2.setText(_translate("Dialog", "Calculate fictive Cp"))
|
||||
self.tg_export_check.setText(_translate("Dialog", "Export Tg"))
|
||||
self.toolButton_2.setText(_translate("Dialog", "Calculate fictive Cp"))
|
||||
self.tglines_export_check.setText(_translate("Dialog", "Export lines"))
|
||||
self.label_6.setText(_translate("Dialog", "Export Hodge:"))
|
||||
self.checkBox_6.setText(_translate("Dialog", "End"))
|
||||
self.checkBox.setText(_translate("Dialog", "Onset"))
|
||||
self.tg_export_check.setText(_translate("Dialog", "Export Tg"))
|
||||
self.new_graph_tau_check.setText(_translate("Dialog", "New graph"))
|
||||
self.hodge_selection.setItemText(0, _translate("Dialog", "Onset"))
|
||||
self.hodge_selection.setItemText(1, _translate("Dialog", "Midpoint"))
|
||||
self.hodge_selection.setItemText(2, _translate("Dialog", "End"))
|
||||
self.hodge_selection.setItemText(3, _translate("Dialog", "Inflection"))
|
||||
self.hodge_selection.setItemText(4, _translate("Dialog", "Fictive"))
|
||||
self.pushButton_4.setText(_translate("Dialog", "Save"))
|
||||
self.checkBox_5.setText(_translate("Dialog", "Inflection"))
|
||||
self.label_6.setText(_translate("Dialog", "Export Hodge:"))
|
||||
self.checkBox_4.setText(_translate("Dialog", "Midpoint"))
|
||||
self.checkBox_7.setText(_translate("Dialog", "Fictive"))
|
||||
self.pushButton_4.setText(_translate("Dialog", "Export"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabWidgetPage1), _translate("Dialog", "Tg / Hodge"))
|
||||
self.pushButton_3.setText(_translate("Dialog", "Fit TNMH model"))
|
||||
self.checkBox.setText(_translate("Dialog", "New graph"))
|
||||
self.fit_tnhm_fitbutton.setText(_translate("Dialog", "Fit TNMH model"))
|
||||
self.new_graph_tnmh_check.setText(_translate("Dialog", "New graph"))
|
||||
self.label_2.setText(_translate("Dialog", "Tg for TNMH"))
|
||||
self.comboBox.setItemText(0, _translate("Dialog", "Fictive"))
|
||||
self.comboBox.setItemText(1, _translate("Dialog", "Onset"))
|
||||
self.comboBox.setItemText(2, _translate("Dialog", "Midpoint"))
|
||||
self.comboBox.setItemText(3, _translate("Dialog", "End"))
|
||||
self.comboBox.setItemText(4, _translate("Dialog", "Inflection"))
|
||||
self.tnmh_tg_combo.setItemText(0, _translate("Dialog", "Fictive"))
|
||||
self.tnmh_tg_combo.setItemText(1, _translate("Dialog", "Onset"))
|
||||
self.tnmh_tg_combo.setItemText(2, _translate("Dialog", "Midpoint"))
|
||||
self.tnmh_tg_combo.setItemText(3, _translate("Dialog", "End"))
|
||||
self.tnmh_tg_combo.setItemText(4, _translate("Dialog", "Inflection"))
|
||||
self.checkBox_2.setText(_translate("Dialog", "Export dTf / dT"))
|
||||
self.checkBox_3.setText(_translate("Dialog", "Export fit"))
|
||||
self.pushButton.setText(_translate("Dialog", "Save"))
|
||||
self.pushButton.setText(_translate("Dialog", "Export"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabWidgetPage2), _translate("Dialog", "TNMH"))
|
||||
from ..lib.forms import CheckCombobox
|
||||
from pyqtgraph import PlotWidget
|
||||
|
@ -27,19 +27,46 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog):
|
||||
self._plots = {}
|
||||
self._tg_value = {}
|
||||
self._fit = {}
|
||||
self._lines = {}
|
||||
self._hodge = {
|
||||
'onset': (PlotItem(x=[], y=[], pen=None, symbol='o', symbolBrush=Tab10.TabBlue.rgb(), name='Onset'), None),
|
||||
'midpoint': (PlotItem(x=[], y=[], pen=None, symbol='s', symbolBrush=Tab10.TabOrange.rgb(), name='Midpoint'), None),
|
||||
'end': (PlotItem(x=[], y=[], pen=None, symbol='t', symbolBrush=Tab10.TabGreen.rgb(), name='End'), None),
|
||||
'inflection': (PlotItem(x=[], y=[], pen=None, symbol='d', symbolBrush=Tab10.TabRed.rgb(), name='Inflection'), None),
|
||||
'onset': (
|
||||
PlotItem(x=[], y=[], pen=None, symbol='o', symbolBrush=Tab10.TabBlue.rgb(), name='Onset'),
|
||||
None,
|
||||
(PlotItem(x=[], y=[], pen=mkPen({'color': Tab10.TabBlue.rgb()})),
|
||||
PlotItem(x=[], y=[], pen=None, symbol='o', symbolBrush=Tab10.TabBlue.rgb())),
|
||||
None,
|
||||
),
|
||||
'midpoint': (
|
||||
PlotItem(x=[], y=[], pen=None, symbol='s', symbolBrush=Tab10.TabOrange.rgb(), name='Midpoint'),
|
||||
None,
|
||||
(PlotItem(x=[], y=[], pen=mkPen({'color': Tab10.TabOrange.rgb()})),
|
||||
PlotItem(x=[], y=[], pen=None, symbol='s', symbolBrush=Tab10.TabOrange.rgb())),
|
||||
None,
|
||||
),
|
||||
'end': (
|
||||
PlotItem(x=[], y=[], pen=None, symbol='t', symbolBrush=Tab10.TabGreen.rgb(), name='End'),
|
||||
None,
|
||||
(PlotItem(x=[], y=[], pen=mkPen({'color': Tab10.TabGreen.rgb()})),
|
||||
PlotItem(x=[], y=[], pen=None, symbol='t', symbolBrush=Tab10.TabGreen.rgb())),
|
||||
None,
|
||||
),
|
||||
'inflection': (
|
||||
PlotItem(x=[], y=[], pen=None, symbol='d', symbolBrush=Tab10.TabRed.rgb(), name='Inflection'),
|
||||
None,
|
||||
(PlotItem(x=[], y=[], pen=mkPen({'color': Tab10.TabRed.rgb()})),
|
||||
PlotItem(x=[], y=[], pen=None, symbol='d', symbolBrush=Tab10.TabRed.rgb())),
|
||||
None,
|
||||
),
|
||||
# 'fictive': PlotItem(x=[], y=[], pen=None, symbol='t1', symbolBrush=Tab10.TabPurple.rgb(), name='Fictive'),
|
||||
# 'TNMH': PlotItem(x=[], y=[], pen=None, symbol='star', symbolBrush=Tab10.TabPurple.rgb(), name='TNMH'),
|
||||
}
|
||||
self._lines = {}
|
||||
self.tau_plot.getPlotItem().addLegend()
|
||||
for plt, _ in self._hodge.values():
|
||||
for plt, _, fitplt, _ in self._hodge.values():
|
||||
self.tau_plot.addItem(plt)
|
||||
self.tghodge_graph.addItem(fitplt[0])
|
||||
self.tghodge_graph.addItem(fitplt[1])
|
||||
self.tau_plot.setLogMode(y=True)
|
||||
self.tghodge_graph.setLogMode(y=True)
|
||||
|
||||
self.limits = RegionItem(), RegionItem()
|
||||
for lim in self.limits:
|
||||
@ -69,7 +96,9 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog):
|
||||
|
||||
for key, plt in self._hodge.items():
|
||||
plt[0].setData(x=[], y=[])
|
||||
self._hodge[key] = (plt[0], None)
|
||||
plt[2][0].setData(x=[], y=[])
|
||||
plt[2][1].setData(x=[], y=[])
|
||||
self._hodge[key] = (plt[0], None, plt[2], None)
|
||||
|
||||
self._dsc = {}
|
||||
self._plots = {}
|
||||
@ -242,7 +271,7 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog):
|
||||
plot[-1].setData(res.x, res.y)
|
||||
|
||||
def hodge(self):
|
||||
for tg_type, (plot, data) in self._hodge.items():
|
||||
for tg_type, (plot, data, fitplots, fit) in self._hodge.items():
|
||||
|
||||
m = []
|
||||
for idx in range(self.listWidget.count()):
|
||||
@ -260,11 +289,13 @@ class TgCalculator(QtWidgets.QDialog, Ui_Dialog):
|
||||
m.append([tg_value, data.value])
|
||||
|
||||
if len(m) > 1:
|
||||
data = tau_hodge(*array(m).T)
|
||||
data, fit = tau_hodge(*array(m).T)
|
||||
data.name = f'{data.name} ({tg_type.capitalize()})'
|
||||
plot.setData(data.x, data.y)
|
||||
fitplots[0].setData(1000/fit.x, fit.y)
|
||||
fitplots[1].setData(1000/fit.x_data, fit.y_data)
|
||||
|
||||
self._hodge[tg_type] = (plot, data)
|
||||
self._hodge[tg_type] = (plot, data, fitplots, fit)
|
||||
|
||||
def close(self) -> bool:
|
||||
self.clear()
|
||||
|
@ -3,12 +3,13 @@ from scipy.stats import linregress
|
||||
|
||||
from nmreval.data import Points
|
||||
from nmreval.fit.minimizer import FitRoutine
|
||||
from nmreval.fit.result import FitResult
|
||||
from nmreval.lib.utils import ArrayLike
|
||||
from nmreval.models import Arrhenius
|
||||
from nmreval.utils import kB
|
||||
|
||||
|
||||
def tau_hodge(tg: ArrayLike, rate: ArrayLike) -> Points:
|
||||
def tau_hodge(tg: ArrayLike, rate: ArrayLike) -> (Points, FitResult):
|
||||
rate = np.asanyarray(rate) / 60
|
||||
tg = np.asanyarray(tg)
|
||||
fitter = FitRoutine()
|
||||
@ -23,4 +24,4 @@ def tau_hodge(tg: ArrayLike, rate: ArrayLike) -> Points:
|
||||
de = res.parameter['E_{A}']
|
||||
tau = kB*tg**2/np.abs(de.value)/rate
|
||||
|
||||
return Points(x=1000/tg, y=tau, y_err=tau*de.error/np.abs(de.value), name='Hodge')
|
||||
return Points(x=1000/tg, y=tau, y_err=tau*de.error/np.abs(de.value), name='Hodge'), res
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1041</width>
|
||||
<height>773</height>
|
||||
<width>1094</width>
|
||||
<height>829</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -85,12 +85,12 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item row="0" column="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="calctg_button">
|
||||
<widget class="QToolButton" name="calctg_button">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -98,12 +98,18 @@
|
||||
<property name="text">
|
||||
<string>Calculate Tg</string>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<property name="arrowType">
|
||||
<enum>Qt::RightArrow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<widget class="QToolButton" name="toolButton_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -111,47 +117,33 @@
|
||||
<property name="text">
|
||||
<string>Calculate fictive Cp</string>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="arrowType">
|
||||
<enum>Qt::RightArrow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="4" column="1" colspan="2">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="tabPosition">
|
||||
<enum>QTabWidget::East</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tabWidgetPage1">
|
||||
<attribute name="title">
|
||||
<string>Tg / Hodge</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="tg_export_check">
|
||||
<property name="text">
|
||||
<string>Export Tg</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<item row="2" column="3">
|
||||
<widget class="QCheckBox" name="tglines_export_check">
|
||||
<property name="text">
|
||||
<string>Export lines</string>
|
||||
@ -161,17 +153,47 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<item row="6" column="3">
|
||||
<widget class="QCheckBox" name="checkBox_6">
|
||||
<property name="text">
|
||||
<string>Export Hodge:</string>
|
||||
<string>End</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="3">
|
||||
<widget class="QComboBox" name="new_graph_tau_combo"/>
|
||||
</item>
|
||||
<item row="3" column="2" colspan="2">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QComboBox" name="new_graph_tau_combo"/>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="text">
|
||||
<string>Onset</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="2" column="2">
|
||||
<widget class="QCheckBox" name="tg_export_check">
|
||||
<property name="text">
|
||||
<string>Export Tg</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="2">
|
||||
<widget class="QCheckBox" name="new_graph_tau_check">
|
||||
<property name="text">
|
||||
<string>New graph</string>
|
||||
@ -181,53 +203,17 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<item row="6" column="2">
|
||||
<widget class="QCheckBox" name="checkBox_5">
|
||||
<property name="text">
|
||||
<string>Inflection</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="CheckCombobox" name="hodge_selection">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Onset</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Midpoint</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>End</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Inflection</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Fictive</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="8">
|
||||
<widget class="PlotWidget" name="tau_plot">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<item row="10" column="3">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@ -240,10 +226,50 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="6" column="1" colspan="2">
|
||||
<item row="4" column="2" colspan="2">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Export Hodge:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QCheckBox" name="checkBox_4">
|
||||
<property name="text">
|
||||
<string>Midpoint</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="QCheckBox" name="checkBox_7">
|
||||
<property name="text">
|
||||
<string>Fictive</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="2" colspan="2">
|
||||
<widget class="QPushButton" name="pushButton_4">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
<string>Export</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" rowspan="9">
|
||||
<widget class="PlotWidget" name="tghodge_graph"/>
|
||||
</item>
|
||||
<item row="2" column="0" rowspan="9">
|
||||
<widget class="PlotWidget" name="tau_plot">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -360,7 +386,7 @@
|
||||
<item row="7" column="1" colspan="2">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
<string>Export</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -376,11 +402,6 @@
|
||||
<extends>QGraphicsView</extends>
|
||||
<header>pyqtgraph</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>CheckCombobox</class>
|
||||
<extends>QComboBox</extends>
|
||||
<header>..lib.forms</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
|
Loading…
Reference in New Issue
Block a user