diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0f0dbc9..ef2e050 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,10 @@ This document records all notable changes to This project adheres to `PEP 440 -- Version Identification and Dependency Specification `_. +0.4.1 (22-03-24) +---------------- +- The UI for Phase Error Correction now incorporates the wavenumber-increased parameter of 0.4 release + 0.4 (22-03-11) --------------- - **Important**: PhaseErrCorrectALS now has parameter for whether wavenumber is increasing left-to-right. This is important to set correctly. This should match the `conjugate` parameter in the KramersKronig. diff --git a/crikit/CRIkitUI.py b/crikit/CRIkitUI.py index 6b50add..2e5c43a 100644 --- a/crikit/CRIkitUI.py +++ b/crikit/CRIkitUI.py @@ -2289,7 +2289,9 @@ def errorCorrectPhase(self): rng = self.hsi.freq.op_range_pix - plugin = _widgetALS(x=self.hsi.f_full, rng=rng) + wn_increase = (self.hsi.f[1] - self.hsi.f[1]) > 0 + plugin = _widgetALS(x=self.hsi.f_full, rng=rng, + wavenumber_increasing=wn_increase) winPlotEffect = _DialogPlotEffect.dialogPlotEffect(preview_spectra, x=self.hsi.f_full, plugin=plugin, diff --git a/crikit/__init__.py b/crikit/__init__.py index 8d78fda..233e237 100644 --- a/crikit/__init__.py +++ b/crikit/__init__.py @@ -14,4 +14,4 @@ * Charles H. Camp Jr. """ -__version__ = '0.4.0' \ No newline at end of file +__version__ = '0.4.1' \ No newline at end of file diff --git a/crikit/ui/qt5/ui_PlotEffect_ALS2.ui b/crikit/ui/qt5/ui_PlotEffect_ALS2.ui index ec244ca..89d2024 100644 --- a/crikit/ui/qt5/ui_PlotEffect_ALS2.ui +++ b/crikit/ui/qt5/ui_PlotEffect_ALS2.ui @@ -7,7 +7,7 @@ 0 0 800 - 282 + 301 @@ -17,69 +17,67 @@ font: 10pt "Arial"; - - + + + + Fixed=P + + + + + + + 2 + + + + + <html><head/><body><p>Wavenumber Increasing <span style=" font-weight:700;">Left-to-Right</span></p></body></html> + + + Qt::RichText + + + true + + + + + + + Conjugate if the frequency axis increases right-to-left. + + + + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + - + 0 0 - - - 0 - 10 - - - - - 0 - 140 - - - - QFrame::Plain - - - Qt::ScrollBarAsNeeded - - - 0 - - - true - - - 80 - - - false - - - 20 - - - true - - - - Start X - - - - - End X - - - - - P (Asymmetry) Value - - - - - - QFrame::StyledPanel @@ -141,7 +139,6 @@ Arial 10 - 50 false false @@ -196,10 +193,161 @@ - + + + + 2 + + + QLayout::SetNoConstraint + + + + + 0 + + + 0 + + + + + 0 + + + + + Weighted (Subsections) + + + + + + + 5 + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + Weight Value + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + 0 + 0 + + + + + 0 + 70 + + + + + 0 + 65 + + + + 80 + + + true + + + + Start X + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + - + 0 0 @@ -225,6 +373,9 @@ + + QLayout::SetMaximumSize + @@ -232,19 +383,6 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -259,11 +397,75 @@ + + + + + 0 + 0 + + + + + 0 + 12 + + + + + 0 + 140 + + + + QFrame::Plain + + + Qt::ScrollBarAsNeeded + + + 0 + + + true + + + 20 + + + 80 + + + false + + + true + + + + Start X + + + + + End X + + + + + P (Asymmetry) Value + + + + Qt::Vertical + + QSizePolicy::Expanding + 20 @@ -277,14 +479,7 @@ - - - - Fixed=P - - - - + QFrame::StyledPanel @@ -371,114 +566,34 @@ - - - - QLayout::SetNoConstraint + + + + + 0 + 0 + - - - - 0 - - - 0 - - - - - 0 - - - - - Weighted (Subsections) - - - - - - - 5 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - Weight Value - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - 0 - 0 - - - - - 0 - 70 - - - - - 0 - 65 - - - - 80 - - - true - - - - Start X - - - - - - + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + Qt::Vertical + + + + 20 + 40 + + + diff --git a/crikit/ui/qt_PlotEffect_ALS2.py b/crikit/ui/qt_PlotEffect_ALS2.py index a1baf3e..37ea48f 100644 --- a/crikit/ui/qt_PlotEffect_ALS2.py +++ b/crikit/ui/qt_PlotEffect_ALS2.py @@ -2,9 +2,11 @@ # Form implementation generated from reading ui file '.\ui_PlotEffect_ALS2.ui' # -# Created by: PyQt5 UI code generator 5.12 +# Created by: PyQt5 UI code generator 5.15.4 # -# WARNING! All changes made in this file will be lost! +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + from PyQt5 import QtCore, QtGui, QtWidgets @@ -12,36 +14,35 @@ class Ui_Form(object): def setupUi(self, Form): Form.setObjectName("Form") - Form.resize(800, 282) + Form.resize(800, 301) Form.setStyleSheet("font: 10pt \"Arial\";") self.gridLayout = QtWidgets.QGridLayout(Form) self.gridLayout.setObjectName("gridLayout") - self.tableWidgetAsym = QtWidgets.QTableWidget(Form) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Maximum) + self.label_5 = QtWidgets.QLabel(Form) + self.label_5.setObjectName("label_5") + self.gridLayout.addWidget(self.label_5, 0, 1, 1, 1) + self.verticalLayout_10 = QtWidgets.QVBoxLayout() + self.verticalLayout_10.setSpacing(2) + self.verticalLayout_10.setObjectName("verticalLayout_10") + self.label_13 = QtWidgets.QLabel(Form) + self.label_13.setTextFormat(QtCore.Qt.RichText) + self.label_13.setWordWrap(True) + self.label_13.setObjectName("label_13") + self.verticalLayout_10.addWidget(self.label_13) + self.checkBoxWNIncreasing = QtWidgets.QCheckBox(Form) + self.checkBoxWNIncreasing.setText("") + self.checkBoxWNIncreasing.setChecked(True) + self.checkBoxWNIncreasing.setObjectName("checkBoxWNIncreasing") + self.verticalLayout_10.addWidget(self.checkBoxWNIncreasing, 0, QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop) + spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.verticalLayout_10.addItem(spacerItem) + self.gridLayout.addLayout(self.verticalLayout_10, 3, 4, 1, 1) + self.frame_3 = QtWidgets.QFrame(Form) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.tableWidgetAsym.sizePolicy().hasHeightForWidth()) - self.tableWidgetAsym.setSizePolicy(sizePolicy) - self.tableWidgetAsym.setMinimumSize(QtCore.QSize(0, 10)) - self.tableWidgetAsym.setBaseSize(QtCore.QSize(0, 140)) - self.tableWidgetAsym.setFrameShadow(QtWidgets.QFrame.Plain) - self.tableWidgetAsym.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded) - self.tableWidgetAsym.setRowCount(0) - self.tableWidgetAsym.setObjectName("tableWidgetAsym") - self.tableWidgetAsym.setColumnCount(3) - item = QtWidgets.QTableWidgetItem() - self.tableWidgetAsym.setHorizontalHeaderItem(0, item) - item = QtWidgets.QTableWidgetItem() - self.tableWidgetAsym.setHorizontalHeaderItem(1, item) - item = QtWidgets.QTableWidgetItem() - self.tableWidgetAsym.setHorizontalHeaderItem(2, item) - self.tableWidgetAsym.horizontalHeader().setCascadingSectionResizes(True) - self.tableWidgetAsym.horizontalHeader().setDefaultSectionSize(80) - self.tableWidgetAsym.horizontalHeader().setHighlightSections(False) - self.tableWidgetAsym.horizontalHeader().setMinimumSectionSize(20) - self.tableWidgetAsym.horizontalHeader().setStretchLastSection(True) - self.gridLayout.addWidget(self.tableWidgetAsym, 3, 0, 1, 1) - self.frame_3 = QtWidgets.QFrame(Form) + sizePolicy.setHeightForWidth(self.frame_3.sizePolicy().hasHeightForWidth()) + self.frame_3.setSizePolicy(sizePolicy) self.frame_3.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame_3.setFrameShadow(QtWidgets.QFrame.Plain) self.frame_3.setObjectName("frame_3") @@ -58,8 +59,8 @@ def setupUi(self, Form): self.spinBoxRedux.setMaximum(10000) self.spinBoxRedux.setObjectName("spinBoxRedux") self.verticalLayout_3.addWidget(self.spinBoxRedux, 0, QtCore.Qt.AlignTop) - spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.verticalLayout_3.addItem(spacerItem) + spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.verticalLayout_3.addItem(spacerItem1) self.gridLayout_2.addLayout(self.verticalLayout_3, 0, 1, 1, 1) self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") @@ -69,12 +70,11 @@ def setupUi(self, Form): font.setPointSize(10) font.setBold(False) font.setItalic(False) - font.setWeight(50) self.label_2.setFont(font) self.label_2.setObjectName("label_2") self.verticalLayout_2.addWidget(self.label_2, 0, QtCore.Qt.AlignLeft) - spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.verticalLayout_2.addItem(spacerItem1) + spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.verticalLayout_2.addItem(spacerItem2) self.gridLayout_2.addLayout(self.verticalLayout_2, 0, 0, 1, 1) self.verticalLayout_4 = QtWidgets.QVBoxLayout() self.verticalLayout_4.setObjectName("verticalLayout_4") @@ -88,9 +88,61 @@ def setupUi(self, Form): self.checkBox.setObjectName("checkBox") self.verticalLayout_4.addWidget(self.checkBox, 0, QtCore.Qt.AlignHCenter|QtCore.Qt.AlignTop) self.gridLayout_2.addLayout(self.verticalLayout_4, 1, 1, 1, 1) - self.gridLayout.addWidget(self.frame_3, 1, 1, 2, 1) + self.gridLayout.addWidget(self.frame_3, 1, 2, 2, 1) + self.verticalLayout_5 = QtWidgets.QVBoxLayout() + self.verticalLayout_5.setSizeConstraint(QtWidgets.QLayout.SetNoConstraint) + self.verticalLayout_5.setSpacing(2) + self.verticalLayout_5.setObjectName("verticalLayout_5") + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setContentsMargins(-1, 0, 0, -1) + self.horizontalLayout.setObjectName("horizontalLayout") + self.verticalLayout_6 = QtWidgets.QVBoxLayout() + self.verticalLayout_6.setContentsMargins(-1, 0, -1, -1) + self.verticalLayout_6.setObjectName("verticalLayout_6") + self.label_7 = QtWidgets.QLabel(Form) + self.label_7.setObjectName("label_7") + self.verticalLayout_6.addWidget(self.label_7) + self.spinBoxWSubSections = QtWidgets.QSpinBox(Form) + self.spinBoxWSubSections.setMaximum(5) + self.spinBoxWSubSections.setObjectName("spinBoxWSubSections") + self.verticalLayout_6.addWidget(self.spinBoxWSubSections) + spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.verticalLayout_6.addItem(spacerItem3) + self.horizontalLayout.addLayout(self.verticalLayout_6) + self.verticalLayout_7 = QtWidgets.QVBoxLayout() + self.verticalLayout_7.setObjectName("verticalLayout_7") + self.label_8 = QtWidgets.QLabel(Form) + self.label_8.setObjectName("label_8") + self.verticalLayout_7.addWidget(self.label_8) + spacerItem4 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.verticalLayout_7.addItem(spacerItem4) + self.horizontalLayout.addLayout(self.verticalLayout_7) + self.verticalLayout_5.addLayout(self.horizontalLayout) + self.tableWidgetWeights = QtWidgets.QTableWidget(Form) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.tableWidgetWeights.sizePolicy().hasHeightForWidth()) + self.tableWidgetWeights.setSizePolicy(sizePolicy) + self.tableWidgetWeights.setMinimumSize(QtCore.QSize(0, 70)) + self.tableWidgetWeights.setBaseSize(QtCore.QSize(0, 65)) + self.tableWidgetWeights.setObjectName("tableWidgetWeights") + self.tableWidgetWeights.setColumnCount(2) + self.tableWidgetWeights.setRowCount(0) + item = QtWidgets.QTableWidgetItem() + self.tableWidgetWeights.setHorizontalHeaderItem(0, item) + self.tableWidgetWeights.horizontalHeader().setDefaultSectionSize(80) + self.tableWidgetWeights.horizontalHeader().setStretchLastSection(True) + self.verticalLayout_5.addWidget(self.tableWidgetWeights) + spacerItem5 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.verticalLayout_5.addItem(spacerItem5) + spacerItem6 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.verticalLayout_5.addItem(spacerItem6) + spacerItem7 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.verticalLayout_5.addItem(spacerItem7) + self.gridLayout.addLayout(self.verticalLayout_5, 3, 2, 1, 2) self.frame = QtWidgets.QFrame(Form) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth()) @@ -102,12 +154,11 @@ def setupUi(self, Form): self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.verticalLayout = QtWidgets.QVBoxLayout() + self.verticalLayout.setSizeConstraint(QtWidgets.QLayout.SetMaximumSize) self.verticalLayout.setObjectName("verticalLayout") self.label = QtWidgets.QLabel(self.frame) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label, 0, QtCore.Qt.AlignLeft) - spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.verticalLayout.addItem(spacerItem2) self.label_6 = QtWidgets.QLabel(self.frame) self.label_6.setObjectName("label_6") self.verticalLayout.addWidget(self.label_6) @@ -115,13 +166,35 @@ def setupUi(self, Form): self.spinBoxAsymSubSections.setMaximum(5) self.spinBoxAsymSubSections.setObjectName("spinBoxAsymSubSections") self.verticalLayout.addWidget(self.spinBoxAsymSubSections) - spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.verticalLayout.addItem(spacerItem3) + self.tableWidgetAsym = QtWidgets.QTableWidget(self.frame) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.tableWidgetAsym.sizePolicy().hasHeightForWidth()) + self.tableWidgetAsym.setSizePolicy(sizePolicy) + self.tableWidgetAsym.setMinimumSize(QtCore.QSize(0, 12)) + self.tableWidgetAsym.setBaseSize(QtCore.QSize(0, 140)) + self.tableWidgetAsym.setFrameShadow(QtWidgets.QFrame.Plain) + self.tableWidgetAsym.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded) + self.tableWidgetAsym.setRowCount(0) + self.tableWidgetAsym.setObjectName("tableWidgetAsym") + self.tableWidgetAsym.setColumnCount(3) + item = QtWidgets.QTableWidgetItem() + self.tableWidgetAsym.setHorizontalHeaderItem(0, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidgetAsym.setHorizontalHeaderItem(1, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidgetAsym.setHorizontalHeaderItem(2, item) + self.tableWidgetAsym.horizontalHeader().setCascadingSectionResizes(True) + self.tableWidgetAsym.horizontalHeader().setDefaultSectionSize(80) + self.tableWidgetAsym.horizontalHeader().setHighlightSections(False) + self.tableWidgetAsym.horizontalHeader().setMinimumSectionSize(20) + self.tableWidgetAsym.horizontalHeader().setStretchLastSection(True) + self.verticalLayout.addWidget(self.tableWidgetAsym) + spacerItem8 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.verticalLayout.addItem(spacerItem8) self.horizontalLayout_2.addLayout(self.verticalLayout) - self.gridLayout.addWidget(self.frame, 1, 0, 1, 1) - self.label_5 = QtWidgets.QLabel(Form) - self.label_5.setObjectName("label_5") - self.gridLayout.addWidget(self.label_5, 0, 0, 1, 1) + self.gridLayout.addWidget(self.frame, 1, 1, 3, 1) self.frame_4 = QtWidgets.QFrame(Form) self.frame_4.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame_4.setFrameShadow(QtWidgets.QFrame.Plain) @@ -142,60 +215,27 @@ def setupUi(self, Form): self.spinBoxMaxIter.setProperty("value", 100) self.spinBoxMaxIter.setObjectName("spinBoxMaxIter") self.verticalLayout_9.addWidget(self.spinBoxMaxIter) - spacerItem4 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.verticalLayout_9.addItem(spacerItem4) + spacerItem9 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.verticalLayout_9.addItem(spacerItem9) self.label_10 = QtWidgets.QLabel(self.frame_4) self.label_10.setObjectName("label_10") self.verticalLayout_9.addWidget(self.label_10) self.verticalLayout_8.addLayout(self.verticalLayout_9) - spacerItem5 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.verticalLayout_8.addItem(spacerItem5) - self.gridLayout.addWidget(self.frame_4, 1, 3, 1, 1) - self.verticalLayout_5 = QtWidgets.QVBoxLayout() - self.verticalLayout_5.setSizeConstraint(QtWidgets.QLayout.SetNoConstraint) - self.verticalLayout_5.setObjectName("verticalLayout_5") - self.horizontalLayout = QtWidgets.QHBoxLayout() - self.horizontalLayout.setContentsMargins(-1, 0, 0, -1) - self.horizontalLayout.setObjectName("horizontalLayout") - self.verticalLayout_6 = QtWidgets.QVBoxLayout() - self.verticalLayout_6.setContentsMargins(-1, 0, -1, -1) - self.verticalLayout_6.setObjectName("verticalLayout_6") - self.label_7 = QtWidgets.QLabel(Form) - self.label_7.setObjectName("label_7") - self.verticalLayout_6.addWidget(self.label_7) - self.spinBoxWSubSections = QtWidgets.QSpinBox(Form) - self.spinBoxWSubSections.setMaximum(5) - self.spinBoxWSubSections.setObjectName("spinBoxWSubSections") - self.verticalLayout_6.addWidget(self.spinBoxWSubSections) - spacerItem6 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.verticalLayout_6.addItem(spacerItem6) - self.horizontalLayout.addLayout(self.verticalLayout_6) - self.verticalLayout_7 = QtWidgets.QVBoxLayout() - self.verticalLayout_7.setObjectName("verticalLayout_7") - self.label_8 = QtWidgets.QLabel(Form) - self.label_8.setObjectName("label_8") - self.verticalLayout_7.addWidget(self.label_8) - spacerItem7 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - self.verticalLayout_7.addItem(spacerItem7) - self.horizontalLayout.addLayout(self.verticalLayout_7) - self.verticalLayout_5.addLayout(self.horizontalLayout) - self.tableWidgetWeights = QtWidgets.QTableWidget(Form) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Maximum) + spacerItem10 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.verticalLayout_8.addItem(spacerItem10) + self.gridLayout.addWidget(self.frame_4, 1, 4, 1, 1) + self.frame_2 = QtWidgets.QFrame(Form) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.tableWidgetWeights.sizePolicy().hasHeightForWidth()) - self.tableWidgetWeights.setSizePolicy(sizePolicy) - self.tableWidgetWeights.setMinimumSize(QtCore.QSize(0, 70)) - self.tableWidgetWeights.setBaseSize(QtCore.QSize(0, 65)) - self.tableWidgetWeights.setObjectName("tableWidgetWeights") - self.tableWidgetWeights.setColumnCount(2) - self.tableWidgetWeights.setRowCount(0) - item = QtWidgets.QTableWidgetItem() - self.tableWidgetWeights.setHorizontalHeaderItem(0, item) - self.tableWidgetWeights.horizontalHeader().setDefaultSectionSize(80) - self.tableWidgetWeights.horizontalHeader().setStretchLastSection(True) - self.verticalLayout_5.addWidget(self.tableWidgetWeights) - self.gridLayout.addLayout(self.verticalLayout_5, 3, 1, 1, 2) + sizePolicy.setHeightForWidth(self.frame_2.sizePolicy().hasHeightForWidth()) + self.frame_2.setSizePolicy(sizePolicy) + self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised) + self.frame_2.setObjectName("frame_2") + self.gridLayout.addWidget(self.frame_2, 1, 0, 1, 1) + spacerItem11 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.gridLayout.addItem(spacerItem11, 4, 1, 1, 1) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form) @@ -203,23 +243,23 @@ def setupUi(self, Form): def retranslateUi(self, Form): _translate = QtCore.QCoreApplication.translate Form.setWindowTitle(_translate("Form", "Form")) + self.label_5.setText(_translate("Form", "Fixed=P")) + self.label_13.setText(_translate("Form", "

Wavenumber Increasing Left-to-Right

")) + self.checkBoxWNIncreasing.setToolTip(_translate("Form", "Conjugate if the frequency axis increases right-to-left.")) + self.label_3.setText(_translate("Form", "Sub-Sampling Factor")) + self.label_2.setText(_translate("Form", "Lambda (smoothness)")) + self.label_4.setText(_translate("Form", "Fix End-Points")) + self.label_7.setText(_translate("Form", "Weighted (Subsections)")) + self.label_8.setText(_translate("Form", "Weight Value")) + item = self.tableWidgetWeights.horizontalHeaderItem(0) + item.setText(_translate("Form", "Start X")) + self.label.setText(_translate("Form", "Define P (Asymmetry)")) + self.label_6.setText(_translate("Form", "P Subsections")) item = self.tableWidgetAsym.horizontalHeaderItem(0) item.setText(_translate("Form", "Start X")) item = self.tableWidgetAsym.horizontalHeaderItem(1) item.setText(_translate("Form", "End X")) item = self.tableWidgetAsym.horizontalHeaderItem(2) item.setText(_translate("Form", "P (Asymmetry) Value")) - self.label_3.setText(_translate("Form", "Sub-Sampling Factor")) - self.label_2.setText(_translate("Form", "Lambda (smoothness)")) - self.label_4.setText(_translate("Form", "Fix End-Points")) - self.label.setText(_translate("Form", "Define P (Asymmetry)")) - self.label_6.setText(_translate("Form", "P Subsections")) - self.label_5.setText(_translate("Form", "Fixed=P")) self.label_9.setText(_translate("Form", "Max Iterations")) self.label_10.setText(_translate("Form", "Min Difference")) - self.label_7.setText(_translate("Form", "Weighted (Subsections)")) - self.label_8.setText(_translate("Form", "Weight Value")) - item = self.tableWidgetWeights.horizontalHeaderItem(0) - item.setText(_translate("Form", "Start X")) - - diff --git a/crikit/ui/widget_ALS.py b/crikit/ui/widget_ALS.py index 4696973..a3231f3 100644 --- a/crikit/ui/widget_ALS.py +++ b/crikit/ui/widget_ALS.py @@ -28,6 +28,10 @@ class widgetALS(_AbstractPlotEffectPlugin): Parameters ---------- + wavenumber_increasing : bool, optional (default, True) + If wavenumber is increasing left-to-right. Opposite value as the KK + conjugate value + smoothness_param : float, optional (default, 1e3) Smoothness parameter @@ -81,7 +85,8 @@ class widgetALS(_AbstractPlotEffectPlugin): 'title' : 'Detrended' } - def __init__(self, x=None, rng=None, smoothness_param=1, asym_param=1e-3, redux=10, + def __init__(self, x=None, wavenumber_increasing=True, + rng=None, smoothness_param=1, asym_param=1e-3, redux=10, order=2, fix_end_points=True, fix_const=1, fix_rng=None, max_iter=100, min_diff=1e-6, verbose=False, sub_asym_list=None, sub_w_list=None, parent = None): @@ -117,6 +122,7 @@ def __init__(self, x=None, rng=None, smoothness_param=1, asym_param=1e-3, redux= self.parameters['max_iter'] = max_iter self.parameters['min_diff'] = min_diff self.parameters['verbose'] = verbose + self.parameters['wavenumber_increasing'] = wavenumber_increasing self.setup_asym() # Setup controls for asymmetry parameter self.setup_smoothness() # Setup controls for smoothness parameter @@ -135,6 +141,8 @@ def __init__(self, x=None, rng=None, smoothness_param=1, asym_param=1e-3, redux= self.ui.verticalLayout_9.insertWidget(4, self.ui.spinBoxMinDiff) self.ui.spinBoxMinDiff.setValue(self.parameters['min_diff']) + self.ui.checkBoxWNIncreasing.setChecked(self.parameters['wavenumber_increasing']) + # SIGNALS & SLOTS self.ui.spinBoxP.editingFinished.connect(self.spinBoxChanged) self.ui.spinBoxLambda.editingFinished.connect(self.spinBoxChanged) @@ -148,6 +156,8 @@ def __init__(self, x=None, rng=None, smoothness_param=1, asym_param=1e-3, redux= self.ui.spinBoxAsymSubSections.valueChanged.connect(self.asym_sub_val_change) self.ui.spinBoxWSubSections.valueChanged.connect(self.weight_sub_val_change) + self.ui.checkBoxWNIncreasing.clicked.connect(self.selectWNIncrease) + self.ui.spinBoxWeight = _SciSpin() self.ui.spinBoxWeight.setMinimum(0) self.ui.spinBoxWeight.setMaximum(1e10) @@ -407,6 +417,14 @@ def selectFixedEnds(self): self.parameters['fix_end_points'] =self.ui.checkBox.isChecked() self.changed.emit() + def selectWNIncrease(self): + """ + Check selection of conjugate + """ + + self.parameters['wavenumber_increasing'] = self.ui.checkBoxWNIncreasing.isChecked() + self.changed.emit() + if __name__ == '__main__': import sys as _sys