Changeset 3d40839 in sasmodels


Ignore:
Timestamp:
Oct 28, 2017 9:28:22 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
0db85af
Parents:
e964ab1
Message:

update orientation docs

Location:
doc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • doc/_extensions/dollarmath.py

    r103ea45 r3d40839  
    1212import re 
    1313 
    14 _dollar = re.compile(r"(?:^|(?<=\s|[(]))[$]([^\n]*?)(?<![\\])[$](?:$|(?=\s|[.,;)\\]))") 
     14_dollar = re.compile(r"(?:^|(?<=\s|[-(]))[$]([^\n]*?)(?<![\\])[$](?:$|(?=\s|[-.,;)\\]))") 
    1515_notdollar = re.compile(r"\\[$]") 
    1616 
  • doc/developer/overview.rst

    re964ab1 r3d40839  
    180180should always be preceded by their definition." 
    181181 
    182 We are using the z-y-z convention with extrinsic rotations $\Psi-\theta-\phi$ 
    183 for the particle orientation and $x-y-z$ convention with extrinsic rotations 
    184 $\psi-\theta-\phi$ for jitter, with jitter applied before particle 
    185 orientation. 
     182We are using the $z$-$y$-$z$ convention with extrinsic rotations 
     183$\Psi$-$\theta$-$\phi$ for the particle orientation and $x$-$y$-$z$ 
     184convention with extrinsic rotations $\Psi$-$\theta$-$\phi$ for jitter, with 
     185jitter applied before particle orientation. 
    186186 
    187187For numerical integration within form factors etc. sasmodels is mostly using 
     
    191191with $cos(\theta)$ which changes the limits of integration from 0 to $\pi/2$ 
    192192to 0 to 1 and also conveniently absorbs the $sin(\theta)$ scale factor in the 
    193 integration. This can cause confusion if checking equations to say include in 
    194 a paper or thesis! Most models use the same core kernel code expressed in 
    195 terms of the rotated view (qa, qb, qc) for both the 1D and the 2D models, but 
    196 there are also historical quirks such as the parallelepiped model, which has 
    197 a useless transformation representing j0(a qa) as j0(b qa a/b). 
    198  
    199 Useful testing routines include - 
     193integration. This can cause confusion if checking equations to include in a 
     194paper or thesis! Most models use the same core kernel code expressed in terms 
     195of the rotated view ($q_a$, $q_b$, $q_c$) for both the 1D and the 2D models, 
     196but there are also historical quirks such as the parallelepiped model, which 
     197has a useless transformation representing $j_0(a q_a)$ as $j_0(b q_a a/b)$. 
     198 
     199Useful testing routines include: 
    200200 
    201201:mod:`asymint` a direct implementation of the surface integral for certain 
     
    204204functions to arbitrary precision). It uses $\theta$ ranging from 0 to $\pi$ 
    205205and $\phi$ ranging from 0 to $2\pi$. It perhaps would benefit from including 
    206 the U-substitution for theta. 
     206the U-substitution for $\theta$. 
    207207 
    208208:mod:`check1d` uses sasmodels 1D integration and compares that with a 
    209209rectangle distribution in $\theta$ and $\phi$, with $\theta$ limits set to 
    210 $\pm90/\sqrt(3)$ and $\phi$ limits set to $\pm180/\sqrt(3)$ [The rectangle 
     210$\pm 90/\sqrt(3)$ and $\phi$ limits set to $\pm 180/\sqrt(3)$ [The rectangle 
    211211weight function uses the fact that the distribution width column is labelled 
    212 sigma to decide that the 1-sigma width of a rectangular distribution needs to 
     212sigma to decide that the 1-$\sigma$ width of a rectangular distribution needs to 
    213213be multiplied by $\sqrt(3)$ to get the corresponding gaussian equivalent, or 
    214214similar reasoning.] This should rotate the sample through the entire 
    215 $\theta-\phi$ surface according to the pattern that you see in jitter.py when 
     215$\theta$-$\phi$ surface according to the pattern that you see in jitter.py when 
    216216you modify it to use 'rectangle' rather than 'gaussian' for its distribution 
    217 without changing the viewing angle. When computing the dispersity integral, 
    218 weights are scaled by abs(cos(dtheta)) to account for the points in phi 
    219 getting closer together as dtheta increases. This integrated dispersion is 
    220 computed at a set of $(qx, qy)$ points $(q cos(\alpha), q sin(\alpha))$ at 
    221 some angle $\alpha$ (currently angle=0) for each q used in the 1-D 
    222 integration. The individual q points should be equivalent to asymint rect-n 
    223 when the viewing angle is set to (theta,phi,psi) = (90, 0, 0). Such tests can 
    224 help to validate that 2d intensity is consistent with 1d models. 
    225  
    226 :mod:`sascomp -sphere=n` uses the identical rectangular distribution to 
    227 compute the pattern of the qx-qy grid. You can see from triaxial_ellipsoid 
    228 that there may be something wrong conceptually since the pattern is no longer 
    229 circular when the view (theta,phi,psi) is not (90, phi, 0). check1d shows 
    230 that it is different from the sasmodels 1D integral even when at theta=0, 
    231 psi=0. Cross checking the values with asymint, the sasmodels 1D integral is 
    232 better at low q, though for very large structures there are not enough points 
    233 in the integration for sasmodels 1D to compute the high q 1D integral 
    234 correctly. [Some of that may now be fixed?] 
     217without changing the viewing angle. In order to match the 1-D pattern for 
     218an arbitrary viewing angle on triaxial shapes, we need to integrate 
     219over $\theta$, $\phi$ and $\Psi$. 
     220 
     221When computing the dispersity integral, weights are scaled by 
     222$|\cos(\delta \theta)|$ to account for the points in $\phi$ getting closer 
     223together as $\delta \theta$ increases. 
     224[This will probably change so that instead of adjusting the weights, we will 
     225adjust $\delta\theta$-$\delta\phi$ mesh so that the point density in 
     226$\delta\phi$ is lower at larger $\delta\theta$. The flag USE_SCALED_PHI in 
     227*kernel_iq.c* selects an alternative algorithm.] 
     228 
     229The integrated dispersion is computed at a set of $(qx, qy)$ points $(q 
     230\cos(\alpha), q \sin(\alpha))$ at some angle $\alpha$ (currently angle=0) for 
     231each $q$ used in the 1-D integration. The individual $q$ points should be 
     232equivalent to asymint rect-n when the viewing angle is set to 
     233$(\theta,\phi,\Psi) = (90, 0, 0)$. Such tests can help to validate that 2d 
     234models are consistent with 1d models. 
     235 
     236:mod:`sascomp -sphere=n` uses the same rectangular distribution as check1d to 
     237compute the pattern of the $q_x$-$q_y$ grid. 
    235238 
    236239The :mod:`sascomp` utility can be used for 2d as well as 1d calculations to 
  • doc/guide/orientation/orientation.rst

    re964ab1 r3d40839  
    88or orientation in a magnetic field. 
    99 
    10 In general we first need to define the mean, or a reference orientation 
     10In general we first need to define the reference orientation 
    1111of the particles with respect to the incoming neutron or X-ray beam. This 
    1212is done using three angles: $\theta$ and $\phi$ define the orientation of 
     
    2929 
    3030    Definition of angles for oriented elliptical cylinder, where axis_ratio 
    31     b/a is shown >1, Note that rotation $\theta$, initially in the $xz$ 
    32     plane, is carried out first, then rotation $\phi$ about the $z$ axis, 
     31    b/a is shown >1, Note that rotation $\theta$, initially in the $x$-$z$ 
     32    plane, is carried out first, then rotation $\phi$ about the $z$-axis, 
    3333    finally rotation $\Psi$ is around the axis of the cylinder. The neutron 
    3434    or X-ray beam is along the $z$ axis. 
     
    4242Having established the mean direction of the particle we can then apply 
    4343angular orientation distributions. This is done by a numerical integration 
    44 over a range of angles in a similar way to polydispersity for particle size. 
     44over a range of angles in a similar way to particle size dispersity. 
    4545In the current version of sasview the orientational dispersity is defined 
    4646with respect to the axes of the particle. 
    4747 
    48 The $\theta$ and $\phi$ parameters to orient the cylinder only appear in the 
    49 model when fitting 2d data. On introducing "Orientational Distribution" in 
     48The $\theta$ and $\phi$ orientation parameters for the cylinder only appear 
     49when fitting 2d data. On introducing "Orientational Distribution" in 
    5050the angles, "distribution of theta" and "distribution of phi" parameters will 
    5151appear. These are actually rotations about the axes $\delta_1$ and $\delta_2$ 
    5252of the cylinder, the $b$ and $a$ axes of the cylinder cross section. (When 
    5353$\theta = \phi = 0$ these are parallel to the $Y$ and $X$ axes of the 
    54 instrument.) The third orientation distribution, in $\psi$, is about the $c$ 
     54instrument.) The third orientation distribution, in $\Psi$, is about the $c$ 
    5555axis of the particle. Some experimentation may be required to understand the 
    56562d patterns fully. A number of different shapes of distribution are 
     
    6565numerical integrations over one or more variables, so care should be taken, 
    6666especially with very large particles or more extreme aspect ratios. Users can 
    67 experiment with the values of Npts and Nsigs, the number of steps used in the 
     67experiment with the values of *Npts* and *Nsigs*, the number of steps used in the 
    6868integration and the range spanned in number of standard deviations. The 
    6969standard deviation is entered in units of degrees. For a rectangular 
    70 (uniform) distribution the full width should be $\pm\sqrt(3)$ ~ 1.73 standard 
     70(uniform) distribution the full width should be $\pm \sqrt(3)$ ~ 1.73 standard 
    7171deviations (this may be changed soon). 
    7272 
Note: See TracChangeset for help on using the changeset viewer.