- Timestamp:
- Oct 26, 2018 5:58:45 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 75906a1
- Parents:
- 33812c3
- Location:
- src/sas
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py
r6ae7466 raed159f 473 473 self._calculator.set_qmax(qmax) 474 474 if np.size(self.logic.data.dy) == 0 or np.all(self.logic.data.dy) == 0: 475 self. logic.data.dy = self._calculator.add_errors(self.logic.data.y)475 self._calculator.add_errors() 476 476 self.updateDataList(data) 477 477 self.populateDataComboBox(self.logic.data.filename, data) -
src/sas/qtgui/Utilities/GuiUtils.py
r8748751 raed159f 95 95 except ImportError: 96 96 pass 97 #logging.error("Error loading %s/%s: %s" % (path, confg_file, sys.exc_value))98 97 except ValueError: 99 98 print("Value error") … … 102 101 if fObj is not None: 103 102 fObj.close() 104 #logging.info("GuiManager loaded %s/%s" % (path, confg_file))105 103 return config_module 106 104 -
src/sas/sascalc/pr/fit/expression.py
r1431dab raed159f 209 209 """%("\n ".join(assignments),"\n ".join(code)) 210 210 211 #print("Function: "+functiondef) 212 exec(functiondef) in globals, locals 211 exec(functiondef, globals, locals) 213 212 retfn = locals['eval_expressions'] 214 213 -
src/sas/sascalc/pr/invertor.py
reeea6a3 raed159f 227 227 return None 228 228 229 def add_errors(self, yvalues): 230 """ 231 Adds errors to data set is they are not avaialble 232 :return: 233 """ 234 stats_errors = np.zeros(len(yvalues)) 235 for i in range(len(yvalues)): 236 # Scale the error so that we can fit over several decades of Q 237 scale = 0.05 * np.sqrt(yvalues[i]) 238 min_err = 0.01 * yvalues[i] 239 stats_errors[i] = scale * np.sqrt(np.fabs(yvalues[i])) + min_err 240 logger.warning("Simulated errors have been added to the data set\n") 241 return stats_errors 229 def add_errors(self, sigma=0.05): 230 """ 231 Adds errors to data set is they are not available. 232 Uses $\Delta y = \sigma | y |$. 233 """ 234 self.dy = sigma * np.fabs(self.y) 242 235 243 236 def clone(self): … … 514 507 # We were not able to estimate the errors 515 508 # Return an empty error matrix 516 logger.error(sys.exc_ value)509 logger.error(sys.exc_info()[1]) 517 510 518 511 # Keep a copy of the last output … … 559 552 # number of terms 560 553 best_alpha, _, _ = self.estimate_alpha(self.nfunc) 561 logger.warning("Invertor.estimate_numterms: %s" % sys.exc_ value)554 logger.warning("Invertor.estimate_numterms: %s" % sys.exc_info()[1]) 562 555 return self.nfunc, best_alpha, "Could not estimate number of terms" 563 556 … … 646 639 647 640 except: 648 message = "Invertor.estimate_alpha: %s" % sys.exc_ value641 message = "Invertor.estimate_alpha: %s" % sys.exc_info()[1] 649 642 return 0, message, elapsed 650 643 … … 763 756 764 757 except: 765 msg = "Invertor.from_file: corrupted file\n%s" % sys.exc_ value758 msg = "Invertor.from_file: corrupted file\n%s" % sys.exc_info()[1] 766 759 raise RuntimeError(msg) 767 760 else:
Note: See TracChangeset
for help on using the changeset viewer.