source: sasview/src/sas/sasgui/perspectives/fitting/media/sm_help.rst @ 7dda833

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 7dda833 was 27aabc1, checked in by smk78, 8 years ago

Changes to smearing help at
/sasview/src/sas/sasgui/perspectives/fitting/media/sm_help.rst

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