Changeset 8f04da4 in sasmodels for sasmodels/models/fractal_core_shell.py


Ignore:
Timestamp:
Aug 2, 2017 2:53:56 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:
bd21b12
Parents:
1511c37c
Message:

tuned random model generation for more models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/fractal_core_shell.py

    r1511c37c r8f04da4  
    100100def random(): 
    101101    import numpy as np 
    102     total_radius = 10**np.random.uniform(0.7, 4) 
    103     core_portion = np.random.uniform(0, 1) 
    104     radius = total_radius * core_portion 
    105     thickness = total_radius - radius 
    106     #radius = 5 
    107     cor_length = 10**np.random.uniform(0.7, 2)*radius 
    108     #cor_length = 20*radius 
     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 
    109108    volfraction = 10**np.random.uniform(-3, -1) 
    110     #volfraction = 0.05 
    111109    fractal_dim = 2*np.random.beta(3, 4) + 1 
    112     #fractal_dim = 2 
    113110    pars = dict( 
    114111        #background=0, sld_block=1, sld_solvent=0, 
     
    119116    ) 
    120117    return pars 
    121  
    122118 
    123119demo = dict(scale=0.05, 
Note: See TracChangeset for help on using the changeset viewer.