Changeset 87dfca4 in sasview
- Timestamp:
- May 23, 2018 3:40:53 AM (7 years ago)
- Branches:
- ESS_GUI, 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:
- c03692f
- Parents:
- db7d2c7
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingLogic.py
rd6e38661 r87dfca4 16 16 self._data = data 17 17 self.data_is_loaded = False 18 #dq data presence in the dataset 19 self.dq_flag = False 20 #di data presence in the dataset 21 self.di_flag = False 18 22 if data is not None: 19 23 self.data_is_loaded = True 24 self.setDataProperties() 20 25 21 26 @property … … 28 33 self._data = value 29 34 self.data_is_loaded = True 35 self.setDataProperties() 30 36 31 37 def isLoadedData(self): 32 38 """ accessor """ 33 39 return self.data_is_loaded 40 41 def setDataProperties(self): 42 """ 43 Analyze data and set up some properties important for 44 the Presentation layer 45 """ 46 if self._data.__class__.__name__ == "Data2D": 47 if self._data.err_data is not None and np.any(self._data.err_data): 48 self.di_flag = True 49 if self._data.dqx_data is not None and np.any(self._data.dqx_data): 50 self.dq_flag = True 51 else: 52 if self._data.dy is not None and np.any(self._data.dy): 53 self.di_flag = True 54 if self._data.dx is not None and np.any(self._data.dx): 55 self.dq_flag = True 56 elif self._data.dxl is not None and np.any(self._data.dxl): 57 self.dq_flag = True 34 58 35 59 def createDefault1dData(self, interval, tab_id=0): -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r57be490 r87dfca4 177 177 178 178 # Create logics with data items 179 self._logic=[]180 179 # Logics.data contains only a single Data1D/Data2D object 181 for data_item in value: 182 self._logic.append(FittingLogic()) 183 self._logic[-1].data = GuiUtils.dataFromItem(data_item) 180 if len(value) == 1: 181 # single data logic is already defined, update data on it 182 self._logic[0].data = GuiUtils.dataFromItem(value[0]) 183 else: 184 # batch datasets 185 for data_item in value: 186 logic = FittingLogic(data=GuiUtils.dataFromItem(data_item)) 187 self._logic.append(logic) 184 188 185 189 # Overwrite data type descriptor -
src/sas/qtgui/Perspectives/Fitting/OptionsWidget.py
r976978b r87dfca4 163 163 self.chkLogData.setEnabled(False) 164 164 # Weighting controls 165 if isinstance(self.logic.data, Data2D): 166 if self.logic.data.err_data is None or\ 167 np.all(err == 1 for err in self.logic.data.err_data) or \ 168 not np.any(self.logic.data.err_data): 169 self.rbWeighting2.setEnabled(False) 170 self.rbWeighting1.setChecked(True) 171 else: 172 self.rbWeighting2.setEnabled(True) 173 self.rbWeighting2.setChecked(True) 165 if self.logic.di_flag: 166 self.rbWeighting2.setEnabled(True) 167 self.rbWeighting2.setChecked(True) 174 168 else: 175 if self.logic.data.dy is None or\ 176 np.all(self.logic.data.dy == 1) or\ 177 not np.any(self.logic.data.dy): 178 self.rbWeighting2.setEnabled(False) 179 self.rbWeighting1.setChecked(True) 180 else: 181 self.rbWeighting2.setEnabled(True) 182 self.rbWeighting2.setChecked(True) 169 self.rbWeighting2.setEnabled(False) 170 self.rbWeighting1.setChecked(True) 183 171 184 172 def updateQRange(self, q_range_min, q_range_max, npts):
Note: See TracChangeset
for help on using the changeset viewer.