Changeset 404ebbd in sasmodels for sasmodels/models/fcc_paracrystal.py


Ignore:
Timestamp:
Jul 30, 2017 12:56:22 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:
48462b0
Parents:
a151caa
Message:

tuned random model generation for more models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/fcc_paracrystal.py

    r69e1afc r404ebbd  
    7878.. figure:: img/parallelepiped_angle_definition.png 
    7979 
    80     Orientation of the crystal with respect to the scattering plane, when  
     80    Orientation of the crystal with respect to the scattering plane, when 
    8181    $\theta = \phi = 0$ the $c$ axis is along the beam direction (the $z$ axis). 
    8282 
     
    119119source = ["lib/sas_3j1x_x.c", "lib/gauss150.c", "lib/sphere_form.c", "fcc_paracrystal.c"] 
    120120 
     121def random(): 
     122    import numpy as np 
     123    # Define lattice spacing as a multiple of the particle radius 
     124    # using the formulat a = 4 r/sqrt(3).  Systems which are ordered 
     125    # are probably mostly filled, so use a distribution which goes from 
     126    # zero to one, but leaving 90% of them within 80% of the 
     127    # maximum bcc packing.  Lattice distortion values are empirically 
     128    # useful between 0.01 and 0.7.  Use an exponential distribution 
     129    # in this range 'cuz its easy. 
     130    dnn_fraction = np.random.beta(a=10, b=1) 
     131    pars = dict( 
     132        #sld=1, sld_solvent=0, scale=1, background=1e-32, 
     133        radius=10**np.random.uniform(1.3, 4), 
     134        d_factor=10**np.random.uniform(-2, -0.7),  # sigma_d in 0.01-0.7 
     135    ) 
     136    pars['dnn'] = pars['radius']*4/np.sqrt(3)/dnn_fraction 
     137    #pars['scale'] = 1/(0.68*dnn_fraction**3)  # bcc packing fraction is 0.68 
     138    pars['scale'] = 1 
     139    return pars 
     140 
    121141# parameters for demo 
    122142demo = dict(scale=1, background=0, 
Note: See TracChangeset for help on using the changeset viewer.