Ignore:
Timestamp:
Sep 5, 2017 11:01:03 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:
8db25bf
Parents:
acc6c8f (diff), 142a8e2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ticket-776-orientation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/core_shell_ellipsoid.py

    r2a0b2b1 r9bc4882  
    150150    return ellipsoid_ER(polar_outer, equat_outer) 
    151151 
    152  
    153 demo = dict(scale=0.05, background=0.001, 
    154             radius_equat_core=20.0, 
    155             x_core=3.0, 
    156             thick_shell=30.0, 
    157             x_polar_shell=1.0, 
    158             sld_core=2.0, 
    159             sld_shell=1.0, 
    160             sld_solvent=6.3, 
    161             theta=0, 
    162             phi=0) 
     152def random(): 
     153    import numpy as np 
     154    V = 10**np.random.uniform(5, 12) 
     155    outer_polar = 10**np.random.uniform(1.3, 4) 
     156    outer_equatorial = np.sqrt(V/outer_polar) # ignore 4/3 pi 
     157    # Use a distribution with a preference for thin shell or thin core 
     158    # Avoid core,shell radii < 1 
     159    thickness_polar = np.random.beta(0.5, 0.5)*(outer_polar-2) + 1 
     160    thickness_equatorial = np.random.beta(0.5, 0.5)*(outer_equatorial-2) + 1 
     161    radius_polar = outer_polar - thickness_polar 
     162    radius_equatorial = outer_equatorial - thickness_equatorial 
     163    x_core = radius_polar/radius_equatorial 
     164    x_polar_shell = thickness_polar/thickness_equatorial 
     165    pars = dict( 
     166        #background=0, sld=0, sld_solvent=1, 
     167        radius_equat_core=radius_equatorial, 
     168        x_core=x_core, 
     169        thick_shell=thickness_equatorial, 
     170        x_polar_shell=x_polar_shell, 
     171    ) 
     172    return pars 
    163173 
    164174q = 0.1 
Note: See TracChangeset for help on using the changeset viewer.