Changeset d138d43 in sasmodels


Ignore:
Timestamp:
Nov 30, 2015 12:24:28 PM (8 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:
eb69cce
Parents:
1ec7efa
Message:

remove documentation build errors

Files:
5 added
6 deleted
17 edited
4 moved

Legend:

Unmodified
Added
Removed
  • doc/genmodel.py

    r61ba623 rd138d43  
    11import sys 
    2 import os 
    32sys.path.insert(0,'..') 
    43 
    54# Convert ../sasmodels/models/name.py to sasmodels.models.name 
    65module_name = sys.argv[1][3:-3].replace('/','.').replace('\\','.') 
    7 print module_name 
     6#print module_name 
    87module = __import__(module_name) 
    98for part in module_name.split('.')[1:]: 
    109    module = getattr(module, part) 
    11 print module 
     10#print module 
    1211 
    1312# Load the doc string from the module definition file and store it in rst 
  • doc/index.rst

    r61ba623 rd138d43  
    1515 
    1616   guide/index.rst 
     17   developer/index.rst 
    1718   ref/index.rst 
    1819   api/index.rst 
  • sasmodels/exception.py

    r0763009 rd138d43  
    1515    to the caller using a bare "raise" statement to reraise the annotated 
    1616    exception. 
     17 
    1718    Example:: 
     19 
    1820        >>> D = {} 
    1921        >>> try: 
  • sasmodels/generate.py

    re1ace4d rd138d43  
    200200 
    201201import sys 
    202 from os.path import abspath, dirname, join as joinpath, exists, basename 
     202from os.path import abspath, dirname, join as joinpath, exists, basename, \ 
     203    splitext 
    203204import re 
    204205 
     
    565566        demo_parameters = dict((p[0],p[2]) for p in parameters) 
    566567    filename = abspath(kernel_module.__file__) 
    567     kernel_id = basename(filename)[:-3] 
     568    kernel_id = splitext(basename(filename))[0] 
    568569    name = getattr(kernel_module, 'name', None) 
    569570    if name is None: 
  • sasmodels/kerneldll.py

    r5edfe12 rd138d43  
    2121free from microsoft: 
    2222 
    23     `http://www.microsoft.com/en-us/download/details.aspx?id=44266`_ 
     23    `<http://www.microsoft.com/en-us/download/details.aspx?id=44266>`_ 
    2424 
    2525Again, this requires that the compiler is available on your path.  This is 
  • sasmodels/models/bcc.py

    rcd3dba0 rd138d43  
    77and the size of the paracrystal is infinitely large. Paracrystalline distortion 
    88is assumed to be isotropic and characterized by a Gaussian distribution. 
    9  
    10 The returned value is scaled to units of |cm^-1|\ |sr^-1|, absolute scale. 
    119 
    1210Definition 
     
    4644where $g$ is a fractional distortion based on the nearest neighbor distance. 
    4745 
    48 The body-centered cubic lattice is 
    4946 
    50 .. image:: img/bcc_lattice.jpg 
     47.. figure:: img/bcc_lattice.jpg 
     48 
     49    Body-centered cubic lattice. 
    5150 
    5251For a crystal, diffraction peaks appear at reduced q-values given by 
     
    6867    \end{eqnarray} 
    6968 
    70 **NB: The calculation of $Z(q)$ is a double numerical integral that must 
     69**NB**: The calculation of $Z(q)$ is a double numerical integral that must 
    7170be carried out with a high density of points to properly capture the sharp 
    72 peaks of the paracrystalline scattering.** So be warned that the calculation 
     71peaks of the paracrystalline scattering. So be warned that the calculation 
    7372is SLOW. Go get some coffee. Fitting of any experimental data must be 
    7473resolution smeared for any meaningful fit. This makes a triple integral. 
     
    7877*qmin* = 0.001 |Ang^-1|, *qmax* = 0.1 |Ang^-1| and the above default values. 
    7978 
    80 .. image:: img/bcc_1d.jpg 
     79.. figure:: img/bcc_1d.jpg 
    8180 
    82 *Figure. 1D plot in the linear scale using the default values 
    83 (w/200 data point).* 
     81    1D plot in the linear scale using the default values (w/200 data point). 
    8482 
    8583The 2D (Anisotropic model) is based on the reference below where $I(q)$ is 
     
    8886model computation. 
    8987 
    90 .. image:: img/bcc_orientation.gif 
     88.. figure:: img/crystal_orientation.gif 
    9189 
    92 .. image:: img/bcc_2d.jpg 
     90    Orientation of the crystal with respect to the scattering plane. 
    9391 
    94 *Figure. 2D plot using the default values (w/200X200 pixels).* 
     92.. figure:: img/bcc_2d.jpg 
    9593 
    96 REFERENCE 
     94    2D plot using the default values (w/200X200 pixels).* 
     95 
     96Reference 
    9797--------- 
    9898 
  • sasmodels/models/broad_peak.py

    r485aee2 rd138d43  
    3131 
    3232 
    33 .. image:: img/image175.jpg 
     33.. figure:: img/broad_peak_1d.jpg 
    3434 
    35 *Figure. 1D plot using the default values (w/200 data point).* 
     35    1D plot using the default values (w/200 data point). 
    3636 
    3737REFERENCE 
  • sasmodels/models/cylinder.py

    r3e428ec rd138d43  
    33r""" 
    44The form factor is normalized by the particle volume. 
    5  
    6 For information about polarised and magnetic scattering, click here_. 
    75 
    86Definition 
  • sasmodels/models/fcc.py

    r3e428ec rd138d43  
    99a Gaussian distribution. 
    1010 
    11 The returned value is scaled to units of |cm^-1|\ |sr^-1|, absolute scale. 
    12  
    1311Definition 
    1412---------- 
    1513 
    16 The scattering intensity *I(q)* is calculated as 
     14The scattering intensity $I(q)$ is calculated as 
    1715 
    18 .. image:: img/image158.jpg 
     16.. math:: 
    1917 
    20 where *scale* is the volume fraction of spheres, *Vp* is the volume of 
     18    I(q) = \frac{\text{scale}}{V_p} P(q) Z(q) 
     19 
     20where *scale* is the volume fraction of spheres, $V_p$ is the volume of 
    2121the primary particle, *V(lattice)* is a volume correction for the crystal 
    22 structure, *P(q)* is the form factor of the sphere (normalized), and *Z(q)* 
     22structure, $P(q)$ is the form factor of the sphere (normalized), and $Z(q)$ 
    2323is the paracrystalline structure factor for a face-centered cubic structure. 
    2424 
    25 Equation (1) of the 1990 reference is used to calculate *Z(q)*, using 
    26 equations (23)-(25) from the 1987 paper for *Z1*\ , *Z2*\ , and *Z3*\ . 
     25Equation (1) of the 1990 reference is used to calculate $Z(q)$, using 
     26equations (23)-(25) from the 1987 paper for $Z1$, $Z2$, and $Z3$. 
    2727 
    2828The lattice correction (the occupied volume of the lattice) for a 
    2929face-centered cubic structure of particles of radius *R* and nearest 
    30 neighbor separation *D* is 
     30neighbor separation $D$ is 
    3131 
    32 .. image:: img/image159.jpg 
     32.. math:: 
     33 
     34   V_\text{lattice} = \frac{16\pi}{3}\frac{R^3}{\left(D\sqrt{2}\right)^3} 
    3335 
    3436The distortion factor (one standard deviation) of the paracrystal is 
    35 included in the calculation of *Z(q)* 
     37included in the calculation of $Z(q)$ 
    3638 
    37 .. image:: img/image160.jpg 
     39.. math:: 
    3840 
    39 where *g* is a fractional distortion based on the nearest neighbor distance. 
     41    \Delta a = gD 
    4042 
    41 The face-centered cubic lattice is 
     43where $g$ is a fractional distortion based on the nearest neighbor distance. 
    4244 
    43 .. image:: img/image161.jpg 
     45.. figure:: img/fcc_lattice.jpg 
     46 
     47    Face-centered cubic lattice. 
    4448 
    4549For a crystal, diffraction peaks appear at reduced q-values given by 
    4650 
    47 .. image:: img/image162.jpg 
     51.. math:: 
    4852 
    49 where for a face-centered cubic lattice *h*\ , *k*\ , *l* all odd or all 
    50 even are allowed and reflections where *h*\ , *k*\ , *l* are mixed odd/even 
     53    \frac{qD}{2\pi} = \sqrt{h^2 + k^2 + l^2} 
     54 
     55where for a face-centered cubic lattice $h, k , l$ all odd or all 
     56even are allowed and reflections where $h, k, l$ are mixed odd/even 
    5157are forbidden. Thus the peak positions correspond to (just the first 5) 
    5258 
    53 .. image:: img/image163.jpg 
     59.. math:: 
    5460 
    55 **NB: The calculation of** *Z(q)* **is a double numerical integral that 
    56 must be carried out with a high density of** **points to properly capture 
    57 the sharp peaks of the paracrystalline scattering.** So be warned that the 
     61    \begin{array}{cccccc} 
     62    q/q_0 & 1 & \sqrt{4/3} & \sqrt{8/3} & \sqrt{11/3} & \sqrt{4} \\ 
     63    \text{Indices} & (111)  & (200) & (220) & (311) & (222) 
     64    \end{array} 
     65 
     66**NB**: The calculation of $Z(q)$ is a double numerical integral that 
     67must be carried out with a high density of points to properly capture 
     68the sharp peaks of the paracrystalline scattering. So be warned that the 
    5869calculation is SLOW. Go get some coffee. Fitting of any experimental data 
    5970must be resolution smeared for any meaningful fit. This makes a triple 
     
    6374*qmax* = 0.1 |Ang^-1| and the above default values. 
    6475 
    65 .. image:: img/image164.jpg 
     76.. figure:: img/fcc_1d.jpg 
    6677 
    67 *Figure. 1D plot in the linear scale using the default values (w/200 data point).* 
     78    1D plot in the linear scale using the default values (w/200 data point). 
    6879 
    6980The 2D (Anisotropic model) is based on the reference below where *I(q)* is 
     
    72832D model computation. 
    7384 
    74 .. image:: img/image165.gif 
     85.. figure:: img/crystal_orientation.gif 
    7586 
    76 .. image:: img/image166.jpg 
     87    Orientation of the crystal with respect to the scattering plane. 
    7788 
    78 *Figure. 2D plot using the default values (w/200X200 pixels).* 
     89.. figure:: img/fcc_2d.jpg 
    7990 
    80 REFERENCE 
     91    2D plot using the default values (w/200X200 pixels). 
     92 
     93Reference 
     94--------- 
    8195 
    8296Hideki Matsuoka et. al. *Physical Review B*, 36 (1987) 1754-1765 
  • sasmodels/models/hollow_cylinder.py

    r66ebdd6 rd138d43  
    11r""" 
    2 This model provides the form factor, *P(q)*, for a monodisperse hollow right  
     2This model provides the form factor, $P(q)$, for a monodisperse hollow right 
    33angle circular cylinder (tube) where the form factor is normalized by the 
    44volume of the tube 
    55 
    6 *P(q)* = *scale* \* *<F*\ :sup:`2`\ *>* / *V*\ :sub:`shell` + *background* 
     6.. math:: 
    77 
    8 where the averaging < > is applied only for the 1D calculation. 
     8    P(q) = \text{scale} \langle F^2 \rangle/V_\text{shell} + \text{background} 
     9 
     10where the averaging $\langle \rangle$ is applied only for the 1D calculation. 
    911 
    1012The inside and outside of the hollow cylinder are assumed have the same SLD. 
     
    1820 
    1921    \begin{eqnarray} 
    20     P(q)&=&(\text{scale})V_{shell}(\Delta\rho)^2\int_0^{1}\Psi^2[q_z, 
    21     R_{shell}(1-x^2)^{1/2},R_{core}(1-x^2)^{1/2}][\frac{sin(qHx)}{qHx}]^2dx\\ 
    22     \Psi[q,y,z]&=&\frac{1}{1-\gamma^2}[\Lambda(qy)-\gamma^2\Lambda(qz)]\\ 
    23     \Lambda(a)&=&2J_1(a)/a\\ 
    24     \gamma&=&R_{core}/R_{shell}\\ 
    25     V_{shell}&=&\pi(R_{shell}^2-R_{core}^2)L\\ 
    26     J_1(x)&=&\frac{(sin(x)-x\cdot cos(x))}{x^2}\\ 
     22    P(q)           &=& (\text{scale})V_\text{shell}\Delta\rho^2 
     23            \int_0^{1}\Psi^2 
     24            \left[q_z, R_\text{shell}(1-x^2)^{1/2}, 
     25                       R_\text{core}(1-x^2)^{1/2}\right] 
     26            \left[\frac{\sin(qHx)}{qHx}\right]^2 dx \\ 
     27    \Psi[q,y,z]    &=& \frac{1}{1-\gamma^2} 
     28            \left[ \Lambda(qy) - \gamma^2\Lambda(qz) \right] \\ 
     29    \Lambda(a)     &=& 2 J_1(a) / a \\ 
     30    \gamma         &=& R_\text{core} / R_\text{shell} \\ 
     31    V_\text{shell} &=& \pi \left(R_\text{shell}^2 - R_\text{core}^2 \right)L \\ 
     32    J_1(x)         &=& \frac{(\sin(x)-x\cdot \cos(x))}{x^2} \\ 
    2733    \end{eqnarray} 
    2834 
    29 where *scale* is a scale factor and *J1* is the 1st order Bessel function. 
     35where *scale* is a scale factor and $J_1$ is the 1st order 
     36Bessel function. 
    3037 
    3138To provide easy access to the orientation of the core-shell cylinder, we define 
    32 the axis of the cylinder using two angles |theta| and |phi|\ . As for the case  
     39the axis of the cylinder using two angles $\theta$ and $\phi$. As for the case 
    3340of the cylinder, those angles are defined in Figure 2 of the CylinderModel. 
    3441 
    35 NB: The 2nd virial coefficient of the cylinder is calculated based on the radius 
    36 and 2 length values, and used as the effective radius for *S(Q)* when  
    37 *P(Q)* \* *S(Q)* is applied. 
     42**NB**: The 2nd virial coefficient of the cylinder is calculated 
     43based on the radius and 2 length values, and used as the effective radius 
     44for $S(Q)$ when $P(Q) * S(Q)$ is applied. 
    3845 
    3946In the parameters, the contrast represents SLD :sub:`shell` - SLD :sub:`solvent` 
    40 and the *radius* = *R*\ :sub:`shell` while *core_radius* = *R*\ :sub:`core`. 
     47and the *radius* is $R_\text{shell}$ while *core_radius* is $R_\text{core}$. 
    4148 
    42 .. image:: img/image074.jpg 
     49.. figure:: img/hollow_cylinder_1d.jpg 
    4350 
    44 *Figure. 1D plot using the default values (w/1000 data point).* 
     51    1D plot using the default values (w/1000 data point). 
    4552 
    46 Our model uses the form factor calculations implemented in a c-library provided 
    47 by the NIST Center for Neutron Research (Kline, 2006). 
     53.. figure:: img/orientation.jpg 
    4854 
    49 .. image:: img/image061.jpg 
     55    Definition of the angles for the oriented hollow_cylinder model. 
    5056 
    51 *Figure. Definition of the angles for the oriented hollow_cylinder model.* 
     57.. figure:: img/orientation2.jpg 
    5258 
    53 .. image:: img/image062.jpg 
     59    Examples of the angles for oriented pp against the detector plane. 
    5460 
    55 *Figure. Examples of the angles for oriented pp against the detector plane.* 
    56  
    57 REFERENCE 
     61Reference 
     62--------- 
    5863 
    5964L A Feigin and D I Svergun, *Structure Analysis by Small-Angle X-Ray and 
  • sasmodels/models/lamellarFFHG.py

    r22eac46 rd138d43  
    55region is taken to be different from the SLD of the tail region. 
    66 
    7 *2.1.31.1. Definition* 
     7Definition 
     8---------- 
    89 
    9 The scattering intensity *I(q)* is 
     10The scattering intensity $I(q)$ is 
    1011 
    1112.. math:: 
    1213 
    13     I(Q) = 2\pi{P(Q) \over (2(|delta|\ H +|delta|\ T) Q^2) 
     14   I(q) = 2\pi\frac{\text{scale}}{2(\delta_H + \delta_T)}  P(q) \frac{1}{q^2} 
    1415 
    15 The form factor is 
     16The form factor $P(q)$ is 
    1617 
    17 .. image:: img/lamellarFFHG_.jpg 
     18.. math:: 
    1819 
    19 where |delta|\ T = tail length (or *tail_length*), |delta|\ H = head thickness 
    20 (or *h_thickness*), |drho|\ H = SLD(headgroup) - SLD(solvent), 
    21 and |drho|\ T = SLD(tail) - SLD(solvent). 
     20    P(q) = \frac{4}{q^2} 
     21        \left\lbrace 
     22            \Delta \rho_H 
     23            \left[\sin[q(\delta_H + \delta_T)\ - \sin(q\delta_T)\right] 
     24            + \Delta\rho_T\sin(q\delta_T) 
     25        \right\rbrace^2 
     26 
     27where $\delta_T$ is *tail_length*, \delta_H is *head_length*, 
     28$\Delta\rho_H$ is the head contrast (*head_sld* $-$ *solvent_sld*), 
     29and $\Delta\rho_T$ is tail contrast (*sld* $-$ *solvent_sld*). 
    2230 
    2331The 2D scattering intensity is calculated in the same way as 1D, where 
     
    2634.. math:: 
    2735 
    28     Q = \sqrt{Q_x^2 + Q_y^2} 
     36    q = \sqrt{q_x^2 + q_y^2} 
    2937 
    30 The returned value is in units of |cm^-1|, on absolute scale. In the 
    31 parameters, *sld_tail* = SLD of the tail group, and *sld_head* = SLD 
    32 of the head group. 
    3338 
    34 .. image:: img/lamellarFFHG_138.jpg 
     39.. figure:: img/lamellarFFHG_1d.jpg 
    3540 
    36 *Figure. 1D plot using the default values (w/1000 data point).* 
     41    1D plot using the default values (w/1000 data point). 
    3742 
    38 Our model uses the form factor calculations implemented in a C library 
    39 provided by the NIST Center for Neutron Research (Kline, 2006). 
    40  
    41 REFERENCE 
     43References 
     44---------- 
    4245 
    4346F Nallet, R Laversanne, and D Roux, J. Phys. II France, 3, (1993) 487-502 
     
    5154 
    5255name = "lamellar_FFHG" 
    53 title = "Random lamellar phase with Head Groups " 
     56title = "Random lamellar phase with Head Groups" 
    5457description = """\ 
    5558    [Random lamellar phase with Head Groups] 
  • sasmodels/models/lamellarPC.py

    r3e428ec rd138d43  
    77can be used for large multilamellar vesicles.** 
    88 
    9 *2.1.33.1. Definition* 
     9Definition 
     10---------- 
    1011 
    11 The scattering intensity *I(q)* is calculated as 
     12In the equations below, 
    1213 
    13 .. image:: img/image145.jpg 
     14- *scale* is used instead of the mass per area of the bilayer $\Gamma_m$ 
     15  (this corresponds to the volume fraction of the material in the bilayer, 
     16  *not* the total excluded volume of the paracrystal), 
     17 
     18- *sld* $-$ *solvent_sld* is the contrast $\Delta \rho$, 
     19 
     20- *thickness* is the layer thickness $t$, 
     21 
     22- *Nlayers* is the number of layers $N$, 
     23 
     24- *spacing* is the average distance between adjacent layers 
     25  $\langle D \rangle$, and 
     26 
     27- *spacing_polydisp* is the relative standard deviation of the Gaussian 
     28  layer distance distribution $\sigma_D / \langle D \rangle$. 
     29 
     30 
     31The scattering intensity $I(q)$ is calculated as 
     32 
     33.. math:: 
     34 
     35    I(q) = 2\pi\Delta\rho^2\Gamma_m\frac{P_\text{bil}(q)}{q^2} Z_N(q) 
    1436 
    1537The form factor of the bilayer is approximated as the cross section of an 
    16 infinite, planar bilayer of thickness *t* 
     38infinite, planar bilayer of thickness $t$ 
    1739 
    18 .. image:: img/image146.jpg 
     40.. math:: 
    1941 
    20 Here, the scale factor is used instead of the mass per area of the 
    21 bilayer (*G*). The scale factor is the volume fraction of the material in 
    22 the bilayer, *not* the total excluded volume of the paracrystal. 
    23 *Z*\ :sub:`N`\ *(q)* describes the interference effects for aggregates 
     42    P_\text{bil}(q) = \left(\frac{\sin(qt/2)}{qt/2}\right)^2 
     43 
     44$Z_N(q)$ describes the interference effects for aggregates 
    2445consisting of more than one bilayer. The equations used are (3-5) 
    25 from the Bergstrom reference below. 
     46from the Bergstrom reference: 
     47 
     48.. math:: 
     49 
     50 
     51    Z_N(q) = \frac{1 - w^2}{1 + w^2 - 2w \cos(q \langle D \rangle)} 
     52        + x_N S_N + (1 - x_N) S_{N+1} 
     53 
     54where 
     55 
     56.. math:: 
     57 
     58    S_N(q) = \frac{a_N}{N}[1 + w^2 - 2 w \cos(q \langle D \rangle)]^2 
     59 
     60and 
     61 
     62.. math:: 
     63 
     64    a_N = 4w^2 - 2(w^3 + w) \cos(q \langle D \rangle) 
     65        - 4w^{N+2}\cos(Nq \langle D \rangle) 
     66        + 2 w^{N+3}\cos[(N-1)q \langle D \rangle] 
     67        + 2w^{N+1}\cos[(N+1)q \langle D \rangle] 
     68 
     69for the layer spacing distribution $w = \exp(-\sigma_D^2 q^2/2)$. 
    2670 
    2771Non-integer numbers of stacks are calculated as a linear combination of 
    2872the lower and higher values 
    2973 
    30 .. image:: img/image147.jpg 
     74.. math:: 
     75 
     76    N_L = x_N N + (1 - x_N)(N+1) 
    3177 
    3278The 2D scattering intensity is the same as 1D, regardless of the orientation 
    33 of the *q* vector which is defined as 
     79of the $q$ vector which is defined as 
    3480 
    3581.. math:: 
    3682 
    37     Q = \sqrt{Q_x^2 + Q_y^2} 
     83    q = \sqrt{q_x^2 + q_y^2} 
    3884 
    39 The parameters of the model are *Nlayers* = no. of layers, and 
    40 *pd_spacing* = polydispersity of spacing. 
    4185 
    42 ==============  ========  ============= 
    43 Parameter name  Units     Default value 
    44 ==============  ========  ============= 
    45 background      |cm^-1|   0 
    46 scale           None      1 
    47 Nlayers         None      20 
    48 pd_spacing      None      0.2 
    49 sld_layer       |Ang^-2|  1e-6 
    50 sld_solvent     |Ang^-2|  6.34e-6 
    51 spacing         |Ang|     250 
    52 thickness       |Ang|     33 
    53 ==============  ========  ============= 
     86.. figure:: img/lamellarPC_1d.jpg 
    5487 
    55 .. image:: img/image148.jpg 
     88    1D plot using the default values above (w/20000 data point). 
    5689 
    57 *Figure. 1D plot using the default values above (w/20000 data point).* 
    58  
    59 Our model uses the form factor calculations implemented in a C library 
    60 provided by the NIST Center for Neutron Research (Kline, 2006). 
    61  
    62 REFERENCE 
     90Reference 
     91--------- 
    6392 
    6493M Bergstrom, J S Pedersen, P Schurtenberger, S U Egelhaaf, 
     
    90119               "d-spacing of paracrystal stack"], 
    91120              ["spacing_polydisp", "Ang", 0.0, [0.0, inf], "", 
    92                "d-spacing of paracrystal stack"], 
     121               "d-spacing polydispersity"], 
    93122              ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "", 
    94123               "layer scattering length density"], 
  • sasmodels/models/lorentz.py

    r66ebdd6 rd138d43  
    1212 
    1313For 2D data: The 2D scattering intensity is calculated in the same way as 1D,  
    14 where the *q* vector is defined as 
     14where the $q$ vector is defined as 
    1515 
    1616.. math:: q=\sqrt{q_x^2 + q_y^2} 
    1717 
    18 .. image:: img/image179.jpg 
     18.. figure:: img/lorentz_1d.jpg 
    1919 
    20 *Figure. 1D plot using the default values (w/200 data point).* 
    21 REFERENCE 
     20    1D plot using the default values (w/200 data point). 
     21 
     22Reference 
     23--------- 
    2224 
    2325L.S. Qrnstein and F. Zernike, *Proc. Acad. Sci. Amsterdam* 17, 793 (1914), and 
  • sasmodels/models/parallelepiped.py

    rcd3dba0 rd138d43  
    33r""" 
    44The form factor is normalized by the particle volume. 
    5  
    6 For information about polarised and magnetic scattering, click here_. 
    75 
    86Definition 
     
    119This model provides the form factor, *P(q)*, for a rectangular parallelepiped 
    1210(below) where the form factor is normalized by the volume of the 
    13 parallelepiped. If you need to apply polydispersity, see also the 
    14 RectangularPrismModel_. 
     11parallelepiped. If you need to apply polydispersity, see also 
     12rectangular_prism_. 
    1513 
    1614The calculated form factor is: 
  • sasmodels/models/spherepy.py

    r34375ea rd138d43  
    3636Validation of our code was done by comparing the output of the 1D model 
    3737to the output of the software provided by the NIST (Kline, 2006). 
    38 Figure :num:`figure #sphere-comparison` shows a comparison of the output 
     38Figure :num:`figure #spherepy-comparison` shows a comparison of the output 
    3939of our model and the output of the NIST software. 
    4040 
    41 .. _sphere-comparison: 
     41.. _spherepy-comparison: 
    4242 
    4343.. figure:: img/sphere_comparison.jpg 
  • sasmodels/resolution.py

    r7f7f99f rd138d43  
    55""" 
    66from __future__ import division 
     7 
     8__all__ = ["Resolution", "Perfect1D", "Pinhole1D", "Slit1D", 
     9           "apply_resolution_matrix", "pinhole_resolution", "slit_resolution", 
     10           "pinhole_extend_q", "slit_extend_q", "bin_edges", 
     11           "interpolate", "linear_extrapolation", "geometric_extrapolation", 
     12           ] 
     13 
    714from scipy.special import erf 
    815from numpy import sqrt, log, log10 
     
    189196 
    190197 
    191     Algorithm 
    192     --------- 
     198    **Algorithm** 
    193199 
    194200    We are using the mid-point integration rule to assign weights to each 
     
    429435 
    430436    Substituting: 
     437 
     438    .. math:: 
    431439 
    432440        n_\text{extend} = (n-1) (\log q_\text{max} - \log q_n) 
  • sasmodels/sasview_model.py

    raa4946b rd138d43  
    229229 
    230230    def evalDistribution(self, qdist): 
    231         """ 
     231        r""" 
    232232        Evaluate a distribution of q-values. 
    233233 
    234         * For 1D, a numpy array is expected as input: :: 
     234        :param qdist: array of q or a list of arrays [qx,qy] 
     235 
     236        * For 1D, a numpy array is expected as input 
     237 
     238        :: 
    235239 
    236240            evalDistribution(q) 
    237241 
    238           where q is a numpy array. 
    239  
    240         * For 2D, a list of numpy arrays are expected: [qx,qy], 
    241           with 1D arrays:: 
     242          where *q* is a numpy array. 
     243 
     244        * For 2D, a list of *[qx,qy]* is expected with 1D arrays as input 
     245 
     246        :: 
    242247 
    243248              qx = [ qx[0], qx[1], qx[2], ....] 
    244  
    245           and:: 
    246  
    247249              qy = [ qy[0], qy[1], qy[2], ....] 
    248250 
    249         Then get :: 
    250  
    251             q = numpy.sqrt(qx^2+qy^2) 
    252  
    253         that is a qr in 1D array:: 
    254  
    255             q = [q[0], q[1], q[2], ....] 
    256  
    257  
    258         :param qdist: ndarray of scalar q-values or list [qx,qy] 
    259         where qx,qy are 1D ndarrays 
     251        If the model is 1D only, then 
     252 
     253        .. math:: 
     254 
     255            q = \sqrt{q_x^2+q_y^2} 
     256 
    260257        """ 
    261258        if isinstance(qdist, (list, tuple)): 
Note: See TracChangeset for help on using the changeset viewer.