Changeset 1511c37c in sasmodels for sasmodels/models/bcc_paracrystal.py


Ignore:
Timestamp:
Aug 1, 2017 5:29:07 PM (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:
8f04da4
Parents:
31df0c9
Message:

tuned random model generation for more models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/bcc_paracrystal.py

    r0bdddc2 r1511c37c  
    140140    # useful between 0.01 and 0.7.  Use an exponential distribution 
    141141    # in this range 'cuz its easy. 
     142    radius = 10**np.random.uniform(1.3, 4) 
     143    d_factor = 10**np.random.uniform(-2, -0.7)  # sigma_d in 0.01-0.7 
    142144    dnn_fraction = np.random.beta(a=10, b=1) 
     145    dnn = radius*4/np.sqrt(3)/dnn_fraction 
    143146    pars = dict( 
    144147        #sld=1, sld_solvent=0, scale=1, background=1e-32, 
    145         radius=10**np.random.uniform(1.3, 4), 
    146         d_factor=10**np.random.uniform(-2, -0.7),  # sigma_d in 0.01-0.7 
     148        dnn=dnn, 
     149        d_factor=d_factor, 
     150        radius=radius, 
    147151    ) 
    148     pars['dnn'] = pars['radius']*4/np.sqrt(3)/dnn_fraction 
    149     #pars['scale'] = 1/(0.68*dnn_fraction**3)  # bcc packing fraction is 0.68 
    150     pars['scale'] = 1 
    151152    return pars 
    152153 
    153 # parameters for demo 
    154 demo = dict( 
    155     scale=1, background=0, 
    156     dnn=220, d_factor=0.06, sld=4, sld_solvent=1, 
    157     radius=40, 
    158     theta=60, phi=60, psi=60, 
    159     radius_pd=.2, radius_pd_n=2, 
    160     theta_pd=15, theta_pd_n=0, 
    161     phi_pd=15, phi_pd_n=0, 
    162     psi_pd=15, psi_pd_n=0, 
    163     ) 
    164154# april 6 2017, rkh add unit tests, NOT compared with any other calc method, assume correct! 
    165155# add 2d test later 
     
    168158    [{ }, 
    169159     [0.001, q, 0.215268], [1.46601394721, 2.85851284174, 0.00866710287078]], 
    170     [{'theta':20.0,'phi':30,'psi':40.0},(-0.017,0.035),2082.20264399 ], 
    171     [{'theta':20.0,'phi':30,'psi':40.0},(-0.081,0.011),0.436323144781 ] 
     160    [{'theta': 20.0, 'phi': 30, 'psi': 40.0}, (-0.017, 0.035), 2082.20264399], 
     161    [{'theta': 20.0, 'phi': 30, 'psi': 40.0}, (-0.081, 0.011), 0.436323144781], 
    172162    ] 
Note: See TracChangeset for help on using the changeset viewer.