Changeset 48462b0 in sasmodels for sasmodels/models/vesicle.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/vesicle.py

    r925ad6e r48462b0  
    120120    return whole, whole - core 
    121121 
     122def random(): 
     123    import numpy as np 
     124    total_radius = 10**np.random.uniform(1.3, 5) 
     125    radius = total_radius * np.random.uniform(0, 1) 
     126    thickness = total_radius - radius 
     127    volfraction = 10**np.random.uniform(-3, -1) 
     128    pars = dict( 
     129        #background=0, 
     130        scale=1,  # volfraction is part of the model, so scale=1 
     131        radius=radius, 
     132        thickness=thickness, 
     133        volfraction=volfraction, 
     134    ) 
     135    return pars 
    122136 
    123137# parameters for demo 
Note: See TracChangeset for help on using the changeset viewer.