Changes in / [3a8d205:8b10fdf] in sasmodels


Ignore:
Location:
sasmodels
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/compare.py

    rbb2d187 r050c2c8  
    312312        name = name.split('*')[0] 
    313313 
    314     if name == 'capped_cylinder' and pars['radius_cap'] < pars['radius']: 
    315         pars['radius'], pars['radius_cap'] = pars['radius_cap'], pars['radius'] 
    316     if name == 'barbell' and pars['radius_bell'] < pars['radius']: 
    317         pars['radius'], pars['radius_bell'] = pars['radius_bell'], pars['radius'] 
     314    if name == 'capped_cylinder' and pars['cap_radius'] < pars['radius']: 
     315        pars['radius'], pars['cap_radius'] = pars['cap_radius'], pars['radius'] 
     316    if name == 'barbell' and pars['bell_radius'] < pars['radius']: 
     317        pars['radius'], pars['bell_radius'] = pars['bell_radius'], pars['radius'] 
    318318 
    319319    # Limit guinier to an Rg such that Iq > 1e-30 (single precision cutoff) 
  • sasmodels/models/adsorbed_layer.py

    rb0c4271 r52ec91e  
     1#adsorbed_layer model 
     2#conversion of Core2ndMomentModel.py 
     3#converted by Steve King, Mar 2016 
     4 
    15r""" 
    2 Definition 
    3 ---------- 
    4  
    56This model describes the scattering from a layer of surfactant or polymer 
    67adsorbed on large, smooth, notionally spherical particles under the conditions 
     
    1819the mean of the density distribution (ie, the distance of the centre-of-mass 
    1920of the distribution from the interface), $\sigma = \sqrt{t^2/12}$. 
     21 
     22Definition 
     23---------- 
    2024 
    2125.. math:: 
     
    4044calculation is exact). 
    4145 
    42 The code for this model is based originally on a a fortran implementation by 
    43 Steve King at ISIS in the SANDRA package c. 1990. 
    44  
    4546References 
    4647---------- 
    4748 
    48 .. [#] S King, P Griffiths, J Hone, and T Cosgrove, *SANS from Adsorbed Polymer 
    49    Layers*, *Macromol. Symp.*, 190 (2002) 33-42. 
    50  
    51 Authorship and Verification 
    52 ---------------------------- 
    53  
    54 * **Author:** Jae-Hi Cho **Date:** pre 2010 
    55 * **Last Modified by:** Paul Kienzle **Date:** April 14, 2016 
    56 * **Last Reviewed by:** Steve King **Date:** March 18, 2016 
     49S King, P Griffiths, J Hone, and T Cosgrove, 
     50*SANS from Adsorbed Polymer Layers*, *Macromol. Symp.*, 190 (2002) 33-42. 
    5751""" 
    5852 
     
    8680def Iq(q, second_moment, adsorbed_amount, density_shell, radius, 
    8781       volfraction, sld_shell, sld_solvent): 
     82    # pylint: disable = missing-docstring 
     83    #deltarhosqrd =  (sld_shell - sld_solvent) * (sld_shell - sld_solvent) 
     84    #numerator =  6.0 * pi * volfraction * (adsorbed_amount * adsorbed_amount) 
     85    #denominator =  (q * q) * (density_shell * density_shell) * radius 
     86    #eterm =  exp(-1.0 * (q * q) * (second_moment * second_moment)) 
     87    ##scale by 10^-2 for units conversion to cm^-1 
     88    #inten =  1.0e-02 * deltarhosqrd * ((numerator / denominator) * eterm) 
    8889    with errstate(divide='ignore'): 
    8990        aa = ((sld_shell - sld_solvent)/density_shell * adsorbed_amount) / q 
  • sasmodels/models/barbell.py

    rb0c4271 r2222134  
     1#barbell model 
     2# Note: model title and parameter table are inserted automatically 
    13r""" 
    2 Definition 
    3 ---------- 
    4  
    54Calculates the scattering from a barbell-shaped cylinder.  Like 
    65:ref:`capped-cylinder`, this is a sphereocylinder with spherical end 
     
    87of the end cap radius lying outside of the cylinder. See the diagram for 
    98the details of the geometry and restrictions on parameter values. 
     9 
     10Definition 
     11---------- 
    1012 
    1113.. figure:: img/barbell_geometry.jpg 
     
    7375 
    7476.. figure:: img/cylinder_angle_projection.jpg 
    75     :width: 600px 
    7677 
    7778    Examples of the angles for oriented pp against the detector plane. 
     
    8081---------- 
    8182 
    82 .. [#] H Kaya, *J. Appl. Cryst.*, 37 (2004) 37 223-230 
    83 .. [#] H Kaya and N R deSouza, *J. Appl. Cryst.*, 37 (2004) 508-509 (addenda 
    84    and errata) 
     83H Kaya, *J. Appl. Cryst.*, 37 (2004) 37 223-230 
    8584 
    86 Authorship and Verification 
    87 ---------------------------- 
    88  
    89 * **Author:** NIST IGOR/DANSE **Date:** pre 2010 
    90 * **Last Modified by:** Paul Butler **Date:** March 20, 2016 
    91 * **Last Reviewed by:** Paul Butler **Date:** March 20, 2016 
     85H Kaya and N R deSouza, *J. Appl. Cryst.*, 37 (2004) 508-509 (addenda and errata) 
    9286""" 
    9387from numpy import inf 
  • sasmodels/models/bcc_paracrystal.py

    rb0c4271 r0bef47b  
     1#bcc paracrystal model 
     2#note model title and parameter table are automatically inserted 
     3#note - calculation requires double precision 
    14r""" 
    2 Definition 
    3 ---------- 
    4  
    55Calculates the scattering from a **body-centered cubic lattice** with 
    66paracrystalline distortion. Thermal vibrations are considered to be negligible, 
    77and the size of the paracrystal is infinitely large. Paracrystalline distortion 
    88is assumed to be isotropic and characterized by a Gaussian distribution. 
     9 
     10Definition 
     11---------- 
    912 
    1013The scattering intensity $I(q)$ is calculated as 
     
    2023is the paracrystalline structure factor for a body-centered cubic structure. 
    2124 
    22 Equation (1) of the 1990 reference\ [#CIT1990]_ is used to calculate $Z(q)$, 
    23 using equations (29)-(31) from the 1987 paper\ [#CIT1987]_ for $Z1$, $Z2$, and 
    24 $Z3$. 
     25Equation (1) of the 1990 reference is used to calculate $Z(q)$, using 
     26equations (29)-(31) from the 1987 paper for $Z1$, $Z2$, and $Z3$. 
    2527 
    2628The lattice correction (the occupied volume of the lattice) for a 
     
    7779The 2D (Anisotropic model) is based on the reference below where $I(q)$ is 
    7880approximated for 1d scattering. Thus the scattering pattern for 2D may not 
    79 be accurate. 
     81be accurate. Note that we are not responsible for any incorrectness of the 2D 
     82model computation. 
    8083 
    8184.. figure:: img/bcc_angle_definition.png 
     
    8689---------- 
    8790 
    88 .. [#CIT1987] Hideki Matsuoka et. al. *Physical Review B*, 36 (1987) 1754-1765 
    89    (Original Paper) 
    90 .. [#CIT1990] Hideki Matsuoka et. al. *Physical Review B*, 41 (1990) 3854 -3856 
    91    (Corrections to FCC and BCC lattice structure calculation) 
     91Hideki Matsuoka et. al. *Physical Review B*, 36 (1987) 1754-1765 
     92(Original Paper) 
    9293 
    93 Authorship and Verification 
    94 ---------------------------- 
    95  
    96 * **Author:** NIST IGOR/DANSE **Date:** pre 2010 
    97 * **Last Modified by:** Paul Butler **Date:** September 29, 2016 
    98 * **Last Reviewed by:** Richard Heenan **Date:** March 21, 2016 
     94Hideki Matsuoka et. al. *Physical Review B*, 41 (1990) 3854 -3856 
     95(Corrections to FCC and BCC lattice structure calculation) 
    9996""" 
    10097 
     
    112109category = "shape:paracrystal" 
    113110 
    114 #note - calculation requires double precision 
    115111single = False 
    116112 
  • sasmodels/models/be_polyelectrolyte.py

    rb0c4271 r2c74c11  
    11r""" 
     2This model calculates the structure factor of a polyelectrolyte solution with 
     3the RPA expression derived by Borue and Erukhimovich. 
     4 
    25Definition 
    36---------- 
    4 This model calculates the structure factor of a polyelectrolyte solution with 
    5 the RPA expression derived by Borue and Erukhimovich\ [#Borue]_.  The scattering intensity 
    6 $I(q)$ is calculated as 
     7 
     8The scattering intensity $I(q)$ is calculated as 
    79 
    810.. math:: 
     
    3436---------- 
    3537 
    36 .. [#Borue] V Y Borue, I Y Erukhimovich, *Macromolecules*, 21 (1988) 3240 
    37 .. [#] J F Joanny, L Leibler, *Journal de Physique*, 51 (1990) 545 
    38 .. [#] A Moussaid, F Schosseler, J P Munch, S Candau, *J. Journal de Physique 
    39    II France*, 3 (1993) 573 
    40 .. [#] E Raphael, J F Joanny, *Europhysics Letters*, 11 (1990) 179 
     38V Y Borue, I Y Erukhimovich, *Macromolecules*, 21 (1988) 3240 
    4139 
    42 Authorship and Verification 
    43 ---------------------------- 
     40J F Joanny, L Leibler, *Journal de Physique*, 51 (1990) 545 
    4441 
    45 * **Author:** NIST IGOR/DANSE **Date:** pre 2010 
    46 * **Last Modified by:** Paul Kienzle **Date:** July 24, 2016 
    47 * **Last Reviewed by:** Piotr rozyczko **Date:** January 27, 2016 
     42A Moussaid, F Schosseler, J P Munch, S Candau, 
     43*J. Journal de Physique II France*, 3 (1993) 573 
     44 
     45E Raphael, J F Joanny, *Europhysics Letters*, 11 (1990) 179 
     46 
    4847""" 
    4948 
  • sasmodels/models/binary_hard_sphere.py

    rb0c4271 r63c6a08  
    11r""" 
     2 
    23Definition 
    34---------- 
    4  
    55The binary hard sphere model provides the scattering intensity, for binary 
    66mixture of hard spheres including hard sphere interaction between those 
     
    6161---------- 
    6262 
    63 .. [#] N W Ashcroft and D C Langreth, *Physical Review*, 156 (1967) 685-692 
    64    [Errata found in *Phys. Rev.* 166 (1968) 934] 
    65 .. [#] S R Kline, *J Appl. Cryst.*, 39 (2006) 895 
     63N W Ashcroft and D C Langreth, *Physical Review*, 156 (1967) 685-692 
     64[Errata found in *Phys. Rev.* 166 (1968) 934] 
    6665 
    67 Authorship and Verification 
    68 ---------------------------- 
     66S R Kline, *J Appl. Cryst.*, 39 (2006) 895 
    6967 
    70 * **Author:** NIST IGOR/DANSE **Date:** pre 2010 
    71 * **Last Modified by:** Paul Butler **Date:** March 20, 2016 
    72 * **Last Reviewed by:** Paul Butler **Date:** March 20, 2016 
     68**Author:** NIST IGOR/DANSE **on:** pre 2010 
     69 
     70**Last Modified by:** Paul Butler **on:** March 20, 2016 
     71 
     72**Last Reviewed by:** Paul Butler **on:** March 20, 2016 
    7373""" 
    7474 
  • sasmodels/models/broad_peak.py

    rb0c4271 r40a87fa  
    11r""" 
    2 Definition 
    3 ---------- 
    4  
    52This model calculates an empirical functional form for SAS data characterized 
    63by a broad scattering peak. Many SAS spectra are characterized by a broad peak 
     
    129between the scattering inhomogeneities (such as in lamellar, cylindrical, or 
    1310spherical morphologies, or for bicontinuous structures). 
     11 
     12Definition 
     13---------- 
    1414 
    1515The scattering intensity $I(q)$ is calculated as 
     
    3333None. 
    3434 
    35 Authorship and Verification 
    36 ---------------------------- 
    37  
    38 * **Author:** NIST IGOR/DANSE **Date:** pre 2010 
    39 * **Last Modified by:** Paul kienle **Date:** July 24, 2016 
    40 * **Last Reviewed by:** Richard Heenan **Date:** March 21, 2016 
     35*2013/09/09 - Description reviewed by King, S and Parker, P.* 
    4136""" 
    4237 
  • sasmodels/models/capped_cylinder.py

    rb0c4271 r2222134  
    11r""" 
    2 Definitions 
    3 ----------- 
    4  
    52Calculates the scattering from a cylinder with spherical section end-caps. 
    63Like :ref:`barbell`, this is a sphereocylinder with end caps that have a 
     
    96lens when the length of the cylinder $L=0$. See the diagram for the details 
    107of the geometry and restrictions on parameter values. 
     8 
     9Definitions 
     10----------- 
    1111 
    1212.. figure:: img/capped_cylinder_geometry.jpg 
     
    7676 
    7777.. figure:: img/cylinder_angle_projection.jpg 
    78     :width: 600px 
    7978 
    8079    Examples of the angles for oriented 2D cylinders against the detector plane. 
     
    8382---------- 
    8483 
    85 .. [#] H Kaya, *J. Appl. Cryst.*, 37 (2004) 223-230 
    86 .. [#] H Kaya and N-R deSouza, *J. Appl. Cryst.*, 37 (2004) 508-509 (addenda  
    87    and errata) 
     84H Kaya, *J. Appl. Cryst.*, 37 (2004) 223-230 
    8885 
    89 Authorship and Verification 
    90 ---------------------------- 
    91  
    92 * **Author:** NIST IGOR/DANSE **Date:** pre 2010 
    93 * **Last Modified by:** Paul Butler **Date:** September 30, 2016 
    94 * **Last Reviewed by:** Richard Heenan **Date:** March 19, 2016 
     86H Kaya and N-R deSouza, *J. Appl. Cryst.*, 37 (2004) 508-509 (addenda and errata) 
    9587""" 
    9688from numpy import inf 
  • sasmodels/models/core_multi_shell.py

    rb0c4271 r7b68dc5  
    3333References 
    3434---------- 
     35See the :ref:`core-shell-sphere` model documentation. 
    3536 
    36 .. [#] See the :ref:`core-shell-sphere` model documentation. 
    37 .. [#] L A Feigin and D I Svergun, *Structure Analysis by Small-Angle X-Ray and Neutron Scattering*, 
    38    Plenum Press, New York, 1987. 
     37L A Feigin and D I Svergun, 
     38*Structure Analysis by Small-Angle X-Ray and Neutron Scattering*, 
     39Plenum Press, New York, 1987. 
    3940 
    40 Authorship and Verification 
    41 ---------------------------- 
     41**Author:** NIST IGOR/DANSE **on:** pre 2010 
    4242 
    43 * **Author:** NIST IGOR/DANSE **Date:** pre 2010 
    44 * **Last Modified by:** Paul Kienzle **Date:** September 12, 2016 
    45 * **Last Reviewed by:** Under Review **Date:** as of October 5, 2016 
     43**Last Modified by:** in progress **on:** March 20, 2016 
     44 
     45**Last Reviewed by:** in progress **on:** March 20, 2016 
    4646""" 
    4747 
  • sasmodels/models/core_shell_bicelle.py

    rb0c4271 r2222134  
    11r""" 
     2 
    23Definition 
    34---------- 
     
    1213.. figure:: img/core_shell_bicelle_geometry.png 
    1314 
    14     Core shell geometry (Graphic from ref [#Matusmori]_). 
    15     Note however that the model here calculates for rectangular, not curved, rims. 
     15    (Graphic from DOI: 10.1039/C0NP00002G, note however that the model here 
     16    calculates for rectangular, not curved, rims.) 
    1617 
    1718The output of the 1D scattering intensity function for randomly oriented 
     
    2728 
    2829.. figure:: img/cylinder_angle_projection.jpg 
    29     :width: 600px 
    3030 
    3131    Examples of the angles for oriented pp against the detector plane. 
     
    3434---------- 
    3535 
    36 .. [#Matusmori] `N Matsumori and M Murata <http://dx.doi.org/10.1039/C0NP0000 
    37    2G>`_, *Nat. Prod. Rep.* 27 (2010) 1480-1492 
    38 .. [#] L A Feigin and D I Svergun, *Structure Analysis by Small-Angle X-Ray and 
    39    Neutron Scattering,* Plenum Press, New York, (1987) 
    40  
    41 Authorship and Verification 
    42 ---------------------------- 
    43  
    44 * **Author:** NIST IGOR/DANSE **Date:** pre 2010 
    45 * **Last Modified by:** Paul Butler **Date:** Septmber 30, 2016 
    46 * **Last Reviewed by:** Under Review **Date:** October 5, 2016 
     36L A Feigin and D I Svergun, 
     37*Structure Analysis by Small-Angle X-Ray and Neutron Scattering,* 
     38Plenum Press, New York, (1987) 
    4739 
    4840""" 
  • sasmodels/models/hollow_cylinder.c

    raea2e2a ra807206  
    1 double form_volume(double radius, double thickness, double length); 
     1double form_volume(double radius, double radius_core, double length); 
    22 
    3 double Iq(double q, double radius, double thickness, double length, double sld, 
     3double Iq(double q, double radius, double radius_core, double length, double sld, 
    44        double solvent_sld); 
    5 double Iqxy(double qx, double qy, double radius, double thickness, double length, double sld, 
     5double Iqxy(double qx, double qy, double radius, double radius_core, double length, double sld, 
    66        double solvent_sld, double theta, double phi); 
    77 
    8 //#define INVALID(v) (v.radius_core >= v.radius) 
     8#define INVALID(v) (v.radius_core >= v.radius) 
    99 
    1010// From Igor library 
     
    2727 
    2828static double _hollow_cylinder_kernel( 
    29     double q, double radius, double thickness, double length, double dum) 
     29    double q, double radius_core, double radius, double length, double dum) 
    3030{ 
    3131    const double qs = q*sqrt(1.0-dum*dum); 
    32     const double lam1 = sas_J1c((radius+thickness)*qs); 
    33     const double lam2 = sas_J1c(radius*qs); 
    34     const double gamma_sq = square(radius/(radius+thickness)); 
     32    const double lam1 = sas_J1c(radius*qs); 
     33    const double lam2 = sas_J1c(radius_core*qs); 
     34    const double gamma_sq = square(radius_core/radius); 
    3535    //Note: lim_{r -> r_c} psi = J0(radius_core*qs) 
    3636    const double psi = (lam1 - gamma_sq*lam2)/(1.0 - gamma_sq); //SRK 10/19/00 
     
    4141 
    4242static double hollow_cylinder_analytical_2D_scaled( 
    43     double q, double q_x, double q_y, double radius, double thickness, 
     43    double q, double q_x, double q_y, double radius, double radius_core, 
    4444    double length, double sld, double solvent_sld, double theta, double phi) 
    4545{ 
     
    6565    cos_val = cyl_x*q_x + cyl_y*q_y;// + cyl_z*q_z; 
    6666 
    67     answer = _hollow_cylinder_kernel(q, radius, thickness, length, cos_val); 
     67    answer = _hollow_cylinder_kernel(q, radius_core, radius, length, cos_val); 
    6868 
    69     vol = form_volume(radius, thickness, length); 
     69    vol = form_volume(radius, radius_core, length); 
    7070    answer = hollow_cylinder_scaling(answer, delrho, vol); 
    7171 
     
    7474 
    7575 
    76 double form_volume(double radius, double thickness, double length) 
     76double form_volume(double radius, double radius_core, double length) 
    7777{ 
    78     double v_shell = M_PI*length*((radius+thickness)*(radius+thickness)-radius*radius); 
     78    double v_shell = M_PI*length*(radius*radius-radius_core*radius_core); 
    7979    return(v_shell); 
    8080} 
    8181 
    8282 
    83 double Iq(double q, double radius, double thickness, double length, 
     83double Iq(double q, double radius, double radius_core, double length, 
    8484    double sld, double solvent_sld) 
    8585{ 
     
    9595    for (i=0;i<76;i++) { 
    9696        zi = ( Gauss76Z[i] * (upper-lower) + lower + upper )/2.0; 
    97         inter = Gauss76Wt[i] * _hollow_cylinder_kernel(q, radius, thickness, length, zi); 
     97        inter = Gauss76Wt[i] * _hollow_cylinder_kernel(q, radius_core, radius, length, zi); 
    9898        summ += inter; 
    9999    } 
    100100 
    101101    norm = summ*(upper-lower)/2.0; 
    102     volume = form_volume(radius, thickness, length); 
     102    volume = form_volume(radius, radius_core, length); 
    103103    delrho = solvent_sld - sld; 
    104104    answer = hollow_cylinder_scaling(norm, delrho, volume); 
     
    108108 
    109109 
    110 double Iqxy(double qx, double qy, double radius, double thickness, 
     110double Iqxy(double qx, double qy, double radius, double radius_core, 
    111111    double length, double sld, double solvent_sld, double theta, double phi) 
    112112{ 
    113113    const double q = sqrt(qx*qx+qy*qy); 
    114     return hollow_cylinder_analytical_2D_scaled(q, qx/q, qy/q, radius, thickness, length, sld, solvent_sld, theta, phi); 
     114    return hollow_cylinder_analytical_2D_scaled(q, qx/q, qy/q, radius, radius_core, length, sld, solvent_sld, theta, phi); 
    115115} 
  • sasmodels/models/hollow_cylinder.py

    raea2e2a ra807206  
    11r""" 
    22This model provides the form factor, $P(q)$, for a monodisperse hollow right 
    3 angle circular cylinder (rigid tube) where the form factor is normalized by the 
    4 volume of the tube (i.e. not by the external volume). 
     3angle circular cylinder (tube) where the form factor is normalized by the 
     4volume of the tube 
    55 
    66.. math:: 
     
    2121    P(q)           &= (\text{scale})V_\text{shell}\Delta\rho^2 
    2222            \int_0^{1}\Psi^2 
    23             \left[q_z, R_\text{outer}(1-x^2)^{1/2}, 
     23            \left[q_z, R_\text{shell}(1-x^2)^{1/2}, 
    2424                       R_\text{core}(1-x^2)^{1/2}\right] 
    2525            \left[\frac{\sin(qHx)}{qHx}\right]^2 dx \\ 
     
    2727            \left[ \Lambda(qy) - \gamma^2\Lambda(qz) \right] \\ 
    2828    \Lambda(a)     &= 2 J_1(a) / a \\ 
    29     \gamma         &= R_\text{core} / R_\text{outer} \\ 
    30     V_\text{shell} &= \pi \left(R_\text{outer}^2 - R_\text{core}^2 \right)L \\ 
     29    \gamma         &= R_\text{core} / R_\text{shell} \\ 
     30    V_\text{shell} &= \pi \left(R_\text{shell}^2 - R_\text{core}^2 \right)L \\ 
    3131    J_1(x)         &= (\sin(x)-x\cdot \cos(x)) / x^2 
    3232 
     
    3535 
    3636**NB**: The 2nd virial coefficient of the cylinder is calculated 
    37 based on the outer radius and full length, which give an the effective radius 
    38 for structure factor $S(q)$ when $P(q) \cdot S(q)$ is applied. 
     37based on the radius and 2 length values, and used as the effective radius 
     38for $S(q)$ when $P(q) \cdot S(q)$ is applied. 
    3939 
    40 In the parameters,the *radius* is $R_\text{core}$ while *thickness* is $R_\text{outer} - R_\text{core}$. 
     40In the parameters, the contrast represents SLD :sub:`shell` - SLD :sub:`solvent` 
     41and the *radius* is $R_\text{shell}$ while *radius_core* is $R_\text{core}$. 
    4142 
    4243To provide easy access to the orientation of the core-shell cylinder, we define 
     
    4950L A Feigin and D I Svergun, *Structure Analysis by Small-Angle X-Ray and 
    5051Neutron Scattering*, Plenum Press, New York, (1987) 
    51  
    52 Authorship and Verification 
    53 ---------------------------- 
    54  
    55 * **Author:** NIST IGOR/DANSE **Date:** pre 2010 
    56 * **Last Modified by:** Richard Heenan **Date:** October 06, 2016  
    57    (reparametrised to use thickness, not outer radius) 
    58 * **Last Reviewed by:** Richard Heenan **Date:** October 06, 2016 
    59  
    6052""" 
    6153 
     
    6658description = """ 
    6759P(q) = scale*<f*f>/Vol + background, where f is the scattering amplitude. 
    68 radius = the radius of core 
    69 thickness = the thickness of shell 
     60radius_core = the radius of core 
     61radius = the radius of shell 
    7062length = the total length of the cylinder 
    7163sld = SLD of the shell 
     
    7769#   ["name", "units", default, [lower, upper], "type","description"], 
    7870parameters = [ 
    79     ["radius",      "Ang",     20.0, [0, inf],    "volume",      "Cylinder core radius"], 
    80     ["thickness",   "Ang",     10.0, [0, inf],    "volume",      "Cylinder wall thickness"], 
    81     ["length",      "Ang",    400.0, [0, inf],    "volume",      "Cylinder total length"], 
     71    ["radius",      "Ang",     30.0, [0, inf],    "volume",      "Cylinder radius"], 
     72    ["radius_core", "Ang",     20.0, [0, inf],    "volume",      "Hollow core radius"], 
     73    ["length",      "Ang",    400.0, [0, inf],    "volume",      "Cylinder length"], 
    8274    ["sld",         "1/Ang^2",  6.3, [-inf, inf], "sld",         "Cylinder sld"], 
    8375    ["sld_solvent", "1/Ang^2",  1,   [-inf, inf], "sld",         "Solvent sld"], 
     
    9082 
    9183# pylint: disable=W0613 
    92 def ER(radius, thickness, length): 
     84def ER(radius, radius_core, length): 
    9385    """ 
    94     :param radius:      Cylinder core radius 
    95     :param thickness:   Cylinder wall thickness 
     86    :param radius:      Cylinder radius 
     87    :param radius_core: Hollow core radius, UNUSED 
    9688    :param length:      Cylinder length 
    9789    :return:            Effective radius 
    9890    """ 
    99     router = radius + thickness 
    100     if router == 0 or length == 0: 
     91    if radius == 0 or length == 0: 
    10192        return 0.0 
    102     len1 = router 
     93    len1 = radius 
    10394    len2 = length/2.0 
    10495    term1 = len1*len1*2.0*len2/2.0 
     
    10899    return diam 
    109100 
    110 def VR(radius, thickness, length): 
     101def VR(radius, radius_core, length): 
    111102    """ 
    112103    :param radius:      Cylinder radius 
    113     :param thickness:   Cylinder wall thickness 
     104    :param radius_core: Hollow core radius 
    114105    :param length:      Cylinder length 
    115106    :return:            Volf ratio for P(q)*S(q) 
    116107    """ 
    117     router = radius + thickness 
    118     vol_core = pi*radius*radius*length 
    119     vol_total = pi*router*router*length 
     108    vol_core = pi*radius_core*radius_core*length 
     109    vol_total = pi*radius*radius*length 
    120110    vol_shell = vol_total - vol_core 
    121111    return vol_shell, vol_total 
    122112 
    123113# parameters for demo 
    124 demo = dict(scale=1.0, background=0.0, length=400.0, radius=20.0, 
    125             thickness=10, sld=6.3, sld_solvent=1, theta=90, phi=0, 
    126             thickness_pd=0.2, thickness_pd_n=9, 
     114demo = dict(scale=1.0, background=0.0, length=400.0, radius=30.0, 
     115            radius_core=20.0, sld=6.3, sld_solvent=1, theta=90, phi=0, 
     116            radius_pd=.2, radius_pd_n=9, 
    127117            length_pd=.2, length_pd_n=10, 
    128             radius_pd=.2, radius_pd_n=9, 
     118            radius_core_pd=.2, radius_core_pd_n=9, 
    129119            theta_pd=10, theta_pd_n=5, 
    130120           ) 
     
    132122# Parameters for unit tests 
    133123tests = [ 
    134     [{}, 0.00005, 1764.926], 
     124    [{"radius": 30.0}, 0.00005, 1764.926], 
    135125    [{}, 'VR', 1.8], 
    136126    [{}, 0.001, 1756.76] 
Note: See TracChangeset for help on using the changeset viewer.