Changeset 3c24ccd in sasmodels for sasmodels/compare.py


Ignore:
Timestamp:
Oct 18, 2017 10:03:43 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
ef8e68c
Parents:
fbb9397
Message:

add -weights option to sascomp to show dispersity distribution

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/compare.py

    rfbb9397 r3c24ccd  
    4242from . import exception 
    4343from .data import plot_theory, empty_data1D, empty_data2D, load_data 
    44 from .direct_model import DirectModel 
     44from .direct_model import DirectModel, get_mesh 
    4545from .convert import revert_name, revert_pars, constrain_new_to_old 
    4646from .generate import FLOAT_RE 
     47from .weights import plot_weights 
    4748 
    4849try: 
     
    102103    -abs/-rel* plot relative or absolute error 
    103104    -title="note" adds note to the plot title, after the model name 
     105    -weights shows weights plots for the polydisperse parameters 
    104106 
    105107    === output options === 
     
    834836        if opts['plot']: 
    835837            limits = plot_models(opts, result, limits=limits, setnum=k) 
     838        if opts['show_weights']: 
     839            base, _ = opts['engines'] 
     840            base_pars, _ = opts['pars'] 
     841            model_info = base._kernel.info 
     842            dim = base._kernel.dim 
     843            plot_weights(model_info, get_mesh(model_info, base_pars, dim=dim)) 
    836844    if opts['plot']: 
    837845        import matplotlib.pyplot as plt 
     
    9961004OPTIONS = [ 
    9971005    # Plotting 
    998     'plot', 'noplot', 
     1006    'plot', 'noplot', 'weights', 
    9991007    'linear', 'log', 'q4', 
    10001008    'rel', 'abs', 
     
    11461154        'engine'    : 'default', 
    11471155        'evals'     : '1', 
     1156        'show_weights' : False, 
    11481157    } 
    11491158    for arg in flags: 
     
    11941203        elif arg == '-demo':    opts['use_demo'] = True 
    11951204        elif arg == '-default': opts['use_demo'] = False 
     1205        elif arg == '-weights': opts['show_weights'] = True 
    11961206        elif arg == '-html':    opts['html'] = True 
    11971207        elif arg == '-help':    opts['html'] = True 
Note: See TracChangeset for help on using the changeset viewer.