Changeset bd49c79 in sasmodels for sasmodels/compare.py
- Timestamp:
- Aug 4, 2016 2:47:27 PM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 54bcd4a
- Parents:
- e1d6983
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare.py
rf67f26c rbd49c79 348 348 nsigma=pars.get(p.id+"_pd_nsgima", 3.), 349 349 pdtype=pars.get(p.id+"_pd_type", 'gaussian'), 350 relative_pd=p.relative_pd, 350 351 ) 351 352 lines.append(_format_par(p.name, **fields)) … … 354 355 #return "\n".join("%s: %s"%(p, v) for p, v in sorted(pars.items())) 355 356 356 def _format_par(name, value=0., pd=0., n=0, nsigma=3., pdtype='gaussian'): 357 def _format_par(name, value=0., pd=0., n=0, nsigma=3., pdtype='gaussian', 358 relative_pd=False): 357 359 # type: (str, float, float, int, float, str) -> str 358 360 line = "%s: %g"%(name, value) 359 361 if pd != 0. and n != 0: 362 if relative_pd: 363 pd *= value 360 364 line += " +/- %g (%d points in [-%g,%g] sigma %s)"\ 361 365 % (pd, n, nsigma, nsigma, pdtype) … … 446 450 Sasview calculator for model. 447 451 """ 448 # For multiplicity models, recreate the model the first time the 449 if model_info.control: 450 model[0] = ModelClass(int(pars[model_info.control])) 452 oldpars = revert_pars(model_info, pars) 453 # For multiplicity models, create a model with the correct multiplicity 454 control = oldpars.pop("CONTROL", None) 455 if control is not None: 456 # sphericalSLD has one fewer multiplicity. This update should 457 # happen in revert_pars, but it hasn't been called yet. 458 model[0] = ModelClass(control) 451 459 # paying for parameter conversion each time to keep life simple, if not fast 452 oldpars = revert_pars(model_info, pars)453 460 #print("sasview pars",oldpars) 454 461 for k, v in oldpars.items():
Note: See TracChangeset
for help on using the changeset viewer.