Changeset 050c2c8 in sasmodels
- Timestamp:
- Sep 27, 2016 5:23:51 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:
- 340428e
- Parents:
- f1a8811
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare.py
ra557a99 r050c2c8 38 38 from . import core 39 39 from . import kerneldll 40 from . import weights 40 41 from .data import plot_theory, empty_data1D, empty_data2D 41 42 from .direct_model import DirectModel … … 390 391 from sas.models.qsmearing import smear_selection 391 392 from sas.models.MultiplicationModel import MultiplicationModel 393 from sas.models.dispersion_models import models as dispersers 392 394 393 395 def get_model_class(name): … … 422 424 ModelClass = get_model_class(old_name) 423 425 model = [ModelClass()] 426 model[0].disperser_handles = {} 424 427 425 428 # build a smearer with which to call the model, if necessary … … 458 461 model[0] = ModelClass(control) 459 462 # paying for parameter conversion each time to keep life simple, if not fast 463 for k, v in oldpars.items(): 464 if k.endswith('.type'): 465 par = k[:-5] 466 cls = dispersers[v if v != 'rectangle' else 'rectangula'] 467 handle = cls() 468 model[0].disperser_handles[par] = handle 469 model[0].set_dispersion(par, handle) 470 460 471 #print("sasview pars",oldpars) 461 472 for k, v in oldpars.items(): 462 473 name_attr = k.split('.') # polydispersity components 463 474 if len(name_attr) == 2: 464 model[0].dispersion[name_attr[0]][name_attr[1]] = v 475 par, disp_par = name_attr 476 model[0].dispersion[par][disp_par] = v 465 477 else: 466 478 model[0].setParam(k, v)
Note: See TracChangeset
for help on using the changeset viewer.