Example #1
0
    def __init__(self, parent=None):
        super(MaxEntView, self).__init__(parent)
        self.grid = QtGui.QVBoxLayout(self)

        # add splitter for resizing
        splitter = QtGui.QSplitter(QtCore.Qt.Vertical)

        self.run = None
        # make table
        self.table = QtGui.QTableWidget(self)
        self.table.resize(800, 800)

        self.table.setRowCount(11)
        self.table.setColumnCount(2)
        self.table.setColumnWidth(0, 300)
        self.table.setColumnWidth(1, 300)
        self.table.verticalHeader().setVisible(False)
        self.table.horizontalHeader().setStretchLastSection(True)
        self.table.setHorizontalHeaderLabels(
            ("MaxEnt Property;Value").split(";"))
        table_utils.setTableHeaders(self.table)

        # populate table
        options = ['test']

        table_utils.setRowName(self.table, 0, "Workspace")
        self.ws = table_utils.addComboToTable(self.table, 0, options)

        table_utils.setRowName(self.table, 1, "First good time")
        self.first_good = table_utils.addDoubleToTable(self.table, 0.1, 1)

        table_utils.setRowName(self.table, 2, "Last good time")
        self.last_good = table_utils.addDoubleToTable(self.table, 15.0, 2)

        table_utils.setRowName(self.table, 3, "Fit dead times")
        self.dead_box = table_utils.addCheckBoxToTable(self.table, True, 3)

        table_utils.setRowName(self.table, 4, "Use Phase Table")
        self.use_phaseTable_box = table_utils.addCheckBoxToTable(
            self.table, False, 4)

        table_utils.setRowName(self.table, 5, "Select Phase Table")
        options = [construct]
        self.phaseTable_box = table_utils.addComboToTable(
            self.table, 5, options)

        table_utils.setRowName(self.table, 6, "Fix phases")
        self.fix_phase_box = table_utils.addCheckBoxToTable(
            self.table, False, 6)

        self.table.hideRow(5)
        self.table.hideRow(6)

        table_utils.setRowName(self.table, 7, "Output phase table")
        self.output_phase_box = table_utils.addCheckBoxToTable(
            self.table, False, 7)

        table_utils.setRowName(self.table, 8, "Output deadtimes")
        self.output_dead_box = table_utils.addCheckBoxToTable(
            self.table, False, 8)

        table_utils.setRowName(self.table, 9, "Output reconstructed data")
        self.output_data_box = table_utils.addCheckBoxToTable(
            self.table, False, 9)

        table_utils.setRowName(self.table, 10, "Output phase convergence")
        self.output_phase_evo_box = table_utils.addCheckBoxToTable(
            self.table, False, 10)

        self.table.resizeRowsToContents()

        # advanced options table
        self.advancedLabel = QtGui.QLabel("\n  Advanced Options")
        # make table
        self.tableA = QtGui.QTableWidget(self)
        self.tableA.resize(800, 800)

        self.tableA.setRowCount(7)
        self.tableA.setColumnCount(2)
        self.tableA.setColumnWidth(0, 300)
        self.tableA.setColumnWidth(1, 300)

        self.tableA.verticalHeader().setVisible(False)
        self.tableA.horizontalHeader().setStretchLastSection(True)

        self.tableA.setHorizontalHeaderLabels(
            ("Advanced Property;Value").split(";"))
        table_utils.setTableHeaders(self.tableA)

        table_utils.setRowName(self.tableA, 0, "Maximum entropy constant (A)")
        self.AConst = table_utils.addDoubleToTable(self.tableA, 0.1, 0)

        table_utils.setRowName(self.tableA, 1, "Lagrange multiplier for chi^2")
        self.factor = table_utils.addDoubleToTable(self.tableA, 1.04, 1)

        table_utils.setRowName(self.tableA, 2, "Inner Iterations")
        self.inner_loop = table_utils.addSpinBoxToTable(self.tableA, 10, 2)

        table_utils.setRowName(self.tableA, 3, "Outer Iterations")
        self.outer_loop = table_utils.addSpinBoxToTable(self.tableA, 10, 3)

        table_utils.setRowName(self.tableA, 4, "Double pulse data")
        self.double_pulse_box = table_utils.addCheckBoxToTable(
            self.tableA, False, 4)

        table_utils.setRowName(self.tableA, 5, "Number of data points")
        self.N_points = table_utils.addComboToTable(self.tableA, 5, options)

        table_utils.setRowName(self.tableA, 6, "Maximum Field ")
        self.max_field = table_utils.addDoubleToTable(self.tableA, 1000.0, 6)

        # layout
        # this is if complex data is unhidden
        self.table.setMinimumSize(40, 203)
        self.tableA.setMinimumSize(40, 207)

        # make buttons
        self.button = QtGui.QPushButton('Calculate MaxEnt', self)
        self.button.setStyleSheet("background-color:lightgrey")
        self.cancel = QtGui.QPushButton('Cancel', self)
        self.cancel.setStyleSheet("background-color:lightgrey")
        self.cancel.setEnabled(False)
        # connects
        self.button.clicked.connect(self.MaxEntButtonClick)
        self.cancel.clicked.connect(self.cancelClick)
        self.table.cellClicked.connect(self.phaseBoxClick)
        # button layout
        self.buttonLayout = QtGui.QHBoxLayout()
        self.buttonLayout.addWidget(self.button)
        self.buttonLayout.addWidget(self.cancel)
        # add to layout
        splitter.addWidget(self.table)
        splitter.addWidget(self.advancedLabel)
        splitter.addWidget(self.tableA)
        self.grid.addWidget(splitter)
        self.grid.addLayout(self.buttonLayout)
Example #2
0
    def __init__(self, parent=None):
        super(MaxEntView, self).__init__(parent)
        self.grid = QtGui.QVBoxLayout(self)

        # add splitter for resizing
        splitter = QtGui.QSplitter(QtCore.Qt.Vertical)

        self.run = None
        # make table
        self.table = QtGui.QTableWidget(self)
        self.table.resize(800, 800)

        self.table.setRowCount(11)
        self.table.setColumnCount(2)
        self.table.setColumnWidth(0, 300)
        self.table.setColumnWidth(1, 300)
        self.table.verticalHeader().setVisible(False)
        self.table.horizontalHeader().setStretchLastSection(True)
        self.table.setHorizontalHeaderLabels(
            ("MaxEnt Property;Value").split(";"))
        table_utils.setTableHeaders(self.table)

        # populate table
        options = ['test']

        table_utils.setRowName(self.table, 0, "Workspace")
        self.ws = table_utils.addComboToTable(self.table, 0, options)

        table_utils.setRowName(self.table, 1, "First good time")
        self.first_good = table_utils.addDoubleToTable(self.table, 0.1, 1)

        table_utils.setRowName(self.table, 2, "Last good time")
        self.last_good = table_utils.addDoubleToTable(self.table, 15.0, 2)

        table_utils.setRowName(self.table, 3, "Fit dead times")
        self.dead_box = table_utils.addCheckBoxToTable(self.table, True, 3)

        table_utils.setRowName(self.table, 4, "Use Phase Table")
        self.use_phaseTable_box = table_utils.addCheckBoxToTable(
            self.table, False, 4)

        table_utils.setRowName(self.table, 5, "Construct Phase Table")
        self.phaseTable_box = table_utils.addCheckBoxToTable(
            self.table, True, 5)

        table_utils.setRowName(self.table, 6, "Fix phases")
        self.fix_phase_box = table_utils.addCheckBoxToTable(
            self.table, False, 6)

        self.table.hideRow(5)
        self.table.hideRow(6)

        table_utils.setRowName(self.table, 7, "Output phase table")
        self.output_phase_box = table_utils.addCheckBoxToTable(
            self.table, False, 7)

        table_utils.setRowName(self.table, 8, "Output deadtimes")
        self.output_dead_box = table_utils.addCheckBoxToTable(
            self.table, False, 8)

        table_utils.setRowName(self.table, 9, "Output reconstructed data")
        self.output_data_box = table_utils.addCheckBoxToTable(
            self.table, False, 9)

        table_utils.setRowName(self.table, 10, "Output phase convergence")
        self.output_phase_evo_box = table_utils.addCheckBoxToTable(
            self.table, False, 10)

        self.table.resizeRowsToContents()

        # advanced options table
        self.advancedLabel = QtGui.QLabel("\n  Advanced Options")
        # make table
        self.tableA = QtGui.QTableWidget(self)
        self.tableA.resize(800, 800)

        self.tableA.setRowCount(7)
        self.tableA.setColumnCount(2)
        self.tableA.setColumnWidth(0, 300)
        self.tableA.setColumnWidth(1, 300)

        self.tableA.verticalHeader().setVisible(False)
        self.tableA.horizontalHeader().setStretchLastSection(True)

        self.tableA.setHorizontalHeaderLabels(
            ("Advanced Property;Value").split(";"))
        table_utils.setTableHeaders(self.tableA)

        table_utils.setRowName(self.tableA, 0, "Maximum entropy constant (A)")
        self.AConst = table_utils.addDoubleToTable(self.tableA, 0.1, 0)

        table_utils.setRowName(self.tableA, 1, "Lagrange multiplier for chi^2")
        self.factor = table_utils.addDoubleToTable(self.tableA, 1.04, 1)

        table_utils.setRowName(self.tableA, 2, "Inner Iterations")
        self.inner_loop = table_utils.addSpinBoxToTable(self.tableA, 10, 2)

        table_utils.setRowName(self.tableA, 3, "Outer Iterations")
        self.outer_loop = table_utils.addSpinBoxToTable(self.tableA, 10, 3)

        table_utils.setRowName(self.tableA, 4, "Double pulse data")
        self.double_pulse_box = table_utils.addCheckBoxToTable(
            self.tableA, False, 4)

        table_utils.setRowName(self.tableA, 5, "Number of data points")
        self.N_points = table_utils.addComboToTable(self.tableA, 5, options)

        table_utils.setRowName(self.tableA, 6, "Maximum Field ")
        self.max_field = table_utils.addDoubleToTable(self.tableA, 1000.0, 6)

        # layout
        # this is if complex data is unhidden
        self.table.setMinimumSize(40, 203)
        self.tableA.setMinimumSize(40, 207)

        # make buttons
        self.button = QtGui.QPushButton('Calculate MaxEnt', self)
        self.button.setStyleSheet("background-color:lightgrey")
        self.cancel = QtGui.QPushButton('Cancel', self)
        self.cancel.setStyleSheet("background-color:lightgrey")
        self.cancel.setEnabled(False)
        # connects
        self.button.clicked.connect(self.MaxEntButtonClick)
        self.cancel.clicked.connect(self.cancelClick)
        self.table.cellClicked.connect(self.phaseBoxClick)
        # button layout
        self.buttonLayout = QtGui.QHBoxLayout()
        self.buttonLayout.addWidget(self.button)
        self.buttonLayout.addWidget(self.cancel)
        # add to layout
        splitter.addWidget(self.table)
        splitter.addWidget(self.advancedLabel)
        splitter.addWidget(self.tableA)
        self.grid.addWidget(splitter)
        self.grid.addLayout(self.buttonLayout)
Example #3
0
    def __init__(self, parent=None):
        super(FFTView, self).__init__(parent)
        self.grid = QtWidgets.QGridLayout(self)

        # add splitter for resizing
        splitter = QtWidgets.QSplitter(QtCore.Qt.Vertical)

        # make table
        self.FFTTable = QtWidgets.QTableWidget(self)
        self.FFTTable.resize(800, 800)
        self.FFTTable.setRowCount(6)
        self.FFTTable.setColumnCount(2)
        self.FFTTable.setColumnWidth(0, 300)
        self.FFTTable.setColumnWidth(1, 300)
        self.FFTTable.verticalHeader().setVisible(False)
        self.FFTTable.horizontalHeader().setStretchLastSection(True)
        self.FFTTable.setHorizontalHeaderLabels(
            ("FFT Property;Value").split(";"))
        # populate table
        options = ['test']

        table_utils.setRowName(self.FFTTable, 0, "Workspace")
        self.ws = table_utils.addComboToTable(self.FFTTable, 0, options)
        self.Im_box_row = 1
        table_utils.setRowName(
            self.FFTTable,
            self.Im_box_row,
            "Imaginary Data")
        self.Im_box = table_utils.addCheckBoxToTable(
            self.FFTTable, True, self.Im_box_row)

        table_utils.setRowName(self.FFTTable, 2, "Imaginary Workspace")
        self.Im_ws = table_utils.addComboToTable(self.FFTTable, 2, options)

        self.shift_box_row = 3
        table_utils.setRowName(self.FFTTable, self.shift_box_row, "Auto shift")
        self.shift_box = table_utils.addCheckBoxToTable(
            self.FFTTable, True, self.shift_box_row)

        table_utils.setRowName(self.FFTTable, 4, "Shift")
        self.shift = table_utils.addDoubleToTable(self.FFTTable, 0.0, 4)
        self.FFTTable.hideRow(4)

        table_utils.setRowName(self.FFTTable, 5, "Use Raw data")
        self.Raw_box = table_utils.addCheckBoxToTable(self.FFTTable, True, 5)

        self.FFTTable.resizeRowsToContents()
        # make advanced table options
        self.advancedLabel = QtWidgets.QLabel("\n Advanced Options")
        self.FFTTableA = QtWidgets.QTableWidget(self)
        self.FFTTableA.resize(800, 800)
        self.FFTTableA.setRowCount(4)
        self.FFTTableA.setColumnCount(2)
        self.FFTTableA.setColumnWidth(0, 300)
        self.FFTTableA.setColumnWidth(1, 300)
        self.FFTTableA.verticalHeader().setVisible(False)
        self.FFTTableA.horizontalHeader().setStretchLastSection(True)
        self.FFTTableA.setHorizontalHeaderLabels(
            ("Advanced Property;Value").split(";"))

        table_utils.setRowName(self.FFTTableA, 0, "Apodization Function")
        options = ["Lorentz", "Gaussian", "None"]
        self.apodization = table_utils.addComboToTable(
            self.FFTTableA, 0, options)

        table_utils.setRowName(
            self.FFTTableA,
            1,
            "Decay Constant (micro seconds)")
        self.decay = table_utils.addDoubleToTable(self.FFTTableA, 4.4, 1)

        table_utils.setRowName(self.FFTTableA, 2, "Negative Padding")
        self.negativePadding = table_utils.addCheckBoxToTable(
            self.FFTTableA, True, 2)

        table_utils.setRowName(self.FFTTableA, 3, "Padding")
        self.padding = table_utils.addSpinBoxToTable(self.FFTTableA, 1, 3)
        self.FFTTableA.resizeRowsToContents()

        # make button
        self.button = QtWidgets.QPushButton('Calculate FFT', self)
        self.button.setStyleSheet("background-color:lightgrey")
        # connects
        self.FFTTable.cellClicked.connect(self.tableClick)
        self.button.clicked.connect(self.buttonClick)
        self.ws.currentIndexChanged.connect(self.phaseCheck)
        # add to layout
        self.FFTTable.setMinimumSize(40, 158)
        self.FFTTableA.setMinimumSize(40, 127)
        table_utils.setTableHeaders(self.FFTTable)
        table_utils.setTableHeaders(self.FFTTableA)

        # add to layout
        splitter.addWidget(self.FFTTable)
        splitter.addWidget(self.advancedLabel)
        splitter.addWidget(self.FFTTableA)
        self.grid.addWidget(splitter)
        self.grid.addWidget(self.button)
Example #4
0
    def __init__(self, parent=None):
        super(FFTView, self).__init__(parent)
        self.grid = QtWidgets.QGridLayout(self)

        # add splitter for resizing
        splitter = QtWidgets.QSplitter(QtCore.Qt.Vertical)

        # make table
        self.FFTTable = QtWidgets.QTableWidget(self)
        self.FFTTable.resize(800, 800)
        self.FFTTable.setRowCount(6)
        self.FFTTable.setColumnCount(2)
        self.FFTTable.setColumnWidth(0, 300)
        self.FFTTable.setColumnWidth(1, 300)
        self.FFTTable.verticalHeader().setVisible(False)
        self.FFTTable.horizontalHeader().setStretchLastSection(True)
        self.FFTTable.setHorizontalHeaderLabels(
            ("FFT Property;Value").split(";"))
        # populate table
        options = ['test']

        table_utils.setRowName(self.FFTTable, 0, "Workspace")
        self.ws = table_utils.addComboToTable(self.FFTTable, 0, options)
        self.Im_box_row = 1
        table_utils.setRowName(
            self.FFTTable,
            self.Im_box_row,
            "Imaginary Data")
        self.Im_box = table_utils.addCheckBoxToTable(
            self.FFTTable, True, self.Im_box_row)

        table_utils.setRowName(self.FFTTable, 2, "Imaginary Workspace")
        self.Im_ws = table_utils.addComboToTable(self.FFTTable, 2, options)

        self.shift_box_row = 3
        table_utils.setRowName(self.FFTTable, self.shift_box_row, "Auto shift")
        self.shift_box = table_utils.addCheckBoxToTable(
            self.FFTTable, True, self.shift_box_row)

        table_utils.setRowName(self.FFTTable, 4, "Shift")
        self.shift = table_utils.addDoubleToTable(self.FFTTable, 0.0, 4)
        self.FFTTable.hideRow(4)

        table_utils.setRowName(self.FFTTable, 5, "Use Raw data")
        self.Raw_box = table_utils.addCheckBoxToTable(self.FFTTable, True, 5)

        self.FFTTable.resizeRowsToContents()
        # make advanced table options
        self.advancedLabel = QtWidgets.QLabel("\n Advanced Options")
        self.FFTTableA = QtWidgets.QTableWidget(self)
        self.FFTTableA.resize(800, 800)
        self.FFTTableA.setRowCount(4)
        self.FFTTableA.setColumnCount(2)
        self.FFTTableA.setColumnWidth(0, 300)
        self.FFTTableA.setColumnWidth(1, 300)
        self.FFTTableA.verticalHeader().setVisible(False)
        self.FFTTableA.horizontalHeader().setStretchLastSection(True)
        self.FFTTableA.setHorizontalHeaderLabels(
            ("Advanced Property;Value").split(";"))

        table_utils.setRowName(self.FFTTableA, 0, "Apodization Function")
        options = ["Lorentz", "Gaussian", "None"]
        self.apodization = table_utils.addComboToTable(
            self.FFTTableA, 0, options)

        table_utils.setRowName(
            self.FFTTableA,
            1,
            "Decay Constant (micro seconds)")
        self.decay = table_utils.addDoubleToTable(self.FFTTableA, 4.4, 1)

        table_utils.setRowName(self.FFTTableA, 2, "Negative Padding")
        self.negativePadding = table_utils.addCheckBoxToTable(
            self.FFTTableA, True, 2)

        table_utils.setRowName(self.FFTTableA, 3, "Padding")
        self.padding = table_utils.addSpinBoxToTable(self.FFTTableA, 1, 3)
        self.FFTTableA.resizeRowsToContents()

        # make button
        self.button = QtWidgets.QPushButton('Calculate FFT', self)
        self.button.setStyleSheet("background-color:lightgrey")
        # connects
        self.FFTTable.cellClicked.connect(self.tableClick)
        self.button.clicked.connect(self.buttonClick)
        self.ws.currentIndexChanged.connect(self.phaseCheck)
        # add to layout
        self.FFTTable.setMinimumSize(40, 158)
        self.FFTTableA.setMinimumSize(40, 127)
        table_utils.setTableHeaders(self.FFTTable)
        table_utils.setTableHeaders(self.FFTTableA)

        # add to layout
        splitter.addWidget(self.FFTTable)
        splitter.addWidget(self.advancedLabel)
        splitter.addWidget(self.FFTTableA)
        self.grid.addWidget(splitter)
        self.grid.addWidget(self.button)