Changeset 64eecf7 in sasmodels for sasmodels/models/fractal_core_shell.py


Ignore:
Timestamp:
Sep 5, 2017 9:40:09 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:
30b60d2
Parents:
a53bf6b (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-510

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/fractal_core_shell.py

    refb7615 r64eecf7  
    9898          "lib/fractal_sq.c", "fractal_core_shell.c"] 
    9999 
     100def random(): 
     101    import numpy as np 
     102    outer_radius = 10**np.random.uniform(0.7, 4) 
     103    # Use a distribution with a preference for thin shell or thin core 
     104    # Avoid core,shell radii < 1 
     105    thickness = np.random.beta(0.5, 0.5)*(outer_radius-2) + 1 
     106    radius = outer_radius - thickness 
     107    cor_length = 10**np.random.uniform(0.7, 2)*outer_radius 
     108    volfraction = 10**np.random.uniform(-3, -1) 
     109    fractal_dim = 2*np.random.beta(3, 4) + 1 
     110    pars = dict( 
     111        #background=0, sld_block=1, sld_solvent=0, 
     112        volfraction=volfraction, 
     113        radius=radius, 
     114        cor_length=cor_length, 
     115        fractal_dim=fractal_dim, 
     116    ) 
     117    return pars 
     118 
    100119demo = dict(scale=0.05, 
    101120            background=0, 
Note: See TracChangeset for help on using the changeset viewer.