Changeset 406f420 in sasview
- Timestamp:
- Oct 26, 2017 9:20:46 AM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- bde1a6b
- Parents:
- 8045572
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/PrInversion/PrInversionPerspective.py
r8045572 r406f420 1 import logging2 1 import numpy as np 3 2 … … 13 12 class PrInversionWindow(QtGui.QTabWidget, Ui_PrInversion): 14 13 """ 14 The main window for the P(r) Inversion perspective. 15 15 """ 16 16 … … 26 26 self._model_item = QtGui.QStandardItem() 27 27 self._helpView = QtWebKit.QWebView() 28 29 if not isinstance(data, list): 30 data = [data] 28 31 self._data = data 29 32 … … 33 36 # Set initial values 34 37 self._data_index = 0 35 self._path = [""]36 self._background = [0.0]37 self._qmin = [0.0]38 self._qmax = [1.0]39 self._slit_height = [0.0]40 self._slit_width = [0.0]41 self._terms = [10]42 self._regularization = [0.0001]43 self._max_distance = [140]44 self._bgd_input = [False]45 self._terms_button = [False]46 self._reg_button = [False]47 self._terms_label = [""]48 self._reg_label = [""]38 self._path = "" 39 self._background = 0.0 40 self._qmin = 0.0 41 self._qmax = 1.0 42 self._slit_height = 0.0 43 self._slit_width = 0.0 44 self._terms = 10 45 self._regularization = 0.0001 46 self._max_distance = 140 47 self._bgd_input = False 48 self._terms_button = False 49 self._reg_button = False 50 self._terms_label = "" 51 self._reg_label = "" 49 52 # Set results 50 self._rg = [0.0]51 self._i_0 = [0.0]52 self._comp_time = [0.0]53 self._chi_dof = [0.0]54 self._oscillations = [0.0]55 self._pos_fraction = [0.0]56 self._sigma_pos_fraction = [0.0]53 self._rg = 0.0 54 self._i_0 = 0.0 55 self._comp_time = 0.0 56 self._chi_dof = 0.0 57 self._oscillations = 0.0 58 self._pos_fraction = 0.0 59 self._sigma_pos_fraction = 0.0 57 60 58 61 # Let's choose the Standard Item Model. … … 66 69 67 70 self.communicate = GuiUtils.Communicate() 68 logging.debug("P(r) Inversion Perspective loaded")69 71 70 72 ###################################################################### … … 164 166 Update boxes with latest values 165 167 """ 166 item = QtGui.QStandardItem(self._path [self._data_index])168 item = QtGui.QStandardItem(self._path) 167 169 self.model.setItem(WIDGETS.W_FILENAME, item) 168 item = QtGui.QStandardItem(self._background [self._data_index])170 item = QtGui.QStandardItem(self._background) 169 171 self.model.setItem(WIDGETS.W_BACKGROUND, item) 170 self.checkBgdClicked(self._bgd_input [self._data_index])171 item = QtGui.QStandardItem(self._qmin [self._data_index])172 self.checkBgdClicked(self._bgd_input) 173 item = QtGui.QStandardItem(self._qmin) 172 174 self.model.setItem(WIDGETS.W_QMIN, item) 173 item = QtGui.QStandardItem(self._qmax [self._data_index])175 item = QtGui.QStandardItem(self._qmax) 174 176 self.model.setItem(WIDGETS.W_QMAX, item) 175 item = QtGui.QStandardItem(self._slit_width [self._data_index])177 item = QtGui.QStandardItem(self._slit_width) 176 178 self.model.setItem(WIDGETS.W_SLIT_WIDTH, item) 177 item = QtGui.QStandardItem(self._slit_height [self._data_index])179 item = QtGui.QStandardItem(self._slit_height) 178 180 self.model.setItem(WIDGETS.W_SLIT_HEIGHT, item) 179 item = QtGui.QStandardItem(self._terms [self._data_index])181 item = QtGui.QStandardItem(self._terms) 180 182 self.model.setItem(WIDGETS.W_NO_TERMS, item) 181 item = QtGui.QStandardItem(self._regularization [self._data_index])183 item = QtGui.QStandardItem(self._regularization) 182 184 self.model.setItem(WIDGETS.W_REGULARIZATION, item) 183 item = QtGui.QStandardItem(self._max_distance [self._data_index])185 item = QtGui.QStandardItem(self._max_distance) 184 186 self.model.setItem(WIDGETS.W_MAX_DIST, item) 185 item = QtGui.QStandardItem(self._rg [self._data_index])187 item = QtGui.QStandardItem(self._rg) 186 188 self.model.setItem(WIDGETS.W_RG, item) 187 item = QtGui.QStandardItem(self._i_0 [self._data_index])189 item = QtGui.QStandardItem(self._i_0) 188 190 self.model.setItem(WIDGETS.W_I_ZERO, item) 189 item = QtGui.QStandardItem(self._background [self._data_index])191 item = QtGui.QStandardItem(self._background) 190 192 self.model.setItem(WIDGETS.W_BACKGROUND, item) 191 item = QtGui.QStandardItem(self._comp_time [self._data_index])193 item = QtGui.QStandardItem(self._comp_time) 192 194 self.model.setItem(WIDGETS.W_COMP_TIME, item) 193 item = QtGui.QStandardItem(self._chi_dof [self._data_index])195 item = QtGui.QStandardItem(self._chi_dof) 194 196 self.model.setItem(WIDGETS.W_CHI_SQUARED, item) 195 item = QtGui.QStandardItem(self._oscillations [self._data_index])197 item = QtGui.QStandardItem(self._oscillations) 196 198 self.model.setItem(WIDGETS.W_OSCILLATION, item) 197 item = QtGui.QStandardItem(self._pos_fraction [self._data_index])199 item = QtGui.QStandardItem(self._pos_fraction) 198 200 self.model.setItem(WIDGETS.W_POS_FRACTION, item) 199 item = QtGui.QStandardItem(self._sigma_pos_fraction [self._data_index])201 item = QtGui.QStandardItem(self._sigma_pos_fraction) 200 202 self.model.setItem(WIDGETS.W_SIGMA_POS_FRACTION, item) 201 203 self.enableButtons() … … 205 207 Disable buttons when no data present, else enable them 206 208 """ 207 if self._path [self._data_index] == "" and len(self._path) == 1:209 if self._path == "" and len(self._data) == 1: 208 210 self.calculateButton.setEnabled(False) 209 211 self.explorerButton.setEnabled(False) … … 220 222 self.populateDataComboBox() 221 223 self.dataList.setCurrentIndex(self._data_index) 222 self. setupModel()224 self._get_data_from_data_set() 223 225 224 226 def populateDataComboBox(self): 225 227 string_list = QtCore.QStringList() 226 for item in self._ data:228 for item in self._path: 227 229 qt_item = QtCore.QString.fromUtf8(item) 228 230 string_list.append(qt_item) … … 235 237 """ 236 238 assert data_list is not None 237 238 239 for data in data_list: 239 # TODO: populate class variable lists with data from data_list240 pass240 # TODO: Get get object via GuiUtils 241 self._data.append(None) 241 242 self.reDraw() 242 243 244 def _get_data_from_data_set(self): 245 data = self._data[self._data_index] 246 # TODO: Get all items from data 247 # self._qmin = data.qmin 248 # self._qmax = data.qmax 249 self.setupModel() 243 250 244 251 ###################################################################### … … 274 281 self.manualBgd.setChecked(True) 275 282 self.toggleBgd(self.manualBgd) 276 self._bgd_input [self._data_index]= True283 self._bgd_input = True 277 284 else: 278 285 self.estimateBgd.setChecked(True) 279 286 self.toggleBgd(self.estimateBgd) 280 self._bgd_input [self._data_index]= False287 self._bgd_input = False 281 288 282 289 def toggleBgd(self, item=None):
Note: See TracChangeset
for help on using the changeset viewer.