Changeset fba204bf in sasview
 Timestamp:
 Sep 4, 2018 11:34:41 AM (22 months 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:
 6701a0b
 Parents:
 d686ff1
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/sas/sascalc/pr/invertor.py
rb8080e1 rfba204bf 144 144 x, y, err, d_max, q_min, q_max and alpha 145 145 """ 146 if 146 if name == 'x': 147 147 if 0.0 in value: 148 148 msg = "Invertor: one of your qvalues is zero. " … … 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 return stats_errors 241 229 242 def clone(self): 230 243 """ … … 245 258 invertor.y = self.y 246 259 invertor.err = self.err 260 if np.size(self.err) == 0 or np.all(self.err) == 0: 261 invertor.err = self.add_errors(self.y) 262 else: 263 invertor.err = self.err 247 264 invertor.est_bck = self.est_bck 248 265 invertor.background = self.background
Note: See TracChangeset
for help on using the changeset viewer.