Changeset d138d43 in sasmodels
- Timestamp:
- Nov 30, 2015 2:24:28 PM (9 years ago)
- 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
- Files:
-
- 5 added
- 6 deleted
- 17 edited
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
doc/genmodel.py
r61ba623 rd138d43 1 1 import sys 2 import os3 2 sys.path.insert(0,'..') 4 3 5 4 # Convert ../sasmodels/models/name.py to sasmodels.models.name 6 5 module_name = sys.argv[1][3:-3].replace('/','.').replace('\\','.') 7 print module_name6 #print module_name 8 7 module = __import__(module_name) 9 8 for part in module_name.split('.')[1:]: 10 9 module = getattr(module, part) 11 print module10 #print module 12 11 13 12 # Load the doc string from the module definition file and store it in rst -
doc/index.rst
r61ba623 rd138d43 15 15 16 16 guide/index.rst 17 developer/index.rst 17 18 ref/index.rst 18 19 api/index.rst -
sasmodels/exception.py
r0763009 rd138d43 15 15 to the caller using a bare "raise" statement to reraise the annotated 16 16 exception. 17 17 18 Example:: 19 18 20 >>> D = {} 19 21 >>> try: -
sasmodels/generate.py
re1ace4d rd138d43 200 200 201 201 import sys 202 from os.path import abspath, dirname, join as joinpath, exists, basename 202 from os.path import abspath, dirname, join as joinpath, exists, basename, \ 203 splitext 203 204 import re 204 205 … … 565 566 demo_parameters = dict((p[0],p[2]) for p in parameters) 566 567 filename = abspath(kernel_module.__file__) 567 kernel_id = basename(filename)[:-3]568 kernel_id = splitext(basename(filename))[0] 568 569 name = getattr(kernel_module, 'name', None) 569 570 if name is None: -
sasmodels/kerneldll.py
r5edfe12 rd138d43 21 21 free from microsoft: 22 22 23 ` http://www.microsoft.com/en-us/download/details.aspx?id=44266`_23 `<http://www.microsoft.com/en-us/download/details.aspx?id=44266>`_ 24 24 25 25 Again, this requires that the compiler is available on your path. This is -
sasmodels/models/bcc.py
rcd3dba0 rd138d43 7 7 and the size of the paracrystal is infinitely large. Paracrystalline distortion 8 8 is 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.11 9 12 10 Definition … … 46 44 where $g$ is a fractional distortion based on the nearest neighbor distance. 47 45 48 The body-centered cubic lattice is49 46 50 .. image:: img/bcc_lattice.jpg 47 .. figure:: img/bcc_lattice.jpg 48 49 Body-centered cubic lattice. 51 50 52 51 For a crystal, diffraction peaks appear at reduced q-values given by … … 68 67 \end{eqnarray} 69 68 70 **NB : The calculation of $Z(q)$ is a double numerical integral that must69 **NB**: The calculation of $Z(q)$ is a double numerical integral that must 71 70 be carried out with a high density of points to properly capture the sharp 72 peaks of the paracrystalline scattering. **So be warned that the calculation71 peaks of the paracrystalline scattering. So be warned that the calculation 73 72 is SLOW. Go get some coffee. Fitting of any experimental data must be 74 73 resolution smeared for any meaningful fit. This makes a triple integral. … … 78 77 *qmin* = 0.001 |Ang^-1|, *qmax* = 0.1 |Ang^-1| and the above default values. 79 78 80 .. image:: img/bcc_1d.jpg79 .. figure:: img/bcc_1d.jpg 81 80 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). 84 82 85 83 The 2D (Anisotropic model) is based on the reference below where $I(q)$ is … … 88 86 model computation. 89 87 90 .. image:: img/bcc_orientation.gif88 .. figure:: img/crystal_orientation.gif 91 89 92 .. image:: img/bcc_2d.jpg 90 Orientation of the crystal with respect to the scattering plane. 93 91 94 *Figure. 2D plot using the default values (w/200X200 pixels).* 92 .. figure:: img/bcc_2d.jpg 95 93 96 REFERENCE 94 2D plot using the default values (w/200X200 pixels).* 95 96 Reference 97 97 --------- 98 98 -
sasmodels/models/broad_peak.py
r485aee2 rd138d43 31 31 32 32 33 .. image:: img/image175.jpg33 .. figure:: img/broad_peak_1d.jpg 34 34 35 *Figure. 1D plot using the default values (w/200 data point).* 35 1D plot using the default values (w/200 data point). 36 36 37 37 REFERENCE -
sasmodels/models/cylinder.py
r3e428ec rd138d43 3 3 r""" 4 4 The form factor is normalized by the particle volume. 5 6 For information about polarised and magnetic scattering, click here_.7 5 8 6 Definition -
sasmodels/models/fcc.py
r3e428ec rd138d43 9 9 a Gaussian distribution. 10 10 11 The returned value is scaled to units of |cm^-1|\ |sr^-1|, absolute scale.12 13 11 Definition 14 12 ---------- 15 13 16 The scattering intensity *I(q)*is calculated as14 The scattering intensity $I(q)$ is calculated as 17 15 18 .. image:: img/image158.jpg16 .. math:: 19 17 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 20 where *scale* is the volume fraction of spheres, $V_p$ is the volume of 21 21 the 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)*22 structure, $P(q)$ is the form factor of the sphere (normalized), and $Z(q)$ 23 23 is the paracrystalline structure factor for a face-centered cubic structure. 24 24 25 Equation (1) of the 1990 reference is used to calculate *Z(q)*, using26 equations (23)-(25) from the 1987 paper for *Z1*\ , *Z2*\ , and *Z3*\.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$. 27 27 28 28 The lattice correction (the occupied volume of the lattice) for a 29 29 face-centered cubic structure of particles of radius *R* and nearest 30 neighbor separation *D*is30 neighbor separation $D$ is 31 31 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} 33 35 34 36 The distortion factor (one standard deviation) of the paracrystal is 35 included in the calculation of *Z(q)*37 included in the calculation of $Z(q)$ 36 38 37 .. image:: img/image160.jpg39 .. math:: 38 40 39 where *g* is a fractional distortion based on the nearest neighbor distance. 41 \Delta a = gD 40 42 41 The face-centered cubic lattice is 43 where $g$ is a fractional distortion based on the nearest neighbor distance. 42 44 43 .. image:: img/image161.jpg 45 .. figure:: img/fcc_lattice.jpg 46 47 Face-centered cubic lattice. 44 48 45 49 For a crystal, diffraction peaks appear at reduced q-values given by 46 50 47 .. image:: img/image162.jpg51 .. math:: 48 52 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 55 where for a face-centered cubic lattice $h, k , l$ all odd or all 56 even are allowed and reflections where $h, k, l$ are mixed odd/even 51 57 are forbidden. Thus the peak positions correspond to (just the first 5) 52 58 53 .. image:: img/image163.jpg59 .. math:: 54 60 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 67 must be carried out with a high density of points to properly capture 68 the sharp peaks of the paracrystalline scattering. So be warned that the 58 69 calculation is SLOW. Go get some coffee. Fitting of any experimental data 59 70 must be resolution smeared for any meaningful fit. This makes a triple … … 63 74 *qmax* = 0.1 |Ang^-1| and the above default values. 64 75 65 .. image:: img/image164.jpg76 .. figure:: img/fcc_1d.jpg 66 77 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). 68 79 69 80 The 2D (Anisotropic model) is based on the reference below where *I(q)* is … … 72 83 2D model computation. 73 84 74 .. image:: img/image165.gif85 .. figure:: img/crystal_orientation.gif 75 86 76 .. image:: img/image166.jpg 87 Orientation of the crystal with respect to the scattering plane. 77 88 78 *Figure. 2D plot using the default values (w/200X200 pixels).* 89 .. figure:: img/fcc_2d.jpg 79 90 80 REFERENCE 91 2D plot using the default values (w/200X200 pixels). 92 93 Reference 94 --------- 81 95 82 96 Hideki Matsuoka et. al. *Physical Review B*, 36 (1987) 1754-1765 -
sasmodels/models/hollow_cylinder.py
r66ebdd6 rd138d43 1 1 r""" 2 This model provides the form factor, *P(q)*, for a monodisperse hollow right2 This model provides the form factor, $P(q)$, for a monodisperse hollow right 3 3 angle circular cylinder (tube) where the form factor is normalized by the 4 4 volume of the tube 5 5 6 *P(q)* = *scale* \* *<F*\ :sup:`2`\ *>* / *V*\ :sub:`shell` + *background* 6 .. math:: 7 7 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 10 where the averaging $\langle \rangle$ is applied only for the 1D calculation. 9 11 10 12 The inside and outside of the hollow cylinder are assumed have the same SLD. … … 18 20 19 21 \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} \\ 27 33 \end{eqnarray} 28 34 29 where *scale* is a scale factor and *J1* is the 1st order Bessel function. 35 where *scale* is a scale factor and $J_1$ is the 1st order 36 Bessel function. 30 37 31 38 To 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 case39 the axis of the cylinder using two angles $\theta$ and $\phi$. As for the case 33 40 of the cylinder, those angles are defined in Figure 2 of the CylinderModel. 34 41 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 43 based on the radius and 2 length values, and used as the effective radius 44 for $S(Q)$ when $P(Q) * S(Q)$ is applied. 38 45 39 46 In the parameters, the contrast represents SLD :sub:`shell` - SLD :sub:`solvent` 40 and the *radius* = *R*\ :sub:`shell` while *core_radius* = *R*\ :sub:`core`.47 and the *radius* is $R_\text{shell}$ while *core_radius* is $R_\text{core}$. 41 48 42 .. image:: img/image074.jpg49 .. figure:: img/hollow_cylinder_1d.jpg 43 50 44 *Figure. 1D plot using the default values (w/1000 data point).* 51 1D plot using the default values (w/1000 data point). 45 52 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 48 54 49 .. image:: img/image061.jpg 55 Definition of the angles for the oriented hollow_cylinder model. 50 56 51 *Figure. Definition of the angles for the oriented hollow_cylinder model.* 57 .. figure:: img/orientation2.jpg 52 58 53 .. image:: img/image062.jpg 59 Examples of the angles for oriented pp against the detector plane. 54 60 55 *Figure. Examples of the angles for oriented pp against the detector plane.* 56 57 REFERENCE 61 Reference 62 --------- 58 63 59 64 L A Feigin and D I Svergun, *Structure Analysis by Small-Angle X-Ray and -
sasmodels/models/lamellarFFHG.py
r22eac46 rd138d43 5 5 region is taken to be different from the SLD of the tail region. 6 6 7 *2.1.31.1. Definition* 7 Definition 8 ---------- 8 9 9 The scattering intensity *I(q)*is10 The scattering intensity $I(q)$ is 10 11 11 12 .. math:: 12 13 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} 14 15 15 The form factor is16 The form factor $P(q)$ is 16 17 17 .. image:: img/lamellarFFHG_.jpg18 .. math:: 18 19 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 27 where $\delta_T$ is *tail_length*, \delta_H is *head_length*, 28 $\Delta\rho_H$ is the head contrast (*head_sld* $-$ *solvent_sld*), 29 and $\Delta\rho_T$ is tail contrast (*sld* $-$ *solvent_sld*). 22 30 23 31 The 2D scattering intensity is calculated in the same way as 1D, where … … 26 34 .. math:: 27 35 28 Q = \sqrt{Q_x^2 + Q_y^2}36 q = \sqrt{q_x^2 + q_y^2} 29 37 30 The returned value is in units of |cm^-1|, on absolute scale. In the31 parameters, *sld_tail* = SLD of the tail group, and *sld_head* = SLD32 of the head group.33 38 34 .. image:: img/lamellarFFHG_138.jpg39 .. figure:: img/lamellarFFHG_1d.jpg 35 40 36 *Figure. 1D plot using the default values (w/1000 data point).* 41 1D plot using the default values (w/1000 data point). 37 42 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 43 References 44 ---------- 42 45 43 46 F Nallet, R Laversanne, and D Roux, J. Phys. II France, 3, (1993) 487-502 … … 51 54 52 55 name = "lamellar_FFHG" 53 title = "Random lamellar phase with Head Groups 56 title = "Random lamellar phase with Head Groups" 54 57 description = """\ 55 58 [Random lamellar phase with Head Groups] -
sasmodels/models/lamellarPC.py
r3e428ec rd138d43 7 7 can be used for large multilamellar vesicles.** 8 8 9 *2.1.33.1. Definition* 9 Definition 10 ---------- 10 11 11 The scattering intensity *I(q)* is calculated as 12 In the equations below, 12 13 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 31 The 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) 14 36 15 37 The form factor of the bilayer is approximated as the cross section of an 16 infinite, planar bilayer of thickness *t*38 infinite, planar bilayer of thickness $t$ 17 39 18 .. image:: img/image146.jpg40 .. math:: 19 41 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 24 45 consisting of more than one bilayer. The equations used are (3-5) 25 from the Bergstrom reference below. 46 from 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 54 where 55 56 .. math:: 57 58 S_N(q) = \frac{a_N}{N}[1 + w^2 - 2 w \cos(q \langle D \rangle)]^2 59 60 and 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 69 for the layer spacing distribution $w = \exp(-\sigma_D^2 q^2/2)$. 26 70 27 71 Non-integer numbers of stacks are calculated as a linear combination of 28 72 the lower and higher values 29 73 30 .. image:: img/image147.jpg 74 .. math:: 75 76 N_L = x_N N + (1 - x_N)(N+1) 31 77 32 78 The 2D scattering intensity is the same as 1D, regardless of the orientation 33 of the *q*vector which is defined as79 of the $q$ vector which is defined as 34 80 35 81 .. math:: 36 82 37 Q = \sqrt{Q_x^2 + Q_y^2}83 q = \sqrt{q_x^2 + q_y^2} 38 84 39 The parameters of the model are *Nlayers* = no. of layers, and40 *pd_spacing* = polydispersity of spacing.41 85 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 54 87 55 .. image:: img/image148.jpg 88 1D plot using the default values above (w/20000 data point). 56 89 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 90 Reference 91 --------- 63 92 64 93 M Bergstrom, J S Pedersen, P Schurtenberger, S U Egelhaaf, … … 90 119 "d-spacing of paracrystal stack"], 91 120 ["spacing_polydisp", "Ang", 0.0, [0.0, inf], "", 92 "d-spacing of paracrystal stack"],121 "d-spacing polydispersity"], 93 122 ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "", 94 123 "layer scattering length density"], -
sasmodels/models/lorentz.py
r66ebdd6 rd138d43 12 12 13 13 For 2D data: The 2D scattering intensity is calculated in the same way as 1D, 14 where the *q*vector is defined as14 where the $q$ vector is defined as 15 15 16 16 .. math:: q=\sqrt{q_x^2 + q_y^2} 17 17 18 .. image:: img/image179.jpg18 .. figure:: img/lorentz_1d.jpg 19 19 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 22 Reference 23 --------- 22 24 23 25 L.S. Qrnstein and F. Zernike, *Proc. Acad. Sci. Amsterdam* 17, 793 (1914), and -
sasmodels/models/parallelepiped.py
rcd3dba0 rd138d43 3 3 r""" 4 4 The form factor is normalized by the particle volume. 5 6 For information about polarised and magnetic scattering, click here_.7 5 8 6 Definition … … 11 9 This model provides the form factor, *P(q)*, for a rectangular parallelepiped 12 10 (below) where the form factor is normalized by the volume of the 13 parallelepiped. If you need to apply polydispersity, see also the14 RectangularPrismModel_.11 parallelepiped. If you need to apply polydispersity, see also 12 rectangular_prism_. 15 13 16 14 The calculated form factor is: -
sasmodels/models/spherepy.py
r34375ea rd138d43 36 36 Validation of our code was done by comparing the output of the 1D model 37 37 to the output of the software provided by the NIST (Kline, 2006). 38 Figure :num:`figure #sphere -comparison` shows a comparison of the output38 Figure :num:`figure #spherepy-comparison` shows a comparison of the output 39 39 of our model and the output of the NIST software. 40 40 41 .. _sphere -comparison:41 .. _spherepy-comparison: 42 42 43 43 .. figure:: img/sphere_comparison.jpg -
sasmodels/resolution.py
r7f7f99f rd138d43 5 5 """ 6 6 from __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 7 14 from scipy.special import erf 8 15 from numpy import sqrt, log, log10 … … 189 196 190 197 191 Algorithm 192 --------- 198 **Algorithm** 193 199 194 200 We are using the mid-point integration rule to assign weights to each … … 429 435 430 436 Substituting: 437 438 .. math:: 431 439 432 440 n_\text{extend} = (n-1) (\log q_\text{max} - \log q_n) -
sasmodels/sasview_model.py
raa4946b rd138d43 229 229 230 230 def evalDistribution(self, qdist): 231 """231 r""" 232 232 Evaluate a distribution of q-values. 233 233 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 :: 235 239 236 240 evalDistribution(q) 237 241 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 :: 242 247 243 248 qx = [ qx[0], qx[1], qx[2], ....] 244 245 and::246 247 249 qy = [ qy[0], qy[1], qy[2], ....] 248 250 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 260 257 """ 261 258 if isinstance(qdist, (list, tuple)):
Note: See TracChangeset
for help on using the changeset viewer.