Changeset 4553dae in sasmodels


Ignore:
Timestamp:
Aug 7, 2017 11:00:01 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
92708d8
Parents:
0f6c41c
Message:

don't generate psi dispersity if shape has rotational symmetry

Location:
sasmodels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/compare.py

    r0f6c41c r4553dae  
    402402            pars['phi_pd_n'] = 5 
    403403        if np.random.rand() < 0.1: 
    404             pars['psi_pd_n'] = 5 
     404            if any(p.name == 'psi' for p in model_info.parameters.kernel_parameters): 
     405                #print("generating psi_pd_n") 
     406                pars['psi_pd_n'] = 5 
    405407 
    406408    ## Show selected polydispersity 
     
    543545    """ 
    544546    pars = pars.copy() 
     547    #print("pars=", pars) 
    545548    if suppress: 
    546549        for p in pars: 
     
    552555        for p in pars: 
    553556            if p.endswith("_pd_n"): 
    554                 any_pd |= (pars[p] != 0 and pars[p[:-2]] != 0.) 
     557                pd = pars.get(p[:-2], 0.) 
     558                any_pd |= (pars[p] != 0 and pd != 0.) 
    555559                if first_pd is None: 
    556560                    first_pd = p 
     
    558562            if pars[first_pd] == 0: 
    559563                pars[first_pd] = 35 
    560             if pars[first_pd[:-2]] == 0: 
     564            if first_pd[:-2] not in pars or pars[first_pd[:-2]] == 0: 
    561565                pars[first_pd[:-2]] = 0.15 
    562566    return pars 
  • sasmodels/models/mass_fractal.py

    r232bb12 r4553dae  
    9292    radius = 10**np.random.uniform(0.7, 4) 
    9393    cutoff_length = 10**np.random.uniform(0.7, 2)*radius 
    94     # TODO: fractal dimension should range from 1 to 5 
     94    # TODO: fractal dimension should range from 1 to 6 
    9595    fractal_dim_mass = 2*np.random.beta(3, 4) + 1 
    9696    Vf = 10**np.random.uniform(-4, -1) 
Note: See TracChangeset for help on using the changeset viewer.