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


Ignore:
Timestamp:
Aug 2, 2017 12: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/core_shell_sphere.py

    r31df0c9 r8f04da4  
    101101def random(): 
    102102    import numpy as np 
    103     total_radius = 10**np.random.uniform(1.3, 4.3) 
    104     radius = np.random.uniform(0, 1)*total_radius 
    105     thickness = total_radius - radius 
     103    outer_radius = 10**np.random.uniform(1.3, 4.3) 
     104    # Use a distribution with a preference for thin shell or thin core 
     105    # Avoid core,shell radii < 1 
     106    radius = np.random.beta(0.5, 0.5)*(outer_radius-2) + 1 
     107    thickness = outer_radius - core 
    106108    pars = dict( 
    107109        radius=radius, 
     
    112114tests = [ 
    113115    [{'radius': 20.0, 'thickness': 10.0}, 'ER', 30.0], 
    114      # TODO: VR test suppressed until we sort out new product model 
    115      # and determine what to do with volume ratio. 
    116      #[{'radius': 20.0, 'thickness': 10.0}, 'VR', 0.703703704], 
     116    # TODO: VR test suppressed until we sort out new product model 
     117    # and determine what to do with volume ratio. 
     118    #[{'radius': 20.0, 'thickness': 10.0}, 'VR', 0.703703704], 
    117119 
    118      # The SasView test result was 0.00169, with a background of 0.001 
    119      [{'radius': 60.0, 'thickness': 10.0, 'sld_core': 1.0, 'sld_shell':2.0, 
    120        'sld_solvent':3.0, 'background':0.0}, 
    121       0.4, 0.000698838], 
     120    # The SasView test result was 0.00169, with a background of 0.001 
     121    [{'radius': 60.0, 'thickness': 10.0, 'sld_core': 1.0, 'sld_shell': 2.0, 
     122      'sld_solvent': 3.0, 'background': 0.0}, 0.4, 0.000698838], 
    122123] 
Note: See TracChangeset for help on using the changeset viewer.