source: sasview/src/sas/sasgui/perspectives/fitting/media/sm_help.rst @ 3cb3a51

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalcmagnetic_scattrelease-4.2.2ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 3cb3a51 was 5ed76f8, checked in by Paul Kienzle <pkienzle@…>, 8 years ago

docs: use latex in equations rather than unicode + rst markup

  • Property mode set to 100644
File size: 7.1 KB
RevLine 
[da53353]1.. sm_help.rst
2
3.. This is a port of the original SasView html help file to ReSTructured text
4.. by S King, ISIS, during SasView CodeCamp-III in Feb 2015.
5
[6aad2e8]6.. |inlineimage004| image:: sm_image004.png
7.. |inlineimage005| image:: sm_image005.png
8.. |inlineimage008| image:: sm_image008.png
9.. |inlineimage009| image:: sm_image009.png
10.. |inlineimage010| image:: sm_image010.png
11.. |inlineimage011| image:: sm_image011.png
12.. |inlineimage012| image:: sm_image012.png
13.. |inlineimage018| image:: sm_image018.png
14.. |inlineimage019| image:: sm_image019.png
[da53353]15
16
17.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
18
[f256d9b]19Smearing Functions
20==================
[da53353]21
[5ed76f8]22Sometimes the instrumental geometry used to acquire the experimental data has
23an impact on the clarity of features in the reduced scattering curve. For
24example, peaks or fringes might be slightly broadened. This is known as
25*Q resolution smearing*. To compensate for this effect one can either try and
26remove the resolution contribution - a process called *desmearing* - or add the
27resolution contribution into a model calculation/simulation (which by definition
28will be exact) to make it more representative of what has been measured
[27aabc1]29experimentally - a process called *smearing*. SasView will do the latter.
30
[5ed76f8]31Both smearing and desmearing rely on functions to describe the resolution
[27aabc1]32effect. SasView provides three smearing algorithms:
[da53353]33
[a0637de]34*  *Slit Smearing*
35*  *Pinhole Smearing*
36*  *2D Smearing*
[da53353]37
[5ed76f8]38SasView also has an option to use $Q$ resolution data (estimated at the time of
[27aabc1]39data reduction) supplied in a reduced data file: the *Use dQ data* radio button.
40
41.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
42
43dQ Smearing
44-----------
[5ed76f8]45
46If this option is checked, SasView will assume that the supplied $dQ$ values
[27aabc1]47represent the standard deviations of Gaussian functions.
48
[a0637de]49.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
[da53353]50
51Slit Smearing
[f256d9b]52-------------
53
54**This type of smearing is normally only encountered with data from X-ray Kratky**
55**cameras or X-ray/neutron Bonse-Hart USAXS/USANS instruments.**
[da53353]56
[f256d9b]57The slit-smeared scattering intensity is defined by
[da53353]58
[6aad2e8]59.. image:: sm_image002.png
[da53353]60
[f256d9b]61where *Norm* is given by
[da53353]62
[6aad2e8]63.. image:: sm_image003.png
[da53353]64
[f256d9b]65**[Equation 1]**
[da53353]66
[5ed76f8]67The functions $W_v(v)$ and $W_u(u)$
68refer to the slit width weighting function and the slit height weighting
69determined at the given $q$ point, respectively. It is assumed that the weighting
[f256d9b]70function is described by a rectangular function, such that
[da53353]71
[6aad2e8]72.. image:: sm_image006.png
[da53353]73
[f256d9b]74**[Equation 2]**
[da53353]75
76and
77
[6aad2e8]78.. image:: sm_image007.png
[da53353]79
[f256d9b]80**[Equation 3]**
[da53353]81
[5ed76f8]82so that $\Delta q_\alpha = \int_0^\infty d\alpha W_\alpha(\alpha)$
83for $\alpha = v$ and $u$.
[da53353]84
[5ed76f8]85Here $\Delta q_u$ and $\Delta q_v$ stand for
86the slit height (FWHM/2) and the slit width (FWHM/2) in $q$ space.
[f256d9b]87
88This simplifies the integral in Equation 1 to
[da53353]89
[6aad2e8]90.. image:: sm_image013.png
[da53353]91
[f256d9b]92**[Equation 4]**
93
[5ed76f8]94which may be solved numerically, depending on the nature of
95$\Delta q_u$ and $\Delta q_v$.
[da53353]96
[f256d9b]97Solution 1
98^^^^^^^^^^
[da53353]99
[5ed76f8]100**For $\Delta q_v= 0$ and $\Delta q_u = \text{constant}$.**
[da53353]101
[6aad2e8]102.. image:: sm_image016.png
[da53353]103
[5ed76f8]104For discrete $q$ values, at the $q$ values of the data points and at the $q$
105values extended up to $q_N = q_i + \Delta q_u$ the smeared
[f256d9b]106intensity can be approximately calculated as
[da53353]107
[6aad2e8]108.. image:: sm_image017.png
[da53353]109
[f256d9b]110**[Equation 5]**
[da53353]111
[5ed76f8]112where |inlineimage018| = 0 for $I_s$ when $j < i$ or $j > N-1$.
[da53353]113
[f256d9b]114Solution 2
115^^^^^^^^^^
[da53353]116
[5ed76f8]117**For $\Delta q_v = \text{constant}$ and $\Delta q_u= 0$.**
[da53353]118
[f256d9b]119Similar to Case 1
[da53353]120
[5ed76f8]121|inlineimage019| for $q_p = q_i - \Delta q_v$ and $q_N = q_i + \Delta q_v$
[da53353]122
[f256d9b]123**[Equation 6]**
[da53353]124
[5ed76f8]125where |inlineimage018| = 0 for $I_s$ when $j < p$ or $j > N-1$.
[da53353]126
[f256d9b]127Solution 3
128^^^^^^^^^^
129
[5ed76f8]130**For $\Delta q_u = \text{constant}$ and $\Delta q_v = \text{constant}$.**
[f256d9b]131
132In this case, the best way is to perform the integration of Equation 1
133numerically for both slit height and slit width. However, the numerical
134integration is imperfect unless a large number of iterations, say, at
135least 10000 by 10000 for each element of the matrix *W*, is performed.
136This is usually too slow for routine use.
137
138An alternative approach is used in SasView which assumes
139slit width << slit height. This method combines Solution 1 with the
140numerical integration for the slit width. Then
[da53353]141
[6aad2e8]142.. image:: sm_image020.png
[da53353]143
[f256d9b]144**[Equation 7]**
145
[5ed76f8]146for *q_p = q_i - \Delta q_v$ and $q_N = q_i + \Delta q_v$
147where |inlineimage018| = 0 for *I_s$ when $j < p$ or $j > N-1$.
[da53353]148
[a0637de]149.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
[da53353]150
151Pinhole Smearing
[f256d9b]152----------------
[da53353]153
[f256d9b]154**This is the type of smearing normally encountered with data from synchrotron**
155**SAXS cameras and SANS instruments.**
[da53353]156
[f256d9b]157The pinhole smearing computation is performed in a similar fashion to the slit-
158smeared case above except that the weight function used is a Gaussian. Thus
159Equation 6 becomes
[da53353]160
[6aad2e8]161.. image:: sm_image021.png
[da53353]162
[f256d9b]163**[Equation 8]**
[da53353]164
[a0637de]165.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
[da53353]166
1672D Smearing
[f256d9b]168-----------
[da53353]169
[f256d9b]170The 2D smearing computation is performed in a similar fashion to the 1D pinhole
171smearing above except that the weight function used is a 2D elliptical Gaussian.
172Thus
[da53353]173
[6aad2e8]174.. image:: sm_image022.png
[da53353]175
[f256d9b]176**[Equation 9]**
[da53353]177
[5ed76f8]178In Equation 9, $x_0 = q \cos(\theta)$, $y_0 = q \sin(\theta)$, and
179the primed axes, are all in the coordinate rotated by an angle $\theta$ about
180the z-axis (see the figure below) so that
181$x'_0 = x_0 \cos(\theta) + y_0 \sin(\theta)$ and
182$y'_0 = -x_0 \sin(\theta) + y_0 \cos(\theta)$.
183Note that the rotation angle is zero for a $xy$ symmetric
184elliptical Gaussian distribution. The $A$ is a normalization factor.
[da53353]185
[6aad2e8]186.. image:: sm_image023.png
[da53353]187
[5ed76f8]188Now we consider a numerical integration where each of the bins in $\theta$ and $R$ are
189*evenly* (this is to simplify the equation below) distributed by $\Delta \theta$
190and $\Delta R$, respectively, and it is further assumed that $I(x',y')$ is constant
[f256d9b]191within the bins. Then
[da53353]192
[6aad2e8]193.. image:: sm_image024.png
[da53353]194
[f256d9b]195**[Equation 10]**
196
197Since the weighting factor on each of the bins is known, it is convenient to
[5ed76f8]198transform $x'y'$ back to $xy$ coordinates (by rotating it by $-\theta$ around the
199$z$ axis).
[da53353]200
[f256d9b]201Then, for a polar symmetric smear
[da53353]202
[6aad2e8]203.. image:: sm_image025.png
[da53353]204
[f256d9b]205**[Equation 11]**
[da53353]206
207where
208
[6aad2e8]209.. image:: sm_image026.png
[da53353]210
[5ed76f8]211while for a $xy$ symmetric smear
[da53353]212
[6aad2e8]213.. image:: sm_image027.png
[da53353]214
[f256d9b]215**[Equation 12]**
[da53353]216
217where
218
[6aad2e8]219.. image:: sm_image028.png
[da53353]220
[f256d9b]221The current version of the SasView uses Equation 11 for 2D smearing, assuming
222that all the Gaussian weighting functions are aligned in the polar coordinate.
[da53353]223
[f256d9b]224.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
225
226Weighting & Normalization
227-------------------------
228
[5ed76f8]229In all the cases above, the weighting matrix $W$ is calculated on the first call
230to a smearing function, and includes ~60 $q$ values (finely and evenly binned)
231below (>0) and above the $q$ range of data in order to smear all data points for
232a given model and slit/pinhole size. The $Norm$  factor is found numerically with the
233weighting matrix and applied on the computation of $I_s$.
[da53353]234
235.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
[f256d9b]236
237.. note::  This help document was last changed by Steve King, 01May2015
Note: See TracBrowser for help on using the repository browser.