Changeset 681f0dc in sasview
- Timestamp:
- Jan 15, 2009 5:35:45 PM (16 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:
- e9b4cc4
- Parents:
- 4853c04
- Location:
- park_integration
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
park_integration/AbstractFitEngine.py
rb461b6d7 r681f0dc 364 364 @param params: value of parameters to fit 365 365 """ 366 #import thread 366 367 self.model.setParams(self.paramlist,params) 367 368 self.res= self.data.residuals(self.model.eval) 369 #print "residuals",thread.get_ident() 368 370 return self.res 369 371 -
park_integration/Fitting.py
r61cb28d r681f0dc 52 52 return self._engine 53 53 54 def fit(self, qmin=None, qmax=None):54 def fit(self,handler=None, qmin=None, qmax=None): 55 55 """Perform the fit """ 56 return self._engine.fit(qmin,qmax) 56 57 return self._engine.fit(handler, qmin,qmax) 57 58 58 59 def set_model(self,model,Uid,pars=[]): -
park_integration/ParkFitting.py
r61cb28d r681f0dc 83 83 84 84 85 def fit(self, qmin=None, qmax=None):85 def fit(self,handler=None, qmin=None, qmax=None): 86 86 """ 87 87 Performs fit with park.fit module.It can perform fit with one model … … 103 103 localfit = FitSimplex() 104 104 localfit.ftol = 1e-8 105 # fitmc(fitness,localfit,n,handler): 106 #Run a monte carlo fit. 107 #This procedure maps a local optimizer across a set of n initial points. 108 #The initial parameter value defined by the fitness parameters defines 109 #one initial point. The remainder are randomly generated within the 110 #bounds of the problem. 111 #localfit is the local optimizer to use. It should be a bounded 112 #optimizer following the `park.fitmc.LocalFit` interface. 113 #handler accepts updates to the current best set of fit parameters. 105 114 106 # See `park.fitresult.FitHandler` for details. 115 107 fitter = FitMC(localfit=localfit) 116 #result = fit.fit(self.problem, 117 # fitter=fitter, 118 # handler= GuiUpdate(window)) 108 if handler == None: 109 print "no handler" 110 handler= fitresult.ConsoleUpdate(improvement_delta=0.1) 111 print "park handler", handler 119 112 result = fit.fit(self.problem, 120 113 fitter=fitter, 121 handler= fitresult.ConsoleUpdate(improvement_delta=0.1)) 122 #handler = fitresult.ConsoleUpdate(improvement_delta=0.1) 123 #models=self.problem 124 #service=None 125 #if models is None: raise RuntimeError('fit expected a list of models') 126 #from park.fit import LocalQueue,FitJob 127 #if service is None: service = LocalQueue() 128 #if fitter is None: fitter = fitmc.FitMC() 129 #if handler is None: handler = fitresult.FitHandler() 130 131 #objective = assembly.Assembly(models) if isinstance(models,list) else models 132 #job = FitJob(self.problem,fitter,handler) 133 #service.start(job) 134 #import wx 135 #while not self.job.handler.done: 136 # time.sleep(interval) 137 # wx.Yield() 138 #result=service.job.handler.result 114 handler= handler) 115 139 116 140 117 if result !=None: -
park_integration/ScipyFitting.py
r61cb28d r681f0dc 59 59 self.fitArrangeDict={} 60 60 self.paramList=[] 61 def fit(self ,qmin=None, qmax=None):61 def fit(self ,handler=None, qmin=None, qmax=None): 62 62 # Protect against simultanous fitting attempts 63 63 #if len(self.fitArrangeDict)>1: … … 65 65 # fitproblem contains first fitArrange object(one model and a list of data) 66 66 #list of fitproblem 67 67 68 fitproblem=[] 68 69 for id ,fproblem in self.fitArrangeDict.iteritems():
Note: See TracChangeset
for help on using the changeset viewer.