Changeset a7684e5 in sasmodels for sasmodels/models/cylinder.py


Ignore:
Timestamp:
Aug 26, 2014 9:07:44 AM (10 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
ff7119b
Parents:
13d86bc
Message:

docu updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/cylinder.py

    r32c160a ra7684e5  
     1# Note: model title and parameter table are inserted automatically 
    12r""" 
    2 CylinderModel 
    3 ============= 
    4  
    5 This model provides the form factor for a right circular cylinder with uniform 
    6 scattering length density. The form factor is normalized by the particle volume. 
     3The form factor is normalized by the particle volume. 
    74 
    85For information about polarised and magnetic scattering, click here_. 
     
    3835.. _CylinderModel-orientation: 
    3936 
    40 .. figure:: img/image061.JPG 
     37.. figure:: img/image061.JPG   (should be img/cylinder-1.jpg, or img/cylinder-orientation.jpg) 
    4138 
    4239    Definition of the angles for oriented cylinders. 
     
    4946radius and length values, and used as the effective radius for $S(Q)$ 
    5047when $P(Q) \cdot S(Q)$ is applied. 
    51  
    52 The returned value is scaled to units of |cm^-1| and the parameters of 
    53 the CylinderModel are the following: 
    54  
    55 %(parameters)s 
    5648 
    5749The output of the 1D scattering intensity function for randomly oriented 
     
    6759use the c-library from NIST. 
    6860 
    69 Validation of the CylinderModel 
    70 ------------------------------- 
     61Validation 
     62---------- 
    7163 
    7264Validation of our code was done by comparing the output of the 1D model 
     
    116108from numpy import pi, inf 
    117109 
     110name = "cylinder" 
     111title = "Right circular cylinder with uniform scattering length density." 
     112description = """ 
     113     f(q)= 2*(sldCyl - sldSolv)*V*sin(qLcos(alpha/2)) 
     114            /[qLcos(alpha/2)]*J1(qRsin(alpha/2))/[qRsin(alpha)] 
     115 
     116            P(q,alpha)= scale/V*f(q)^(2)+background 
     117            V: Volume of the cylinder 
     118            R: Radius of the cylinder 
     119            L: Length of the cylinder 
     120            J1: The bessel function 
     121            alpha: angle betweenthe axis of the 
     122            cylinder and the q-vector for 1D 
     123            :the ouput is P(q)=scale/V*integral 
     124            from pi/2 to zero of... 
     125            f(q)^(2)*sin(alpha)*dalpha+ bkg 
     126    """ 
     127 
     128parameters = [ 
     129#   [ "name", "units", default, [lower, upper], "type", 
     130#     "description" ], 
     131    [ "sld", "1e-6/Ang^2", 4, [-inf,inf], "", 
     132      "Cylinder scattering length density" ], 
     133    [ "solvent_sld", "1e-6/Ang^2", 1, [-inf,inf], "", 
     134      "Solvent scattering length density" ], 
     135    [ "radius", "Ang",  20, [0, inf], "volume", 
     136      "Cylinder radius" ], 
     137    [ "length", "Ang",  400, [0, inf], "volume", 
     138      "Cylinder length" ], 
     139    [ "theta", "degrees", 60, [-inf, inf], "orientation", 
     140      "In plane angle" ], 
     141    [ "phi", "degrees", 60, [-inf, inf], "orientation", 
     142      "Out of plane angle" ], 
     143    ] 
     144 
     145source = [ "lib/J1.c", "lib/gauss76.c", "lib/cylkernel.c", "cylinder.c"] 
     146 
    118147def ER(radius, length): 
    119148    ddd = 0.75*radius*(2*radius*length + (length+radius)*(length+pi*radius)) 
    120149    return 0.5 * (ddd)**(1./3.) 
    121150 
    122 INFO = { 
    123     "name": "cylinder", 
    124     "title": "Cylinder with uniform scattering length density", 
    125     "source": [ "lib/J1.c", "lib/gauss76.c", "lib/cylkernel.c", "cylinder.c"], 
    126     "parameters": [ 
    127     #   [ "name", "units", default, [lower, upper], "type", 
    128     #     "description" ], 
    129         [ "sld", "1e-6/Ang^2", 4, [-inf,inf], "", 
    130           "Cylinder scattering length density" ], 
    131         [ "solvent_sld", "1e-6/Ang^2", 1, [-inf,inf], "", 
    132           "Solvent scattering length density" ], 
    133         [ "radius", "Ang",  20, [0, inf], "volume", 
    134           "Cylinder radius" ], 
    135         [ "length", "Ang",  400, [0, inf], "volume", 
    136           "Cylinder length" ], 
    137         [ "theta", "degrees", 60, [-inf, inf], "orientation", 
    138           "In plane angle" ], 
    139         [ "phi", "degrees", 60, [-inf, inf], "orientation", 
    140           "Out of plane angle" ], 
    141         ], 
    142     "description": """ 
    143          f(q)= 2*(sldCyl - sldSolv)*V*sin(qLcos(alpha/2)) 
    144                 /[qLcos(alpha/2)]*J1(qRsin(alpha/2))/[qRsin(alpha)] 
    145  
    146                 P(q,alpha)= scale/V*f(q)^(2)+background 
    147                 V: Volume of the cylinder 
    148                 R: Radius of the cylinder 
    149                 L: Length of the cylinder 
    150                 J1: The bessel function 
    151                 alpha: angle betweenthe axis of the 
    152                 cylinder and the q-vector for 1D 
    153                 :the ouput is P(q)=scale/V*integral 
    154                 from pi/2 to zero of... 
    155                 f(q)^(2)*sin(alpha)*dalpha+ bkg 
    156         """, 
    157     "ER": ER, 
    158     } 
    159  
Note: See TracChangeset for help on using the changeset viewer.