Changeset 48462b0 in sasmodels for sasmodels/models/guinier_porod.py


Ignore:
Timestamp:
Jul 30, 2017 11:24:42 PM (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:
109d963
Parents:
404ebbd
Message:

tuned random model generation for even more models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/guinier_porod.py

    rcdcebf1 r48462b0  
    44and dimensionality of scattering objects, including asymmetric objects 
    55such as rods or platelets, and shapes intermediate between spheres 
    6 and rods or between rods and platelets, and overcomes some of the  
     6and rods or between rods and platelets, and overcomes some of the 
    77deficiencies of the (Beaucage) Unified_Power_Rg model (see Hammouda, 2010). 
    88 
     
    7777                        scale = Guinier Scale 
    7878                        s = Dimension Variable 
    79                         Rg = Radius of Gyration [A]  
     79                        Rg = Radius of Gyration [A] 
    8080                        porod_exp = Porod Exponent 
    8181                        background  = Background [1/cm]""" 
     
    114114Iq.vectorized = True # Iq accepts an array of q values 
    115115 
     116def random(): 
     117    import numpy as np 
     118    rg = 10**np.random.uniform(1, 5) 
     119    s = np.random.uniform(0, 3) 
     120    porod_exp = s + np.random.uniform(0, 3) 
     121    pars = dict( 
     122        #scale=1, background=0, 
     123        rg=rg, 
     124        s=s, 
     125        porod_exp=porod_exp, 
     126    ) 
     127    return pars 
     128 
    116129demo = dict(scale=1.5, background=0.5, rg=60, s=1.0, porod_exp=3.0) 
    117130 
Note: See TracChangeset for help on using the changeset viewer.