Changeset 425e49ca in sasview for park_integration/src
- Timestamp:
- Oct 5, 2011 7:10:39 PM (13 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:
- a3c8e8f
- Parents:
- dcc93e4
- Location:
- park_integration/src/sans/fit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
park_integration/src/sans/fit/AbstractFitEngine.py
r634ca14 r425e49ca 283 283 msg += "%d <> %d" % (numpy.shape(self.dy), numpy.size(fx)) 284 284 raise RuntimeError, msg 285 return (self.y[self.idx] - fx[self.idx]) / self.dy[self.idx] 285 return (self.y[self.idx] - fx[self.idx]) / self.dy[self.idx], fx[self.idx] 286 286 287 287 def residuals_deriv(self, model, pars=[]): … … 431 431 self.true_res = [] 432 432 self.func_name = "Functor" 433 self.theory = None 433 434 434 435 #def chisq(self, params): … … 458 459 #import thread 459 460 self.model.set_params(self.paramlist, params) 460 self.true_res = self.data.residuals(self.model.eval) 461 462 self.true_res, self.theory = self.data.residuals(self.model.eval) 461 463 # check parameters range 462 464 if self.check_param_range(): -
park_integration/src/sans/fit/ParkFitting.py
r634ca14 r425e49ca 27 27 def __init__(self, *args, **kwrds): 28 28 fitresult.FitResult.__init__(self, *args, **kwrds) 29 self.theory = None 29 30 self.inputs = [] 30 31 … … 43 44 #xtol = 1e-4 44 45 """Stop when simplex vertices are within xtol of each other""" 45 ftol = 1e-446 ftol = 5e-5 46 47 """Stop when vertex values are within ftol of each other""" 47 48 maxiter = None … … 66 67 # Compute the parameter uncertainties from the jacobian 67 68 res.calc_cov(fitness) 69 res.theory = result.fx 68 70 return res 69 71 … … 272 274 if self._cancel: return numpy.inf 273 275 if m.isfitted and m.weight != 0: 274 m.residuals = m.fitness.residuals()276 m.residuals, _ = m.fitness.residuals() 275 277 N = len(m.residuals) 276 278 m.degrees_of_freedom = N-k if N>k else 1 -
park_integration/src/sans/fit/ScipyFitting.py
rd91d2c9 r425e49ca 39 39 self.model = model 40 40 self.data = data 41 self.theory = None 41 42 self.param_list = param_list 42 43 self.iterations = 0 … … 160 161 full_output=1, 161 162 warning=True) 163 162 164 except KeyboardInterrupt: 163 165 msg = "Fitting: Terminated!!!" … … 188 190 result.pvec = out 189 191 result.success = success 192 result.theory = functor.theory 190 193 #print "scipy", result.inputs 191 194 if q is not None:
Note: See TracChangeset
for help on using the changeset viewer.