Changeset ff2b961 in sasview
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Corfunc/CorfuncPerspective.py
recdf172 rff2b961 21 21 as FigureCanvas 22 22 from matplotlib.figure import Figure 23 from numpy.linalg.linalg import LinAlgError 23 24 24 25 … … 182 183 """Extend the experiemntal data with guinier and porod curves.""" 183 184 self._update_calculator() 184 params, extrapolation, _ = self._calculator.compute_extrapolation() 185 186 self.model.setItem(W.W_GUINIERA, QtGui.QStandardItem(str(params['A']))) 187 self.model.setItem(W.W_GUINIERB, QtGui.QStandardItem(str(params['B']))) 188 self.model.setItem(W.W_PORODK, QtGui.QStandardItem(str(params['K']))) 189 self.model.setItem(W.W_PORODSIGMA, 190 QtGui.QStandardItem(str(params['sigma']))) 191 192 self._canvas.extrap = extrapolation 193 self._canvas.draw_q_space() 194 self.transformBtn.setEnabled(True) 185 try: 186 params, extrapolation, _ = self._calculator.compute_extrapolation() 187 self.model.setItem(W.W_GUINIERA, QtGui.QStandardItem(str(params['A']))) 188 self.model.setItem(W.W_GUINIERB, QtGui.QStandardItem(str(params['B']))) 189 self.model.setItem(W.W_PORODK, QtGui.QStandardItem(str(params['K']))) 190 self.model.setItem(W.W_PORODSIGMA, 191 QtGui.QStandardItem(str(params['sigma']))) 192 193 self._canvas.extrap = extrapolation 194 self._canvas.draw_q_space() 195 self.transformBtn.setEnabled(True) 196 except (LinAlgError, ValueError): 197 message = "These is not enough data in the fitting range. "\ 198 "Try decreasing the upper Q, increasing the "\ 199 "cutoff Q, or increasing the lower Q." 200 QtGui.QMessageBox.warning(self, "Calculation Error", 201 message) 202 self._canvas.extrap = None 203 self._canvas.draw_q_space() 204 195 205 196 206 def transform(self): … … 260 270 """Find a good estimate of the background value.""" 261 271 self._update_calculator() 262 background = self._calculator.compute_background() 263 temp = QtGui.QStandardItem(str(background)) 264 self.model.setItem(W.W_BACKGROUND, temp) 272 try: 273 background = self._calculator.compute_background() 274 temp = QtGui.QStandardItem(str(background)) 275 self.model.setItem(W.W_BACKGROUND, temp) 276 except (LinAlgError, ValueError): 277 message = "These is not enough data in the fitting range. "\ 278 "Try decreasing the upper Q or increasing the cutoff Q" 279 QtGui.QMessageBox.warning(self, "Calculation Error", 280 message) 281 265 282 266 283 # pylint: disable=invalid-name
Note: See TracChangeset
for help on using the changeset viewer.