Changeset 68532f3 in sasmodels for _sources/model/sphere.txt


Ignore:
Timestamp:
Nov 1, 2015 2:10:22 PM (8 years ago)
Author:
ajj
Branches:
gh-pages
Children:
4a9a316
Parents:
d1fe925
Message:

Adding docs

File:
1 moved

Legend:

Unmodified
Added
Removed
  • _sources/model/sphere.txt

    rd1fe925 r68532f3  
    1 r""" 
     1.. _sphere: 
     2 
     3Sphere 
     4======================================================= 
     5 
     6Spheres with uniform scattering length density 
     7 
     8=========== ================================= ============ ============= 
     9Parameter   Description                       Units        Default value 
     10=========== ================================= ============ ============= 
     11scale       Source intensity                  None                     1 
     12background  Source background                 |cm^-1|                  0 
     13sld         Layer scattering length density   |1e-6Ang^-2|             1 
     14solvent_sld Solvent scattering length density |1e-6Ang^-2|             6 
     15radius      Sphere radius                     |Ang|                   50 
     16=========== ================================= ============ ============= 
     17 
     18The returned value is scaled to units of |cm^-1|. 
     19 
     20 
    221For information about polarised and magnetic scattering, click here_. 
    322 
     
    5675 
    5776*2013/09/09 and 2014/01/06 - Description reviewed by S King and P Parker.* 
    58 """ 
    5977 
    60 from numpy import inf 
    61  
    62 name = "sphere" 
    63 title = "Spheres with uniform scattering length density" 
    64 description = """\ 
    65 P(q)=(scale/V)*[3V(sld-solvent_sld)*(sin(qR)-qRcos(qR)) 
    66                 /(qR)^3]^2 + background 
    67     R: radius of sphere 
    68     V: The volume of the scatter 
    69     sld: the SLD of the sphere 
    70     solvent_sld: the SLD of the solvent 
    71 """ 
    72 category = "shape:sphere" 
    73  
    74 #             ["name", "units", default, [lower, upper], "type","description"], 
    75 parameters = [["sld", "1e-6/Ang^2", 1, [-inf, inf], "", 
    76                "Layer scattering length density"], 
    77               ["solvent_sld", "1e-6/Ang^2", 6, [-inf, inf], "", 
    78                "Solvent scattering length density"], 
    79               ["radius", "Ang", 50, [0, inf], "volume", 
    80                "Sphere radius"], 
    81              ] 
    82  
    83  
    84 # No volume normalization despite having a volume parameter 
    85 # This should perhaps be volume normalized? 
    86 form_volume = """ 
    87     return 1.333333333333333*M_PI*radius*radius*radius; 
    88     """ 
    89  
    90 Iq = """ 
    91     const double qr = q*radius; 
    92     double sn, cn; 
    93     SINCOS(qr, sn, cn); 
    94     const double bes = qr==0.0 ? 1.0 : 3.0*(sn-qr*cn)/(qr*qr*qr); 
    95     const double fq = bes * (sld - solvent_sld) * form_volume(radius); 
    96     return 1.0e-4*fq*fq; 
    97     """ 
    98  
    99  
    100 Iqxy = """ 
    101     // never called since no orientation or magnetic parameters. 
    102     //return -1.0; 
    103     return Iq(sqrt(qx*qx + qy*qy), sld, solvent_sld, radius); 
    104     """ 
    105  
    106 def ER(radius): 
    107     return radius 
    108  
    109 # VR defaults to 1.0 
    110  
    111 demo = dict(scale=1, background=0, 
    112             sld=6, solvent_sld=1, 
    113             radius=120, 
    114             radius_pd=.2, radius_pd_n=45) 
    115 oldname = "SphereModel" 
    116 oldpars = dict(sld='sldSph', solvent_sld='sldSolv', radius='radius') 
Note: See TracChangeset for help on using the changeset viewer.