Changeset 404ebbd in sasmodels for sasmodels/models/mass_fractal.py


Ignore:
Timestamp:
Jul 30, 2017 12:56:22 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:
48462b0
Parents:
a151caa
Message:

tuned random model generation for more models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/mass_fractal.py

    r925ad6e r404ebbd  
    8888source = ["lib/sas_3j1x_x.c", "lib/sas_gamma.c", "mass_fractal.c"] 
    8989 
     90def random(): 
     91    import numpy as np 
     92    radius = 10**np.random.uniform(0.7, 4) 
     93    cutoff_length = 10**np.random.uniform(0.7, 2)*radius 
     94    fractal_dim_mass = 2*np.random.beta(3, 4) + 1 
     95    Vf = 10**np.random.uniform(-4, -1) 
     96    pars = dict( 
     97        #background=0, 
     98        scale=1, #1e5*Vf/radius**(fractal_dim_mass), 
     99        radius=radius, 
     100        cutoff_length=cutoff_length, 
     101        fractal_dim_mass=fractal_dim_mass, 
     102    ) 
     103    return pars 
     104 
    90105demo = dict(scale=1, background=0, 
    91106            radius=10.0, 
Note: See TracChangeset for help on using the changeset viewer.