def __init__(self, parent=None): super(MaxEntView, self).__init__(parent) self.grid = QtGui.QVBoxLayout(self) 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) self.horizontalSpacer1 = QtGui.QSpacerItem(20, 30, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) self.horizontalSpacer2 = QtGui.QSpacerItem(20, 70, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) #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 self.grid.addWidget(self.table) self.grid.addItem(self.horizontalSpacer1) self.grid.addWidget(self.advancedLabel) self.grid.addWidget(self.tableA) self.grid.addItem(self.horizontalSpacer2) self.grid.addLayout(self.buttonLayout)
def __init__(self, parent = None): super(FFTView, self).__init__(parent) self.grid = QtGui.QGridLayout(self) #make table self.FFTTable = QtGui.QTableWidget(self) self.FFTTable.resize(800, 800) self.FFTTable.setRowCount(9) 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) table_utils.setRowName(self.FFTTable,6,"First Good Data") self.x0 = table_utils.addDoubleToTable(self.FFTTable,0.1,6) self.FFTTable.hideRow(6) table_utils.setRowName(self.FFTTable,7,"Last Good Data") self.xN = table_utils.addDoubleToTable(self.FFTTable,15.0,7) self.FFTTable.hideRow(7) table_utils.setRowName(self.FFTTable,8,"Construct Phase Table") self.phaseTable_box = table_utils.addCheckBoxToTable(self.FFTTable,True,8) self.FFTTable.hideRow(8) self.FFTTable.resizeRowsToContents() #make advanced table options self.advancedLabel = QtGui.QLabel("\n Advanced Options") self.FFTTableA = QtGui.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 = ["None","Lorentz","Gaussian"] 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,1.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 = QtGui.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) self.horizontalSpacer1 = QtGui.QSpacerItem(20, 94, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) self.horizontalSpacer2 = QtGui.QSpacerItem(20, 280, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) # add to layout self.grid.addWidget(self.FFTTable) self.grid.addItem(self.horizontalSpacer1) self.grid.addWidget(self.advancedLabel) self.grid.addWidget(self.FFTTableA) self.grid.addItem(self.horizontalSpacer2) self.grid.addWidget(self.button)
def __init__(self, parent=None): super(FFTView, self).__init__(parent) self.grid = QtGui.QGridLayout(self) #make table self.FFTTable = QtGui.QTableWidget(self) self.FFTTable.resize(800, 800) self.FFTTable.setRowCount(9) 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) table_utils.setRowName(self.FFTTable, 6, "First Good Data") self.x0 = table_utils.addDoubleToTable(self.FFTTable, 0.1, 6) self.FFTTable.hideRow(6) table_utils.setRowName(self.FFTTable, 7, "Last Good Data") self.xN = table_utils.addDoubleToTable(self.FFTTable, 15.0, 7) self.FFTTable.hideRow(7) table_utils.setRowName(self.FFTTable, 8, "Construct Phase Table") self.phaseTable_box = table_utils.addCheckBoxToTable( self.FFTTable, True, 8) self.FFTTable.hideRow(8) self.FFTTable.resizeRowsToContents() #make advanced table options self.advancedLabel = QtGui.QLabel("\n Advanced Options") self.FFTTableA = QtGui.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 = ["None", "Lorentz", "Gaussian"] 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, 1.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 = QtGui.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) self.horizontalSpacer1 = QtGui.QSpacerItem(20, 94, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) self.horizontalSpacer2 = QtGui.QSpacerItem(20, 280, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) # add to layout self.grid.addWidget(self.FFTTable) self.grid.addItem(self.horizontalSpacer1) self.grid.addWidget(self.advancedLabel) self.grid.addWidget(self.FFTTableA) self.grid.addItem(self.horizontalSpacer2) self.grid.addWidget(self.button)
def __init__(self, parent=None): super(MaxEntView, self).__init__(parent) self.grid = QtGui.QVBoxLayout(self) #make table self.table = QtGui.QTableWidget(self) self.table.resize(800, 800) self.table.setRowCount(8) 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 table_utils.setRowName(self.table, 0, "Complex Data") self.complex_data_box = table_utils.addCheckBoxToTable( self.table, False, 0) self.complex_data_box.setFlags(QtCore.Qt.ItemIsEnabled) # needs an even number of ws to work # so lets hide it for now self.table.setRowHidden(0, True) table_utils.setRowName(self.table, 1, "Complex Image") self.complex_image_box = table_utils.addCheckBoxToTable( self.table, True, 1) table_utils.setRowName(self.table, 2, "Positive Image") self.positive_image_box = table_utils.addCheckBoxToTable( self.table, False, 2) table_utils.setRowName(self.table, 3, "Resolution") self.resolution_box = table_utils.addSpinBoxToTable(self.table, 1, 3) table_utils.setRowName(self.table, 4, "Maximum entropy constant (A)") self.AConst = table_utils.addDoubleToTable(self.table, 0.4, 4) table_utils.setRowName(self.table, 5, "Auto shift") self.shift_box = table_utils.addCheckBoxToTable(self.table, False, 5) table_utils.setRowName(self.table, 6, "Raw") self.raw_box = table_utils.addCheckBoxToTable(self.table, False, 6) # this will be removed once maxEnt does a simultaneous fit options = ['test'] table_utils.setRowName(self.table, 7, "Workspace") self.ws = table_utils.addComboToTable(self.table, 7, options) 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(6) 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, "Chi target") self.chiTarget = table_utils.addDoubleToTable(self.tableA, 100, 0) table_utils.setRowName(self.tableA, 1, "Chi (precision)") self.chiEps = table_utils.addDoubleToTable(self.tableA, 0.001, 1) table_utils.setRowName(self.tableA, 2, "Distance Penalty") self.dist = table_utils.addDoubleToTable(self.tableA, 0.1, 2) table_utils.setRowName(self.tableA, 3, "Maximum Angle") self.angle = table_utils.addDoubleToTable(self.tableA, 0.05, 3) table_utils.setRowName(self.tableA, 4, "Max Iterations") self.max_iterations = table_utils.addSpinBoxToTable( self.tableA, 20000, 4) table_utils.setRowName(self.tableA, 5, "Alpha Chop Iterations") self.chop = table_utils.addSpinBoxToTable(self.tableA, 500, 5) #layout # this is if complex data is unhidden self.table.setMinimumSize(40, 203) self.tableA.setMinimumSize(40, 207) self.horizontalSpacer1 = QtGui.QSpacerItem(20, 30, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) self.horizontalSpacer2 = QtGui.QSpacerItem(20, 70, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) #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) # button layout self.buttonLayout = QtGui.QHBoxLayout() self.buttonLayout.addWidget(self.button) self.buttonLayout.addWidget(self.cancel) # add to layout self.grid.addWidget(self.table) self.grid.addItem(self.horizontalSpacer1) self.grid.addWidget(self.advancedLabel) self.grid.addWidget(self.tableA) self.grid.addItem(self.horizontalSpacer2) self.grid.addLayout(self.buttonLayout)
def __init__(self, parent=None): super(MaxEntView, self).__init__(parent) self.grid = QtGui.QVBoxLayout(self) 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) self.horizontalSpacer1 = QtGui.QSpacerItem(20, 30, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) self.horizontalSpacer2 = QtGui.QSpacerItem(20, 70, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) #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 self.grid.addWidget(self.table) self.grid.addItem(self.horizontalSpacer1) self.grid.addWidget(self.advancedLabel) self.grid.addWidget(self.tableA) self.grid.addItem(self.horizontalSpacer2) self.grid.addLayout(self.buttonLayout)