Changeset 4331b05e in sasview
- Timestamp:
- Jul 6, 2009 5:01:12 PM (15 years ago)
- Branches:
- master, 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 27fea3f
- Parents:
- e7b1ccf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
park_integration/AbstractFitEngine.py
r24b8d5c r4331b05e 259 259 260 260 dy[dy==0]=1 261 #idx = (x>=self.qmin) & (x <= self.qmax) 262 261 263 262 # Compute theory data f(x) 264 #fx = numpy.zeros(len(x))265 263 tempy=[] 264 fx=numpy.zeros(len(y)) 265 tempdy=[] 266 index=[] 266 267 tempfx=[] 267 tempdy=[]268 #fx[idx] = numpy.asarray([fn(v) for v in x[idx]])269 268 for i_x in range(len(x)): 270 269 try: 271 270 if self.qmin <=x[i_x] and x[i_x]<=self.qmax: 272 271 value= fn(x[i_x]) 273 tempfx.append( value)272 fx[i_x] =value 274 273 tempy.append(y[i_x]) 275 274 tempdy.append(dy[i_x]) 275 index.append(i_x) 276 276 except: 277 277 ## skip error for model.run(x) … … 280 280 ## Smear theory data 281 281 if self.smearer is not None: 282 tempfx = self.smearer(tempfx) 282 fx = self.smearer(fx) 283 284 for i in index: 285 tempfx.append(fx[i]) 286 283 287 newy= numpy.asarray(tempy) 284 288 newfx= numpy.asarray(tempfx) 285 289 newdy= numpy.asarray(tempdy) 286 290 287 288 291 ## Sanity check 289 292 if numpy.size(newdy)!= numpy.size(newfx): 290 293 raise RuntimeError, "FitData1D: invalid error array" 291 #return (y[idx] - fx[idx])/dy[idx]292 294 293 295 return (newy- newfx)/newdy
Note: See TracChangeset
for help on using the changeset viewer.