Ignore:
Timestamp:
Sep 5, 2017 11:40:09 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:
30b60d2
Parents:
a53bf6b (diff), 142a8e2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ticket-510

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/core_shell_ellipsoid.py

    r17fb550 r64eecf7  
    2525ellipsoid. This may have some undesirable effects if the aspect ratio of the 
    2626ellipsoid is large (ie, if $X << 1$ or $X >> 1$ ), when the $S(q)$ 
    27 - which assumes spheres - will not in any case be valid.  Generating a  
    28 custom product model will enable separate effective volume fraction and effective  
     27- which assumes spheres - will not in any case be valid.  Generating a 
     28custom product model will enable separate effective volume fraction and effective 
    2929radius in the $S(q)$. 
    3030 
     
    4646    :nowrap: 
    4747 
    48     \begin{align}     
     48    \begin{align} 
    4949    F(q,\alpha) = &f(q,radius\_equat\_core,radius\_equat\_core.x\_core,\alpha) \\ 
    5050    &+ f(q,radius\_equat\_core + thick\_shell,radius\_equat\_core.x\_core + thick\_shell.x\_polar\_shell,\alpha) 
    51     \end{align}  
     51    \end{align} 
    5252 
    5353where 
    54   
     54 
    5555.. math:: 
    5656 
     
    7979   F^2(q)=\int_{0}^{\pi/2}{F^2(q,\alpha)\sin(\alpha)d\alpha} 
    8080 
     81For oriented ellipsoids the *theta*, *phi* and *psi* orientation parameters will appear when fitting 2D data, 
     82see the :ref:`elliptical-cylinder` model for further information. 
    8183 
    8284References 
     
    134136    ["sld_shell",     "1e-6/Ang^2", 1,   [-inf, inf], "sld",         "Shell scattering length density"], 
    135137    ["sld_solvent",   "1e-6/Ang^2", 6.3, [-inf, inf], "sld",         "Solvent scattering length density"], 
    136     ["theta",         "degrees",    0,   [-inf, inf], "orientation", "Oblate orientation wrt incoming beam"], 
    137     ["phi",           "degrees",    0,   [-inf, inf], "orientation", "Oblate orientation in the plane of the detector"], 
     138    ["theta",         "degrees",    0,   [-360, 360], "orientation", "elipsoid axis to beam angle"], 
     139    ["phi",           "degrees",    0,   [-360, 360], "orientation", "rotation about beam"], 
    138140    ] 
    139141# pylint: enable=bad-whitespace, line-too-long 
     
    151153    return ellipsoid_ER(polar_outer, equat_outer) 
    152154 
    153  
    154 demo = dict(scale=0.05, background=0.001, 
    155             radius_equat_core=20.0, 
    156             x_core=3.0, 
    157             thick_shell=30.0, 
    158             x_polar_shell=1.0, 
    159             sld_core=2.0, 
    160             sld_shell=1.0, 
    161             sld_solvent=6.3, 
    162             theta=0, 
    163             phi=0) 
     155def random(): 
     156    import numpy as np 
     157    V = 10**np.random.uniform(5, 12) 
     158    outer_polar = 10**np.random.uniform(1.3, 4) 
     159    outer_equatorial = np.sqrt(V/outer_polar) # ignore 4/3 pi 
     160    # Use a distribution with a preference for thin shell or thin core 
     161    # Avoid core,shell radii < 1 
     162    thickness_polar = np.random.beta(0.5, 0.5)*(outer_polar-2) + 1 
     163    thickness_equatorial = np.random.beta(0.5, 0.5)*(outer_equatorial-2) + 1 
     164    radius_polar = outer_polar - thickness_polar 
     165    radius_equatorial = outer_equatorial - thickness_equatorial 
     166    x_core = radius_polar/radius_equatorial 
     167    x_polar_shell = thickness_polar/thickness_equatorial 
     168    pars = dict( 
     169        #background=0, sld=0, sld_solvent=1, 
     170        radius_equat_core=radius_equatorial, 
     171        x_core=x_core, 
     172        thick_shell=thickness_equatorial, 
     173        x_polar_shell=x_polar_shell, 
     174    ) 
     175    return pars 
    164176 
    165177q = 0.1 
Note: See TracChangeset for help on using the changeset viewer.