Changeset 404ebbd in sasmodels for sasmodels/models/ellipsoid.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/ellipsoid.py

    r9b79f29 r404ebbd  
    22# Note: model title and parameter table are inserted automatically 
    33r""" 
    4 The form factor is normalized by the particle volume  
     4The form factor is normalized by the particle volume 
    55 
    66Definition 
     
    119119* **Last Modified by:** Paul Kienzle **Date:** March 22, 2017 
    120120""" 
     121from __future__ import division 
    121122 
    122123from numpy import inf, sin, cos, pi 
     
    177178    delta = 0.75 * b1 * b2 
    178179 
    179     ddd = np.zeros_like(radius_polar) 
     180    #ddd = np.zeros_like(radius_polar) 
    180181    ddd[valid] = 2.0 * (delta + 1.0) * radius_polar * radius_equatorial ** 2 
    181182    return 0.5 * ddd ** (1.0 / 3.0) 
    182183 
     184def random(): 
     185    import numpy as np 
     186    V = 10**np.random.uniform(4, 12) 
     187    radius_polar = 10**np.random.uniform(1.3, 4) 
     188    radius_equatorial = np.sqrt(V/radius_polar) # ignore 4/3 pi 
     189    Vf = 10**np.random.uniform(-4, -2) 
     190    pars = dict( 
     191        #background=0, sld=0, sld_solvent=1, 
     192        scale=1e9*Vf/V, 
     193        radius_polar=radius_polar, 
     194        radius_equatorial=radius_equatorial, 
     195    ) 
     196    return pars 
    183197 
    184198demo = dict(scale=1, background=0, 
Note: See TracChangeset for help on using the changeset viewer.