- Timestamp:
- May 22, 2014 8:52:39 AM (11 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:
- ddfe1eb7
- Parents:
- 278e86f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sans/fit/BumpsFitting.py
rbf5e985 r5044543 62 62 Wrap SAS model as a bumps fitness object 63 63 """ 64 def __init__(self, model, data, fitted=[], constraints={}, **kw): 64 def __init__(self, model, data, fitted=[], constraints={}, 65 initial_values=None, **kw): 65 66 self.name = model.name 66 67 self.model = model.model … … 68 69 self._define_pars() 69 70 self._init_pars(kw) 71 if initial_values is not None: 72 self._reset_pars(fitted, initial_values) 70 73 self.constraints = dict(constraints) 71 74 self.set_fitted(fitted) 72 self._dirty = True 75 self.update() 76 77 def _reset_pars(self, names, values): 78 for k,v in zip(names, values): 79 self._pars[k].value = v 73 80 74 81 def _define_pars(self): … … 103 110 else: 104 111 self._pars[k].value = v 105 self.update()106 112 107 113 def set_fitted(self, param_list): … … 168 174 data=M.get_data(), 169 175 constraints=M.constraints, 170 fitted=M.pars) 176 fitted=M.pars, 177 initial_values=M.vals if reset_flag else None) 171 178 for M in self.fit_arrange_dict.values() 172 179 if M.get_to_fit()] … … 211 218 R.theory = fitness.theory() 212 219 R.residuals = fitness.residuals() 220 R.index = fitness.data.idx 213 221 R.fitter_id = self.fitter_id 214 222 # TODO: should scale stderr by sqrt(chisq/DOF) if dy is unknown
Note: See TracChangeset
for help on using the changeset viewer.