Changeset 7924042 in sasview for park_integration
- Timestamp:
- Jul 30, 2008 10:10:55 AM (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:
- 8780e9a
- Parents:
- 9855699
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
park_integration/ParkFitting.py
r9855699 r7924042 49 49 def __init__(self, sans_model): 50 50 self.model = sans_model 51 print "ParkFitting:sans model",self.model 51 52 sansp = sans_model.getParamList() 52 53 print "ParkFitting: sans model parameter list",sansp 53 54 parkp = [SansParameter(p,sans_model) for p in sansp] 55 print "ParkFitting: park model parameter ",parkp 54 56 self.parameterset = park.ParameterSet(sans_model.name,pars=parkp) 55 57 56 58 def eval(self,x): 57 print "eval",self.parameterset[0].value 59 print "eval",self.parameterset[0].value,self.parameterset[1].value 60 print "model run ",self.model.run(x) 58 61 return self.model.run(x) 59 62 … … 145 148 create an assembly self.problem= park.Assembly([(parkmodel,parkdata)]) 146 149 """ 150 print "ParkFitting: In createproblem" 147 151 mylist=[] 148 152 listmodel=[] … … 152 156 #wrap sans model 153 157 parkmodel = Model(sansmodel) 158 print "ParkFitting: createproblem: just create a model",parkmodel.parameterset 154 159 for p in parkmodel.parameterset: 155 160 #self.param_list.append(p._getname()) 156 161 if p.isfixed() and p._getname()in self.paramList: 157 162 p.set([-numpy.inf,numpy.inf]) 158 163 159 164 Ldata=value.get_data() 160 165 x,y,dy=self._concatenateData(Ldata) … … 162 167 parkdata=Data(x,y,dy,None) 163 168 couple=(parkmodel,parkdata) 169 print "Parkfitting: fitness",couple 164 170 mylist.append(couple) 165 171 print "mylist",mylist … … 183 189 @return result.cov: Covariance matrix 184 190 """ 191 #from numpy.linalg.linalg.LinAlgError import LinAlgError 185 192 print "Parkfitting: fit method probably breaking just right before \ 186 193 call fit" … … 193 200 localfit.ftol = 1e-8 194 201 fitter = FitMC(localfit=localfit) 195 196 result = fit.fit(self.problem, 202 try: 203 204 result = fit.fit(self.problem, 197 205 fitter=fitter, 198 206 handler= fitresult.ConsoleUpdate(improvement_delta=0.1)) 199 for p in result.parameters: 200 print "fit in park fitting", p.name, p.value 201 return result.fitness,result.pvec,result.cov 207 208 for p in result.parameters: 209 print "fit in park fitting", p.name, p.value 210 return result.fitness,result.pvec,result.cov 211 212 except : 213 raise 214 return 215 202 216 203 217
Note: See TracChangeset
for help on using the changeset viewer.