Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/elliptical_cylinder.py

    rfcb33e4 r9802ab3  
    5757define the axis of the cylinder using two angles $\theta$, $\phi$ and $\Psi$ 
    5858(see :ref:`cylinder orientation <cylinder-angle-definition>`). The angle 
    59 $\Psi$ is the rotational angle around its own long_c axis against the $q$ plane. 
    60 For example, $\Psi = 0$ when the $r_\text{minor}$ axis is parallel to the 
    61 $x$ axis of the detector. 
     59$\Psi$ is the rotational angle around its own long_c axis.  
    6260 
    6361All angle parameters are valid and given only for 2D calculation; ie, an 
    6462oriented system. 
    6563 
    66 .. figure:: img/elliptical_cylinder_angle_definition.jpg 
     64.. figure:: img/elliptical_cylinder_angle_definition.png 
    6765 
    68     Definition of angles for 2D 
     66    Definition of angles for oriented elliptical cylinder, where axis_ratio is drawn >1, 
     67    and angle $\Psi$ is now a rotation around the axis of the cylinder. 
    6968 
    70 .. figure:: img/cylinder_angle_projection.jpg 
     69.. figure:: img/elliptical_cylinder_angle_projection.png 
    7170 
    7271    Examples of the angles for oriented elliptical cylinders against the 
    73     detector plane. 
     72    detector plane, with $\Psi$ = 0. 
     73 
     74The $\theta$ and $\phi$ parameters to orient the cylinder only appear in the model when fitting 2d data.  
     75On introducing "Orientational Distribution" in the angles, "distribution of theta" and "distribution of phi" parameters will 
     76appear. These are actually rotations about the axes $\delta_1$ and $\delta_2$ of the cylinder, the $b$ and $a$ axes of the  
     77cylinder cross section. (When $\theta = \phi = 0$ these are parallel to the $Y$ and $X$ axes of the instrument.)  
     78The third orientation distribution, in $\psi$, is about the $c$ axis of the particle. Some experimentation may be required to  
     79understand the 2d patterns fully. (Earlier implementations had numerical integration issues in some circumstances when orientation  
     80distributions passed through 90 degrees, such situations, with very broad distributions, should still be approached with care.)  
    7481 
    7582NB: The 2nd virial coefficient of the cylinder is calculated based on the 
     
    108115""" 
    109116 
    110 from numpy import pi, inf, sqrt 
     117from numpy import pi, inf, sqrt, sin, cos 
    111118 
    112119name = "elliptical_cylinder" 
     
    125132              ["sld",         "1e-6/Ang^2", 4.0,   [-inf, inf], "sld",         "Cylinder scattering length density"], 
    126133              ["sld_solvent", "1e-6/Ang^2", 1.0,   [-inf, inf], "sld",         "Solvent scattering length density"], 
    127               ["theta",       "degrees",    90.0,  [-360, 360], "orientation", "In plane angle"], 
    128               ["phi",         "degrees",    0,     [-360, 360], "orientation", "Out of plane angle"], 
    129               ["psi",         "degrees",    0,     [-360, 360], "orientation", "Major axis angle relative to Q"]] 
     134              ["theta",       "degrees",    90.0,  [-360, 360], "orientation", "cylinder axis to beam angle"], 
     135              ["phi",         "degrees",    0,     [-360, 360], "orientation", "rotation about beam"], 
     136              ["psi",         "degrees",    0,     [-360, 360], "orientation", "rotation about cylinder axis"]] 
    130137 
    131138# pylint: enable=bad-whitespace, line-too-long 
     
    149156                           + (length + radius) * (length + pi * radius)) 
    150157    return 0.5 * (ddd) ** (1. / 3.) 
     158q = 0.1 
     159# april 6 2017, rkh added a 2d unit test, NOT READY YET pull #890 branch assume correct! 
     160qx = q*cos(pi/6.0) 
     161qy = q*sin(pi/6.0) 
    151162 
    152163tests = [ 
     
    158169      'sld_solvent':1.0, 'background':0.0}, 
    159170     0.001, 675.504402], 
     171#    [{'theta':80., 'phi':10.}, (qx, qy), 7.88866563001 ], 
    160172] 
Note: See TracChangeset for help on using the changeset viewer.