Changeset 180bd54 in sasview for src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
- Timestamp:
- Apr 27, 2017 6:39:35 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:
- 0215e0a
- Parents:
- 98b13f72
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
r1970780 r180bd54 231 231 res = (fn - gn) / en 232 232 except ValueError: 233 print "Chi2 calculations: Unmatched lengths %s, %s, %s" % (len(fn), len(gn), len(en))233 #print "Chi2 calculations: Unmatched lengths %s, %s, %s" % (len(fn), len(gn), len(en)) 234 234 return None 235 235 … … 248 248 249 249 # 1d theory from model_thread is only in the range of index 250 if current_data.dy ==None or current_data.dy == []:250 if current_data.dy is None or current_data.dy == []: 251 251 dy = numpy.ones(len(current_data.y)) 252 252 else: 253 if weight == None: 254 dy = numpy.ones(len(current_data.y)) 255 else: 256 dy = weight 253 dy = weight if weight is not None else numpy.ones(len(current_data.y)) 257 254 dy[dy == 0] = 1 258 255 fn = current_data.y[index][0] … … 261 258 # build residuals 262 259 residuals = Data1D() 263 try:260 if len(fn) == len(gn): 264 261 y = (fn - gn)/en 265 262 residuals.y = -y 266 except: 267 msg = "ResidualPlot Error: different # of data points in theory" 268 print msg 263 else: 269 264 y = (fn - gn[index][0]) / en 270 265 residuals.y = y 266 267 #try: 268 # y = (fn - gn)/en 269 # residuals.y = -y 270 #except ValueError: 271 # msg = "ResidualPlot Error: different number of data points in theory" 272 # print msg 273 # y = (fn - gn[index][0]) / en 274 # residuals.y = y 271 275 residuals.x = current_data.x[index][0] 272 276 residuals.dy = numpy.ones(len(residuals.y)) … … 296 300 fn = current_data.data 297 301 gn = reference_data.data 298 if weight == None: 299 en = current_data.err_data 300 else: 301 en = weight 302 en = current_data.err_data if weight is None else weight 302 303 residuals.data = (fn - gn) / en 303 304 residuals.qx_data = current_data.qx_data
Note: See TracChangeset
for help on using the changeset viewer.