Ignore:
Timestamp:
Sep 18, 2018 4:33:43 AM (6 years ago)
Author:
ibressler
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
16287f3
Parents:
db500cb
git-author:
Ingo Breßler <dev@…> (09/18/18 04:33:38)
git-committer:
Ingo Breßler <dev@…> (09/18/18 04:33:43)
Message:

plotPolydispersities(): use precalc. weights from SasviewModel?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py

    rdb500cb raa82f54  
    577577    # test for model being a sasmodels.sasview_model.SasviewModel? 
    578578    for name, pars in model.dispersion.items(): 
    579         if 0 == pars['width']: 
    580             continue # no actual polydispersity 
    581         disp_args = pars.copy() 
    582         disp_type = disp_args.pop('type', None) 
    583         if disp_type is None: 
    584             continue # show an error? "poly type ... not found" 
    585         disp_func = disp_models[disp_type](**disp_args) 
    586         center = model.params[name] 
    587         # same as in sasmodels.weights.Dispersion 
    588         lb = center - disp_args['nsigmas']*disp_args['width']*center 
    589         ub = center + disp_args['nsigmas']*disp_args['width']*center 
    590         arr = disp_func.get_weights(center, lb, ub, relative = True) 
     579        if 0 == pars['width']: # no actual polydispersity 
     580            continue 
     581        _, xarr, yarr = model.get_weights(name) 
     582        if xarr is None or yarr is None: # param name not found 
     583            continue 
    591584        # create Data1D as in residualsData1D() and fill x/y members 
    592585        # similar to FittingLogic._create1DPlot() but different data/axes 
    593         data1d = Data1D(x = arr[0], y = arr[1]) 
     586        data1d = Data1D(x = xarr, y = yarr) 
    594587        xunit = "" 
    595588        if name in model.details and len(model.details[name]): 
Note: See TracChangeset for help on using the changeset viewer.