Changeset d59cb8c in sasview for park_integration/src/sans
- Timestamp:
- Oct 11, 2011 10:23:55 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:
- 444c900e
- Parents:
- 4c712ea4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
park_integration/src/sans/fit/ParkFitting.py
r1fa4db39 rd59cb8c 10 10 import numpy 11 11 import math 12 from numpy.linalg.linalg import LinAlgError 12 13 #import park 13 14 from park import fit … … 49 50 maxiter = None 50 51 """Maximum number of iterations before fit terminates""" 52 def __init__(self, ftol=5e-5): 53 self.ftol = ftol 54 51 55 def fit(self, fitness, x0): 52 56 """Run the fit""" … … 106 110 localfit = SansFitSimplex() 107 111 start_points = 10 108 112 def __init__(self, localfit, start_points=10): 113 self.localfit = localfit 114 self.start_points = start_points 115 109 116 def _fit(self, objective, x0, bounds): 110 117 """ … … 391 398 if handler == None: 392 399 handler = fitresult.ConsoleUpdate(improvement_delta=0.1) 393 result = fit.fit(self.problem, fitter=fitter, handler=handler) 394 self.problem.all_results(result) 395 396 #print "park------", result.inputs 397 #for (model, data) in result.inputs: 398 # print model.name, data.name 399 #for p in result.parameters: 400 # print "simul ----", p , p.__class__, p.model.name, p.data.name 401 400 try: 401 result = fit.fit(self.problem, fitter=fitter, handler=handler) 402 self.problem.all_results(result) 403 except LinAlgError: 404 raise ValueError, "SVD did not converge" 405 402 406 if result != None: 403 407 if q != None:
Note: See TracChangeset
for help on using the changeset viewer.