diff --git a/IvS_repo_3.6.yml b/IvS_repo_3.6.yml index fb00adbb1..6672dae59 100644 --- a/IvS_repo_3.6.yml +++ b/IvS_repo_3.6.yml @@ -14,3 +14,4 @@ dependencies: - h5py=2.8.0 - ephem=3.7.6.0 - lxml=3.8.0 +- pandas=0.20 diff --git a/gui/gui.py b/gui/gui.py new file mode 100644 index 000000000..2f091c113 --- /dev/null +++ b/gui/gui.py @@ -0,0 +1,790 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'gui.ui' +# +# Created by: PyQt5 UI code generator 5.6 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + MainWindow.setObjectName("MainWindow") + MainWindow.resize(1257, 842) + MainWindow.setIconSize(QtCore.QSize(22, 22)) + self.MainWindowFrame = QtWidgets.QWidget(MainWindow) + self.MainWindowFrame.setAutoFillBackground(False) + self.MainWindowFrame.setObjectName("MainWindowFrame") + self.horizontalLayout = QtWidgets.QHBoxLayout(self.MainWindowFrame) + self.horizontalLayout.setObjectName("horizontalLayout") + self.SelectedData = QtWidgets.QTabWidget(self.MainWindowFrame) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.SelectedData.sizePolicy().hasHeightForWidth()) + self.SelectedData.setSizePolicy(sizePolicy) + self.SelectedData.setMinimumSize(QtCore.QSize(300, 0)) + self.SelectedData.setObjectName("SelectedData") + self.SelectedDataFrame = QtWidgets.QWidget() + self.SelectedDataFrame.setObjectName("SelectedDataFrame") + self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.SelectedDataFrame) + self.verticalLayout_3.setContentsMargins(0, 0, 0, 0) + self.verticalLayout_3.setObjectName("verticalLayout_3") + spacerItem = QtWidgets.QSpacerItem(20, 3, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) + self.verticalLayout_3.addItem(spacerItem) + self.label = QtWidgets.QLabel(self.SelectedDataFrame) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth()) + self.label.setSizePolicy(sizePolicy) + self.label.setObjectName("label") + self.verticalLayout_3.addWidget(self.label) + self.label_2 = QtWidgets.QLabel(self.SelectedDataFrame) + self.label_2.setObjectName("label_2") + self.verticalLayout_3.addWidget(self.label_2) + self.Selectedpushbutton = QtWidgets.QPushButton(self.SelectedDataFrame) + palette = QtGui.QPalette() + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) + brush = QtGui.QBrush(QtGui.QColor(247, 170, 171)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) + brush = QtGui.QBrush(QtGui.QColor(251, 212, 213)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) + brush = QtGui.QBrush(QtGui.QColor(123, 85, 85)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush) + brush = QtGui.QBrush(QtGui.QColor(165, 113, 114)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(247, 170, 171)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush) + brush = QtGui.QBrush(QtGui.QColor(251, 212, 213)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) + brush = QtGui.QBrush(QtGui.QColor(247, 170, 171)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) + brush = QtGui.QBrush(QtGui.QColor(251, 212, 213)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) + brush = QtGui.QBrush(QtGui.QColor(123, 85, 85)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush) + brush = QtGui.QBrush(QtGui.QColor(165, 113, 114)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(247, 170, 171)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush) + brush = QtGui.QBrush(QtGui.QColor(251, 212, 213)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush) + brush = QtGui.QBrush(QtGui.QColor(123, 85, 85)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) + brush = QtGui.QBrush(QtGui.QColor(247, 170, 171)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) + brush = QtGui.QBrush(QtGui.QColor(251, 212, 213)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) + brush = QtGui.QBrush(QtGui.QColor(123, 85, 85)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush) + brush = QtGui.QBrush(QtGui.QColor(165, 113, 114)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush) + brush = QtGui.QBrush(QtGui.QColor(123, 85, 85)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) + brush = QtGui.QBrush(QtGui.QColor(123, 85, 85)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) + brush = QtGui.QBrush(QtGui.QColor(247, 170, 171)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(247, 170, 171)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) + brush = QtGui.QBrush(QtGui.QColor(247, 170, 171)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) + self.Selectedpushbutton.setPalette(palette) + self.Selectedpushbutton.setObjectName("Selectedpushbutton") + self.verticalLayout_3.addWidget(self.Selectedpushbutton) + spacerItem1 = QtWidgets.QSpacerItem(20, 5, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) + self.verticalLayout_3.addItem(spacerItem1) + self.SelectedDataTable = QtWidgets.QTableView(self.SelectedDataFrame) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.SelectedDataTable.sizePolicy().hasHeightForWidth()) + self.SelectedDataTable.setSizePolicy(sizePolicy) + self.SelectedDataTable.setFocusPolicy(QtCore.Qt.NoFocus) + self.SelectedDataTable.setFrameShape(QtWidgets.QFrame.NoFrame) + self.SelectedDataTable.setFrameShadow(QtWidgets.QFrame.Plain) + self.SelectedDataTable.setLineWidth(0) + self.SelectedDataTable.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents) + self.SelectedDataTable.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) + self.SelectedDataTable.setAlternatingRowColors(True) + self.SelectedDataTable.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection) + self.SelectedDataTable.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectItems) + self.SelectedDataTable.setObjectName("SelectedDataTable") + self.SelectedDataTable.horizontalHeader().setCascadingSectionResizes(False) + self.SelectedDataTable.horizontalHeader().setDefaultSectionSize(100) + self.SelectedDataTable.horizontalHeader().setMinimumSectionSize(1) + self.SelectedDataTable.horizontalHeader().setSortIndicatorShown(False) + self.SelectedDataTable.horizontalHeader().setStretchLastSection(True) + self.SelectedDataTable.verticalHeader().setVisible(False) + self.SelectedDataTable.verticalHeader().setHighlightSections(False) + self.SelectedDataTable.verticalHeader().setSortIndicatorShown(False) + self.verticalLayout_3.addWidget(self.SelectedDataTable) + self.SelectedData.addTab(self.SelectedDataFrame, "") + self.horizontalLayout.addWidget(self.SelectedData) + self.GuiTabs = QtWidgets.QTabWidget(self.MainWindowFrame) + self.GuiTabs.setObjectName("GuiTabs") + self.FilterData = QtWidgets.QWidget() + self.FilterData.setObjectName("FilterData") + self.verticalLayout = QtWidgets.QVBoxLayout(self.FilterData) + self.verticalLayout.setContentsMargins(0, 0, 0, 0) + self.verticalLayout.setObjectName("verticalLayout") + self.SearchBox = QtWidgets.QFrame(self.FilterData) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.SearchBox.sizePolicy().hasHeightForWidth()) + self.SearchBox.setSizePolicy(sizePolicy) + self.SearchBox.setFrameShape(QtWidgets.QFrame.NoFrame) + self.SearchBox.setFrameShadow(QtWidgets.QFrame.Raised) + self.SearchBox.setLineWidth(0) + self.SearchBox.setObjectName("SearchBox") + self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.SearchBox) + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout_2.addItem(spacerItem2) + self.ObjLabel = QtWidgets.QLabel(self.SearchBox) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.ObjLabel.sizePolicy().hasHeightForWidth()) + self.ObjLabel.setSizePolicy(sizePolicy) + self.ObjLabel.setLayoutDirection(QtCore.Qt.LeftToRight) + self.ObjLabel.setObjectName("ObjLabel") + self.horizontalLayout_2.addWidget(self.ObjLabel) + self.ObjLineEdit = QtWidgets.QLineEdit(self.SearchBox) + self.ObjLineEdit.setClearButtonEnabled(True) + self.ObjLineEdit.setObjectName("ObjLineEdit") + self.horizontalLayout_2.addWidget(self.ObjLineEdit) + self.ObserverLabel = QtWidgets.QLabel(self.SearchBox) + self.ObserverLabel.setObjectName("ObserverLabel") + self.horizontalLayout_2.addWidget(self.ObserverLabel) + self.ObserverLineEdit = QtWidgets.QLineEdit(self.SearchBox) + self.ObserverLineEdit.setClearButtonEnabled(True) + self.ObserverLineEdit.setObjectName("ObserverLineEdit") + self.horizontalLayout_2.addWidget(self.ObserverLineEdit) + self.ProgLabel = QtWidgets.QLabel(self.SearchBox) + self.ProgLabel.setObjectName("ProgLabel") + self.horizontalLayout_2.addWidget(self.ProgLabel) + self.ProgSpinBox = QtWidgets.QSpinBox(self.SearchBox) + self.ProgSpinBox.setAcceptDrops(False) + self.ProgSpinBox.setInputMethodHints(QtCore.Qt.ImhDigitsOnly) + self.ProgSpinBox.setWrapping(False) + self.ProgSpinBox.setFrame(True) + self.ProgSpinBox.setButtonSymbols(QtWidgets.QAbstractSpinBox.UpDownArrows) + self.ProgSpinBox.setCorrectionMode(QtWidgets.QAbstractSpinBox.CorrectToNearestValue) + self.ProgSpinBox.setMinimum(0) + self.ProgSpinBox.setMaximum(200) + self.ProgSpinBox.setProperty("value", 0) + self.ProgSpinBox.setObjectName("ProgSpinBox") + self.horizontalLayout_2.addWidget(self.ProgSpinBox) + spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout_2.addItem(spacerItem3) + self.SearchPushButton = QtWidgets.QPushButton(self.SearchBox) + palette = QtGui.QPalette() + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) + brush = QtGui.QBrush(QtGui.QColor(157, 218, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) + brush = QtGui.QBrush(QtGui.QColor(206, 236, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) + brush = QtGui.QBrush(QtGui.QColor(78, 109, 127)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush) + brush = QtGui.QBrush(QtGui.QColor(105, 145, 170)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(157, 218, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush) + brush = QtGui.QBrush(QtGui.QColor(206, 236, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) + brush = QtGui.QBrush(QtGui.QColor(157, 218, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) + brush = QtGui.QBrush(QtGui.QColor(206, 236, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) + brush = QtGui.QBrush(QtGui.QColor(78, 109, 127)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush) + brush = QtGui.QBrush(QtGui.QColor(105, 145, 170)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(157, 218, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush) + brush = QtGui.QBrush(QtGui.QColor(206, 236, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush) + brush = QtGui.QBrush(QtGui.QColor(78, 109, 127)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) + brush = QtGui.QBrush(QtGui.QColor(157, 218, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) + brush = QtGui.QBrush(QtGui.QColor(206, 236, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) + brush = QtGui.QBrush(QtGui.QColor(78, 109, 127)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush) + brush = QtGui.QBrush(QtGui.QColor(105, 145, 170)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush) + brush = QtGui.QBrush(QtGui.QColor(78, 109, 127)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) + brush = QtGui.QBrush(QtGui.QColor(78, 109, 127)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) + brush = QtGui.QBrush(QtGui.QColor(157, 218, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(157, 218, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) + brush = QtGui.QBrush(QtGui.QColor(157, 218, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) + self.SearchPushButton.setPalette(palette) + self.SearchPushButton.setObjectName("SearchPushButton") + self.horizontalLayout_2.addWidget(self.SearchPushButton) + spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout_2.addItem(spacerItem4) + self.verticalLayout.addWidget(self.SearchBox) + self.FilterAddButton = QtWidgets.QPushButton(self.FilterData) + palette = QtGui.QPalette() + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 208)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) + brush = QtGui.QBrush(QtGui.QColor(226, 255, 231)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) + brush = QtGui.QBrush(QtGui.QColor(99, 127, 104)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush) + brush = QtGui.QBrush(QtGui.QColor(132, 170, 139)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 208)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush) + brush = QtGui.QBrush(QtGui.QColor(226, 255, 231)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 208)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) + brush = QtGui.QBrush(QtGui.QColor(226, 255, 231)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) + brush = QtGui.QBrush(QtGui.QColor(99, 127, 104)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush) + brush = QtGui.QBrush(QtGui.QColor(132, 170, 139)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 208)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush) + brush = QtGui.QBrush(QtGui.QColor(226, 255, 231)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush) + brush = QtGui.QBrush(QtGui.QColor(99, 127, 104)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 208)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) + brush = QtGui.QBrush(QtGui.QColor(226, 255, 231)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) + brush = QtGui.QBrush(QtGui.QColor(99, 127, 104)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush) + brush = QtGui.QBrush(QtGui.QColor(132, 170, 139)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush) + brush = QtGui.QBrush(QtGui.QColor(99, 127, 104)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) + brush = QtGui.QBrush(QtGui.QColor(99, 127, 104)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 208)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 208)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 208)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) + self.FilterAddButton.setPalette(palette) + self.FilterAddButton.setAutoFillBackground(False) + self.FilterAddButton.setFlat(False) + self.FilterAddButton.setObjectName("FilterAddButton") + self.verticalLayout.addWidget(self.FilterAddButton) + spacerItem5 = QtWidgets.QSpacerItem(20, 5, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) + self.verticalLayout.addItem(spacerItem5) + self.FiltertableView = QtWidgets.QTableView(self.FilterData) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.FiltertableView.sizePolicy().hasHeightForWidth()) + self.FiltertableView.setSizePolicy(sizePolicy) + self.FiltertableView.setFocusPolicy(QtCore.Qt.NoFocus) + self.FiltertableView.setAcceptDrops(False) + self.FiltertableView.setFrameShape(QtWidgets.QFrame.StyledPanel) + self.FiltertableView.setFrameShadow(QtWidgets.QFrame.Sunken) + self.FiltertableView.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustIgnored) + self.FiltertableView.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) + self.FiltertableView.setAlternatingRowColors(True) + self.FiltertableView.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection) + self.FiltertableView.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) + self.FiltertableView.setSortingEnabled(True) + self.FiltertableView.setObjectName("FiltertableView") + self.FiltertableView.horizontalHeader().setCascadingSectionResizes(False) + self.FiltertableView.horizontalHeader().setSortIndicatorShown(True) + self.FiltertableView.horizontalHeader().setStretchLastSection(True) + self.FiltertableView.verticalHeader().setVisible(False) + self.FiltertableView.verticalHeader().setHighlightSections(False) + self.FiltertableView.verticalHeader().setSortIndicatorShown(False) + self.verticalLayout.addWidget(self.FiltertableView) + self.GuiTabs.addTab(self.FilterData, "") + self.PlotSpectra = QtWidgets.QWidget() + self.PlotSpectra.setObjectName("PlotSpectra") + self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.PlotSpectra) + self.verticalLayout_2.setContentsMargins(0, 0, 0, 0) + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.PlotButton = QtWidgets.QPushButton(self.PlotSpectra) + palette = QtGui.QPalette() + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 208)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) + brush = QtGui.QBrush(QtGui.QColor(226, 255, 231)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) + brush = QtGui.QBrush(QtGui.QColor(99, 127, 104)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush) + brush = QtGui.QBrush(QtGui.QColor(132, 170, 139)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 208)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush) + brush = QtGui.QBrush(QtGui.QColor(226, 255, 231)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 208)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) + brush = QtGui.QBrush(QtGui.QColor(226, 255, 231)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) + brush = QtGui.QBrush(QtGui.QColor(99, 127, 104)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush) + brush = QtGui.QBrush(QtGui.QColor(132, 170, 139)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 208)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush) + brush = QtGui.QBrush(QtGui.QColor(226, 255, 231)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush) + brush = QtGui.QBrush(QtGui.QColor(99, 127, 104)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 208)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) + brush = QtGui.QBrush(QtGui.QColor(226, 255, 231)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) + brush = QtGui.QBrush(QtGui.QColor(99, 127, 104)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush) + brush = QtGui.QBrush(QtGui.QColor(132, 170, 139)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush) + brush = QtGui.QBrush(QtGui.QColor(99, 127, 104)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) + brush = QtGui.QBrush(QtGui.QColor(99, 127, 104)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 208)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 208)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) + brush = QtGui.QBrush(QtGui.QColor(198, 255, 208)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush) + brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush) + brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) + brush.setStyle(QtCore.Qt.SolidPattern) + palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) + self.PlotButton.setPalette(palette) + self.PlotButton.setObjectName("PlotButton") + self.verticalLayout_2.addWidget(self.PlotButton) + self.matplotlib = QtWidgets.QWidget(self.PlotSpectra) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.MinimumExpanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.matplotlib.sizePolicy().hasHeightForWidth()) + self.matplotlib.setSizePolicy(sizePolicy) + self.matplotlib.setAutoFillBackground(False) + self.matplotlib.setObjectName("matplotlib") + self.mpl_layout = QtWidgets.QVBoxLayout(self.matplotlib) + self.mpl_layout.setContentsMargins(0, 0, 0, 0) + self.mpl_layout.setObjectName("mpl_layout") + self.verticalLayout_2.addWidget(self.matplotlib) + self.GuiTabs.addTab(self.PlotSpectra, "") + self.horizontalLayout.addWidget(self.GuiTabs) + MainWindow.setCentralWidget(self.MainWindowFrame) + self.menuBar = QtWidgets.QMenuBar(MainWindow) + self.menuBar.setGeometry(QtCore.QRect(0, 0, 1257, 29)) + self.menuBar.setObjectName("menuBar") + self.menuFile = QtWidgets.QMenu(self.menuBar) + self.menuFile.setObjectName("menuFile") + MainWindow.setMenuBar(self.menuBar) + self.statusBar = QtWidgets.QStatusBar(MainWindow) + self.statusBar.setObjectName("statusBar") + MainWindow.setStatusBar(self.statusBar) + self.actionExit = QtWidgets.QAction(MainWindow) + self.actionExit.setMenuRole(QtWidgets.QAction.TextHeuristicRole) + self.actionExit.setObjectName("actionExit") + self.actionLoad_Data = QtWidgets.QAction(MainWindow) + self.actionLoad_Data.setObjectName("actionLoad_Data") + self.actionExit_2 = QtWidgets.QAction(MainWindow) + self.actionExit_2.setObjectName("actionExit_2") + self.menuFile.addAction(self.actionExit_2) + self.menuBar.addAction(self.menuFile.menuAction()) + + self.retranslateUi(MainWindow) + self.SelectedData.setCurrentIndex(0) + self.GuiTabs.setCurrentIndex(0) + QtCore.QMetaObject.connectSlotsByName(MainWindow) + + def retranslateUi(self, MainWindow): + _translate = QtCore.QCoreApplication.translate + MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow")) + self.label.setText(_translate("MainWindow", "

Highlighted files can also be removed

")) + self.label_2.setText(_translate("MainWindow", "

using DELETE key.

")) + self.Selectedpushbutton.setText(_translate("MainWindow", "Remove highlighted files")) + self.SelectedData.setTabText(self.SelectedData.indexOf(self.SelectedDataFrame), _translate("MainWindow", "Selected Data")) + self.ObjLabel.setText(_translate("MainWindow", "Object")) + self.ObserverLabel.setText(_translate("MainWindow", "Observer")) + self.ProgLabel.setText(_translate("MainWindow", "Prog ID")) + self.ProgSpinBox.setSpecialValueText(_translate("MainWindow", "None")) + self.SearchPushButton.setText(_translate("MainWindow", "Search")) + self.FilterAddButton.setText(_translate("MainWindow", " Add highlighted choices to the sidebar")) + self.GuiTabs.setTabText(self.GuiTabs.indexOf(self.FilterData), _translate("MainWindow", "Filter Data")) + self.PlotButton.setText(_translate("MainWindow", "Plot")) + self.GuiTabs.setTabText(self.GuiTabs.indexOf(self.PlotSpectra), _translate("MainWindow", "View Spectra")) + self.menuFile.setTitle(_translate("MainWindow", "F&ile")) + self.actionExit.setText(_translate("MainWindow", "&Exit")) + self.actionLoad_Data.setText(_translate("MainWindow", "&Load Data")) + self.actionExit_2.setText(_translate("MainWindow", "&Exit")) + diff --git a/gui/gui.ui b/gui/gui.ui new file mode 100644 index 000000000..c9c65384f --- /dev/null +++ b/gui/gui.ui @@ -0,0 +1,2151 @@ + + + MainWindow + + + + 0 + 0 + 1257 + 842 + + + + MainWindow + + + + 22 + 22 + + + + + false + + + + + + + 0 + 0 + + + + + 300 + 0 + + + + 0 + + + + Selected Data + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 3 + + + + + + + + + 0 + 0 + + + + <html><head/><body><p align="center">Highlighted files can also be removed</p></body></html> + + + + + + + <html><head/><body><p align="center">using DELETE key.</p></body></html> + + + + + + + + + + + + 0 + 0 + 0 + + + + + + + 247 + 170 + 171 + + + + + + + 255 + 255 + 255 + + + + + + + 251 + 212 + 213 + + + + + + + 123 + 85 + 85 + + + + + + + 165 + 113 + 114 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 247 + 170 + 171 + + + + + + + 0 + 0 + 0 + + + + + + + 251 + 212 + 213 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + 247 + 170 + 171 + + + + + + + 255 + 255 + 255 + + + + + + + 251 + 212 + 213 + + + + + + + 123 + 85 + 85 + + + + + + + 165 + 113 + 114 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 247 + 170 + 171 + + + + + + + 0 + 0 + 0 + + + + + + + 251 + 212 + 213 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 123 + 85 + 85 + + + + + + + 247 + 170 + 171 + + + + + + + 255 + 255 + 255 + + + + + + + 251 + 212 + 213 + + + + + + + 123 + 85 + 85 + + + + + + + 165 + 113 + 114 + + + + + + + 123 + 85 + 85 + + + + + + + 255 + 255 + 255 + + + + + + + 123 + 85 + 85 + + + + + + + 247 + 170 + 171 + + + + + + + 247 + 170 + 171 + + + + + + + 0 + 0 + 0 + + + + + + + 247 + 170 + 171 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + Remove highlighted files + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 5 + + + + + + + + + 0 + 0 + + + + Qt::NoFocus + + + QFrame::NoFrame + + + QFrame::Plain + + + 0 + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::ExtendedSelection + + + QAbstractItemView::SelectItems + + + false + + + 100 + + + 1 + + + false + + + true + + + false + + + false + + + false + + + + + + + + + + + 0 + + + + Filter Data + + + + + + + 0 + 0 + + + + QFrame::NoFrame + + + QFrame::Raised + + + 0 + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Qt::LeftToRight + + + Object + + + + + + + true + + + + + + + Observer + + + + + + + true + + + + + + + Prog ID + + + + + + + false + + + Qt::ImhDigitsOnly + + + false + + + true + + + QAbstractSpinBox::UpDownArrows + + + None + + + QAbstractSpinBox::CorrectToNearestValue + + + 0 + + + 200 + + + 0 + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + + + + + + 0 + 0 + 0 + + + + + + + 157 + 218 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 206 + 236 + 255 + + + + + + + 78 + 109 + 127 + + + + + + + 105 + 145 + 170 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 157 + 218 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 206 + 236 + 255 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + 157 + 218 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 206 + 236 + 255 + + + + + + + 78 + 109 + 127 + + + + + + + 105 + 145 + 170 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 157 + 218 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 206 + 236 + 255 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 78 + 109 + 127 + + + + + + + 157 + 218 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 206 + 236 + 255 + + + + + + + 78 + 109 + 127 + + + + + + + 105 + 145 + 170 + + + + + + + 78 + 109 + 127 + + + + + + + 255 + 255 + 255 + + + + + + + 78 + 109 + 127 + + + + + + + 157 + 218 + 255 + + + + + + + 157 + 218 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 157 + 218 + 255 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + Search + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + 0 + 0 + 0 + + + + + + + 198 + 255 + 208 + + + + + + + 255 + 255 + 255 + + + + + + + 226 + 255 + 231 + + + + + + + 99 + 127 + 104 + + + + + + + 132 + 170 + 139 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 198 + 255 + 208 + + + + + + + 0 + 0 + 0 + + + + + + + 226 + 255 + 231 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + 198 + 255 + 208 + + + + + + + 255 + 255 + 255 + + + + + + + 226 + 255 + 231 + + + + + + + 99 + 127 + 104 + + + + + + + 132 + 170 + 139 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 198 + 255 + 208 + + + + + + + 0 + 0 + 0 + + + + + + + 226 + 255 + 231 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 99 + 127 + 104 + + + + + + + 198 + 255 + 208 + + + + + + + 255 + 255 + 255 + + + + + + + 226 + 255 + 231 + + + + + + + 99 + 127 + 104 + + + + + + + 132 + 170 + 139 + + + + + + + 99 + 127 + 104 + + + + + + + 255 + 255 + 255 + + + + + + + 99 + 127 + 104 + + + + + + + 198 + 255 + 208 + + + + + + + 198 + 255 + 208 + + + + + + + 0 + 0 + 0 + + + + + + + 198 + 255 + 208 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + false + + + Add highlighted choices to the sidebar + + + false + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 5 + + + + + + + + + 0 + 0 + + + + Qt::NoFocus + + + false + + + QFrame::StyledPanel + + + QFrame::Sunken + + + QAbstractScrollArea::AdjustIgnored + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::ExtendedSelection + + + QAbstractItemView::SelectRows + + + true + + + false + + + true + + + true + + + false + + + false + + + false + + + + + + + + View Spectra + + + + + + + + + + + 0 + 0 + 0 + + + + + + + 198 + 255 + 208 + + + + + + + 255 + 255 + 255 + + + + + + + 226 + 255 + 231 + + + + + + + 99 + 127 + 104 + + + + + + + 132 + 170 + 139 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 198 + 255 + 208 + + + + + + + 0 + 0 + 0 + + + + + + + 226 + 255 + 231 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + 198 + 255 + 208 + + + + + + + 255 + 255 + 255 + + + + + + + 226 + 255 + 231 + + + + + + + 99 + 127 + 104 + + + + + + + 132 + 170 + 139 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 198 + 255 + 208 + + + + + + + 0 + 0 + 0 + + + + + + + 226 + 255 + 231 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 99 + 127 + 104 + + + + + + + 198 + 255 + 208 + + + + + + + 255 + 255 + 255 + + + + + + + 226 + 255 + 231 + + + + + + + 99 + 127 + 104 + + + + + + + 132 + 170 + 139 + + + + + + + 99 + 127 + 104 + + + + + + + 255 + 255 + 255 + + + + + + + 99 + 127 + 104 + + + + + + + 198 + 255 + 208 + + + + + + + 198 + 255 + 208 + + + + + + + 0 + 0 + 0 + + + + + + + 198 + 255 + 208 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + Plot + + + + + + + + 0 + 0 + + + + false + + + + + + + + + + + + + + 0 + 0 + 1257 + 29 + + + + + F&ile + + + + + + + + + &Exit + + + QAction::TextHeuristicRole + + + + + &Load Data + + + + + &Exit + + + + + + diff --git a/gui/main.py b/gui/main.py new file mode 100644 index 000000000..4df144e6e --- /dev/null +++ b/gui/main.py @@ -0,0 +1,188 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- + +import sys +# import numpy as np +import pandas as pd + +from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas +from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar +from matplotlib.figure import Figure +from PyQt5.QtWidgets import QApplication, QMainWindow +from PyQt5 import QtCore +from ivs.gui.gui import Ui_MainWindow +from ivs.inout.fits import read_spectrum +from ivs.gui.models import PandasModel, SelectionModel + + +class MainWindow(QMainWindow, Ui_MainWindow): + """ + Main GUI window: used to interactively view HERMES spectra. + + Command line usage: $ python main.py + + Current functionality: + - Use filter tab to select HERMES spectra + - Use plot tab to display matplotlib plot of highlighted spectra + + TODO: + - I/O functions for subselection + - Implement more filter functions for overview table (RA,DEC,TIME) + - Add FITS header/stellar/etc info into new panel below MPL canvas + - Integrate with SIMBAD (for search, expanded stellar info, etc) + - Integrate fitting/science functions into GUI + (i.e. interactive lambda selection for profile fitting, etc) + """ + def __init__(self, parent=None): + # Initialise the Main window + QMainWindow.__init__(self, parent=parent) + self.ui = Ui_MainWindow() + self.ui.setupUi(self) + + self.selected_data = [] + + # Load HERMES overview TSV file + self.load_overview(obs_only=True) + # Initialise Filter/Data overview + self.filtertab(self.overview) + # Initialise MPL figure and toolbar + self.add_mpl() + + # Connect Main window buttons to relevant functions + self.ui.FilterAddButton.clicked.connect(lambda: self.filter_add()) + self.ui.PlotButton.clicked.connect(lambda: self.update_plot()) + self.ui.SearchPushButton.clicked.connect(lambda: self.Objectfilter()) + self.ui.Selectedpushbutton.clicked.connect(lambda: self.Remove_selected()) + + def keyPressEvent(self, event): + + # Delete key used to remove highlighted spectra from selected sidebar + if event.key() == QtCore.Qt.Key_Delete: + self.Remove_selected() + + def Remove_selected(self): + # Get highlighted rows + idx = self.ui.SelectedDataTable.selectionModel().selectedRows() + + # Retrieve filename corresponding to highlighted rows + # ( TODO probably a nicer way to do this?) + filenames = [] + for idxxx in idx: + filenames.append(self.selectionmodel.data( + self.selectionmodel.index(idxxx.row(), 0))) + + # Iterate over highlighted files, remove rom selection list + for filename in filenames: + if len(self.selected_data): + if filename in self.selected_data: + self.selected_data.remove(filename) + continue + + # Regenerate selection model and tableview + self.selectionmodel = SelectionModel(self.selected_data) + self.ui.SelectedDataTable.setModel(self.selectionmodel) + + def load_overview(self, obs_only): + + # Load hermes tsv overview into pandas frame + self.overview = pd.read_csv('/STER/mercator/hermes/HermesFullDataOverview.tsv', + sep='\t', skiprows=2, header=None, + names=['unseq', 'prog_id', 'obsmode', 'bvcor', + 'observer', 'object', 'ra', 'dec', + 'bjd', 'exptime', 'pmtotal', 'date-avg', + 'airmass', 'filename']) + + # obsmode = HRF_OBJ + if obs_only: + self.overview = self.overview[self.overview['obsmode'] == 'HRF_OBJ'] + + def add_mpl(self): + # Initial MPL figure and toolbar + self.fig = Figure() + self.ax = self.fig.add_subplot(111) + self.canvas = FigureCanvas(self.fig) + self.toolbar = NavigationToolbar(self.canvas, self.ui.matplotlib, + coordinates=True) + # Add MPL canvas and toolbar to Main window + self.ui.mpl_layout.addWidget(self.toolbar) + self.ui.mpl_layout.addWidget(self.canvas) + self.canvas.draw() + + def update_plot(self): + + try: + # Retrieve first highlighted row from tableview + idx = self.ui.SelectedDataTable.selectionModel().selectedRows()[0] + self.fig.clf() + self.ax = self.fig.add_subplot(111) + filename = self.selectionmodel.data( + self.selectionmodel.index(idx.row(), 0)) + # Defaulting to 'log_merged_c' due to incomplete '_cf' + if 'raw' in filename: + extname = 'HRF_OBJ_ext_CosmicsRemoved_log_merged_c' + filename = filename.replace('raw', 'reduced') + filename = filename.replace('HRF_OBJ', extname) + # Load wav and flux of corresponding spectrum + wav, flux = read_spectrum(filename) + + # Refresh and replot figure + self.ax = self.fig.add_subplot(111) + self.ax.plot(wav, flux) + self.ax.set_title(filename) + self.canvas.draw() + except(AttributeError, IndexError): + pass + except(FileNotFoundError): + error_text = 'FileNotFoundError: \"' + filename + '\" not found...' + self.ui.statusBar.showMessage(error_text, 3000) + + def filtertab(self, input): + # Initialise overview table from pandas dataframe, and show the dialog + self.model = PandasModel(input) + self.ui.FiltertableView.setModel(self.model) + + def filter_add(self): + idx = self.ui.FiltertableView.selectionModel().selectedRows() + skiptotal = 0 + for idxxx in idx: + filename = self.model.data(self.model.index(idxxx.row(), 13)) + + if len(self.selected_data): + if filename in self.selected_data: + skiptotal += 1 + continue + self.selected_data.append(filename) + if len(self.selected_data): + self.selectionmodel = SelectionModel(self.selected_data) + self.ui.SelectedDataTable.setModel(self.selectionmodel) + + if skiptotal: + if skiptotal == len(idx): + statustext = str(skiptotal) + ' spectra already added...' + else: + statustext = (str(skiptotal) + ' spectra already added. ' + + str(len(idx)-skiptotal) + + ' new spectra added...') + elif len(idx): + statustext = str(len(idx))+' spectra addded...' + else: + statustext = '' + self.ui.statusBar.showMessage(statustext, 3000) + + def Objectfilter(self): + newdata = self.overview + if len(self.ui.ObjLineEdit.text()): + newdata = newdata[newdata['object'].str.contains( + self.ui.ObjLineEdit.text(), na=False, case=False)] + if len(self.ui.ObserverLineEdit.text()): + newdata = newdata[newdata['observer'].str.contains( + self.ui.ObserverLineEdit.text(), na=False, case=False)] + if self.ui.ProgSpinBox.value(): + newdata = newdata[newdata['prog_id'] == self.ui.ProgSpinBox.value()] + self.filtertab(newdata) + +if __name__ == "__main__": + app = QApplication(sys.argv) + w = MainWindow() + w.show() + sys.exit(app.exec_()) diff --git a/gui/models.py b/gui/models.py new file mode 100644 index 000000000..b4fe2b528 --- /dev/null +++ b/gui/models.py @@ -0,0 +1,78 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- + +from PyQt5.QtCore import QAbstractTableModel, Qt +from PyQt5 import QtCore + + +class PandasModel(QAbstractTableModel): + """ + Class to populate a table view with a pandas dataframe + """ + def __init__(self, data, parent=None): + QAbstractTableModel.__init__(self, parent) + self._data = data + + def rowCount(self, parent=None): + return self._data.shape[0] + + def columnCount(self, parent=None): + return self._data.shape[1] + + def data(self, index, role=Qt.DisplayRole): + if index.isValid(): + if role == Qt.DisplayRole: + return str(self._data.iloc[index.row(), index.column()]) + return None + + def headerData(self, col, orientation, role): + if orientation == Qt.Horizontal and role == Qt.DisplayRole: + return self._data.columns[col] + return None + + def flags(self, index): + flags = super(self.__class__, self).flags(index) + flags |= QtCore.Qt.ItemIsEditable + flags |= QtCore.Qt.ItemIsSelectable + flags |= QtCore.Qt.ItemIsEnabled + flags |= QtCore.Qt.ItemIsDragEnabled + flags |= QtCore.Qt.ItemIsDropEnabled + return flags + + def sort(self, Ncol, order): + """Sort table by given column number. + """ + try: + self.layoutAboutToBeChanged.emit() + self._data = self._data.sort_values(self._data.columns[Ncol], + ascending=not order) + self.layoutChanged.emit() + except Exception as e: + print(e) + + +class SelectionModel(QAbstractTableModel): + """ + Simple class to populate a table view with Selected data + """ + def __init__(self, list, parent=None): + QAbstractTableModel.__init__(self, parent) + self.headers = ['Filename'] + self.list = list + + def rowCount(self, parent=None): + return len(self.list) + + def columnCount(self, parent=None): + return 1 + + def data(self, index, role=Qt.DisplayRole): + if index.isValid(): + if role == Qt.DisplayRole: + return self.list[index.row()] + return None + + def headerData(self, col, orientation, role): + if orientation == Qt.Horizontal and role == Qt.DisplayRole: + return self.headers[col] + return None