Changeset 232bb12 in sasmodels for sasmodels/models/porod.py


Ignore:
Timestamp:
Aug 4, 2017 1:21:11 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:
bb39b4a
Parents:
9f6823b
Message:

tuned random model generation for models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/porod.py

    r4962519 r232bb12  
    4545Iq.vectorized = True  # Iq accepts an array of q values 
    4646 
     47def random(): 
     48    import numpy as np 
     49    sld, solvent = np.random.uniform(-0.5, 12, size=2) 
     50    radius = 10**np.random.uniform(1, 4.7) 
     51    Vf = 10**np.random.uniform(-3, -1) 
     52    scale = 1e-4 * Vf * 2*np.pi*(sld-solvent)**2/(3*radius) 
     53    pars = dict( 
     54        scale=scale, 
     55    ) 
     56    return pars 
     57 
    4758demo = dict(scale=1.5, background=0.5) 
    4859 
Note: See TracChangeset for help on using the changeset viewer.