source: sasview/docs/sphinx-docs/source/user/sasgui/perspectives/fitting/sm_help.rst @ 49148bb

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 49148bb was 49148bb, checked in by smk78, 8 years ago

Add in guiframe related docs files

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