Changeset bd49c79 in sasmodels
- Timestamp:
- Aug 4, 2016 4: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
- Location:
- sasmodels
- Files:
-
- 2 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(): -
sasmodels/convert.py
r0dd4199 rbd49c79 159 159 # Remove control parameter from the result 160 160 if model_info.control: 161 translation[model_info.control] = None161 translation[model_info.control] = "CONTROL" 162 162 return translation 163 163 … … 191 191 oldpars = _trim_vectors(model_info, pars, oldpars) 192 192 193 # Make sure the control parameter is an integer 194 if "CONTROL" in oldpars: 195 oldpars["CONTROL"] = int(oldpars["CONTROL"]) 193 196 194 197 # Note: update compare.constrain_pars to match
Note: See TracChangeset
for help on using the changeset viewer.