Changeset 8f04da4 in sasmodels for sasmodels/models/hollow_cylinder.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/hollow_cylinder.py

    r31df0c9 r8f04da4  
    123123def random(): 
    124124    import numpy as np 
    125     length = 10**np.random.uniform(2, 6) 
    126     radius = 10**np.random.uniform(1, 3) 
    127     kuhn_length = 10**np.random.uniform(-2, -0.7)*length  # at least 10 segments 
     125    length = 10**np.random.uniform(1, 4.7) 
     126    outer_radius = 10**np.random.uniform(1, 4.7) 
     127    # Use a distribution with a preference for thin shell or thin core 
     128    # Avoid core,shell radii < 1 
     129    thickness = np.random.beta(0.5, 0.5)*(outer_radius-2) + 1 
     130    radius = outer_radius - thickness 
    128131    pars = dict( 
    129132        length=length, 
    130133        radius=radius, 
    131         kuhn_length=kuhn_length, 
     134        thickness=thickness, 
    132135    ) 
    133136    return pars 
    134137 
     138# parameters for demo 
     139demo = dict(scale=1.0, background=0.0, length=400.0, radius=20.0, 
     140            thickness=10, sld=6.3, sld_solvent=1, theta=90, phi=0, 
     141            thickness_pd=0.2, thickness_pd_n=9, 
     142            length_pd=.2, length_pd_n=10, 
     143            radius_pd=.2, radius_pd_n=9, 
     144            theta_pd=10, theta_pd_n=5, 
     145           ) 
    135146q = 0.1 
    136147# april 6 2017, rkh added a 2d unit test, assume correct! 
Note: See TracChangeset for help on using the changeset viewer.