Changeset ba7dceb in sasview
- Timestamp:
- Oct 18, 2011 9:16:37 AM (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:
- 15f68ce
- Parents:
- c935fac
- Location:
- park_integration/src/sans/fit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
park_integration/src/sans/fit/AbstractFitEngine.py
re8f7c47 rba7dceb 416 416 """ 417 417 def __init__(self, paramlist, model=None , data=None, fitresult=None, 418 handler=None, curr_thread=None ):418 handler=None, curr_thread=None, msg_q=None): 419 419 """ 420 420 :param Model: the model wrapper fro sans -model … … 425 425 self.data = data 426 426 self.paramlist = paramlist 427 self.msg_q = msg_q 427 428 self.curr_thread = curr_thread 428 429 self.handler = handler … … 467 468 return self.res 468 469 self.res = self.true_res 469 if self.fitresult is not None and self.handler is not None: 470 471 if self.fitresult is not None: 470 472 self.fitresult.set_model(model=self.model) 471 473 self.fitresult.residuals = self.true_res 472 474 self.fitresult.theory = theory 475 473 476 #fitness = self.chisq(params=params) 474 477 fitness = self.chisq() 475 478 self.fitresult.pvec = params 476 479 self.fitresult.set_fitness(fitness=fitness) 477 self.handler.set_result(result=self.fitresult) 478 self.handler.update_fit() 480 if self.msg_q is not None: 481 self.msg_q.put(self.fitresult) 482 483 if self.handler is not None: 484 self.handler.set_result(result=self.fitresult) 485 self.handler.update_fit() 479 486 480 487 if self.curr_thread != None : -
park_integration/src/sans/fit/Fitting.py
r7db52f1 rba7dceb 50 50 raise ValueError, "enter the keyword scipy or park" 51 51 52 def fit(self, q=None, handler=None,52 def fit(self, msg_q=None, q=None, handler=None, 53 53 curr_thread=None, 54 54 ftol=1.49012e-8, 55 55 reset_flag=False): 56 56 """Perform the fit """ 57 return self._engine.fit(q, handler, curr_thread=curr_thread, 57 return self._engine.fit(msg_q=msg_q, 58 q=q, handler=handler, curr_thread=curr_thread, 58 59 ftol=ftol, reset_flag=reset_flag) 59 60 -
park_integration/src/sans/fit/ParkFitting.py
r53fc5ad9 rba7dceb 382 382 383 383 384 def fit(self, q=None, handler=None, curr_thread=None, 384 def fit(self, msg_q=None, 385 q=None, handler=None, curr_thread=None, 385 386 ftol=1.49012e-8, reset_flag=False): 386 387 """ -
park_integration/src/sans/fit/ScipyFitting.py
r7db52f1 rba7dceb 56 56 # return profile(self._fit, *args, **kw) 57 57 58 def fit(self, q=None, handler=None, curr_thread=None, 58 def fit(self, msg_q=None, 59 q=None, handler=None, curr_thread=None, 59 60 ftol=1.49012e-8, reset_flag=False): 60 61 """ … … 96 97 from scipy import optimize 97 98 98 functor = SansAssembly(self.param_list, model, data, handler=handler,\ 99 fitresult=result, curr_thread= curr_thread) 99 functor = SansAssembly(paramlist=self.param_list, 100 model=model, 101 data=data, 102 handler=handler, 103 fitresult=result, 104 curr_thread=curr_thread, 105 msg_q=msg_q) 100 106 out, cov_x, _, mesg, success = optimize.leastsq(functor, 101 107 model.get_params(self.param_list),
Note: See TracChangeset
for help on using the changeset viewer.