Ignore:
Timestamp:
Nov 29, 2017 11:13:23 AM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
237b800f
Parents:
a839b22
Message:

lint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/core_shell_ellipsoid.py

    r8db25bf r2d81cfe  
    2626ellipsoid is large (ie, if $X << 1$ or $X >> 1$ ), when the $S(q)$ 
    2727- which assumes spheres - will not in any case be valid.  Generating a 
    28 custom product model will enable separate effective volume fraction and effective 
    29 radius in the $S(q)$. 
     28custom product model will enable separate effective volume fraction and 
     29effective radius in the $S(q)$. 
    3030 
    3131If SAS data are in absolute units, and the SLDs are correct, then scale should 
    3232be the total volume fraction of the "outer particle". When $S(q)$ is introduced 
    33 this moves to the $S(q)$ volume fraction, and scale should then be 1.0, 
    34 or contain some other units conversion factor (for example, if you have SAXS data). 
    35  
    36 The calculation of intensity follows that for the solid ellipsoid, but with separate 
    37 terms for the core-shell and shell-solvent boundaries. 
     33this moves to the $S(q)$ volume fraction, and scale should then be 1.0, or 
     34contain some other units conversion factor (for example, if you have SAXS data). 
     35 
     36The calculation of intensity follows that for the solid ellipsoid, but 
     37with separate terms for the core-shell and shell-solvent boundaries. 
    3838 
    3939.. math:: 
     
    4848    \begin{align*} 
    4949    F(q,\alpha) = &f(q,radius\_equat\_core,radius\_equat\_core.x\_core,\alpha) \\ 
    50     &+ f(q,radius\_equat\_core + thick\_shell,radius\_equat\_core.x\_core + thick\_shell.x\_polar\_shell,\alpha) 
     50    &+ f(q,radius\_equat\_core + thick\_shell, 
     51         radius\_equat\_core.x\_core + thick\_shell.x\_polar\_shell,\alpha) 
    5152    \end{align*} 
    5253 
     
    6869 
    6970$\alpha$ is the angle between the axis of the ellipsoid and $\vec q$, 
    70 $V = (4/3)\pi R_pR_e^2$ is the volume of the ellipsoid , $R_p$ is the polar radius along the 
    71 rotational axis of the ellipsoid, $R_e$ is the equatorial radius perpendicular 
    72 to the rotational axis of the ellipsoid and $\Delta \rho$ (contrast) is the 
    73 scattering length density difference, either $(sld\_core - sld\_shell)$ or $(sld\_shell - sld\_solvent)$. 
     71$V = (4/3)\pi R_pR_e^2$ is the volume of the ellipsoid , $R_p$ is the 
     72polar radius along the rotational axis of the ellipsoid, $R_e$ is the 
     73equatorial radius perpendicular to the rotational axis of the ellipsoid 
     74and $\Delta \rho$ (contrast) is the scattering length density difference, 
     75either $(sld\_core - sld\_shell)$ or $(sld\_shell - sld\_solvent)$. 
    7476 
    7577For randomly oriented particles: 
     
    7981   F^2(q)=\int_{0}^{\pi/2}{F^2(q,\alpha)\sin(\alpha)d\alpha} 
    8082 
    81 For oriented ellipsoids the *theta*, *phi* and *psi* orientation parameters will appear when fitting 2D data, 
    82 see the :ref:`elliptical-cylinder` model for further information. 
     83For oriented ellipsoids the *theta*, *phi* and *psi* orientation parameters 
     84will appear when fitting 2D data, see the :ref:`elliptical-cylinder` model 
     85for further information. 
    8386 
    8487References 
     
    9497* **Last Modified by:** Richard Heenan (reparametrised model) **Date:** 2015 
    9598* **Last Reviewed by:** Richard Heenan **Date:** October 6, 2016 
    96  
    9799""" 
    98100 
     101import numpy as np 
    99102from numpy import inf, sin, cos, pi 
    100103 
     
    153156 
    154157def random(): 
    155     import numpy as np 
    156     V = 10**np.random.uniform(5, 12) 
     158    volume = 10**np.random.uniform(5, 12) 
    157159    outer_polar = 10**np.random.uniform(1.3, 4) 
    158     outer_equatorial = np.sqrt(V/outer_polar) # ignore 4/3 pi 
     160    outer_equatorial = np.sqrt(volume/outer_polar) # ignore 4/3 pi 
    159161    # Use a distribution with a preference for thin shell or thin core 
    160162    # Avoid core,shell radii < 1 
     
    180182# 11Jan2017 RKH sorted tests after redefinition of angles 
    181183tests = [ 
    182      # Accuracy tests based on content in test/utest_coreshellellipsoidXTmodel.py 
     184    # Accuracy tests based on content in test/utest_coreshellellipsoidXTmodel.py 
    183185    [{'radius_equat_core': 200.0, 
    184186      'x_core': 0.1, 
     
    206208     }, 0.01, 8688.53], 
    207209 
    208    # 2D tests 
    209    [{'background': 0.001, 
    210      'theta': 90.0, 
    211      'phi': 0.0, 
     210    # 2D tests 
     211    [{'background': 0.001, 
     212      'theta': 90.0, 
     213      'phi': 0.0, 
    212214     }, (0.4, 0.5), 0.00690673], 
    213215 
    214    [{'radius_equat_core': 20.0, 
     216    [{'radius_equat_core': 20.0, 
    215217      'x_core': 200.0, 
    216218      'thick_shell': 54.0, 
     
    224226      'phi': 0.0, 
    225227     }, (qx, qy), 0.01000025], 
    226     ] 
     228] 
Note: See TracChangeset for help on using the changeset viewer.