Changeset f256d9b in sasview for src/sas/perspectives/fitting/media/sm_help.rst
- Timestamp:
- May 1, 2015 10:58:57 AM (10 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 3b67c30
- Parents:
- a9dc4eb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/perspectives/fitting/media/sm_help.rst
rcfc5917 rf256d9b 11 11 .. |theta| unicode:: U+03B8 12 12 .. |chi| unicode:: U+03C7 13 .. |bigdelta| unicode:: U+0394 13 14 14 15 .. |inlineimage004| image:: sm_image004.gif … … 25 26 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 26 27 27 Smearing Computation 28 -------------------- 29 30 The following three smearing algorithms are provided 28 Smearing Functions 29 ================== 30 31 Sometimes it will be necessary to correct reduced experimental data for the 32 physical effects of the instrumental geometry in use. This process is called 33 *desmearing*. However, calculated/simulated data - which by definition will be 34 perfect/exact - can be *smeared* to make it more representative of what might 35 actually be measured experimentally. 36 37 SasView provides the following three smearing algorithms: 31 38 32 39 * *Slit Smearing* … … 37 44 38 45 Slit Smearing 39 ^^^^^^^^^^^^^ 40 41 The sit smeared scattering intensity for SAS is defined by 46 ------------- 47 48 **This type of smearing is normally only encountered with data from X-ray Kratky** 49 **cameras or X-ray/neutron Bonse-Hart USAXS/USANS instruments.** 50 51 The slit-smeared scattering intensity is defined by 42 52 43 53 .. image:: sm_image002.gif 44 54 45 where Norm =55 where *Norm* is given by 46 56 47 57 .. image:: sm_image003.gif 48 58 49 Equation 1 59 **[Equation 1]** 50 60 51 61 The functions |inlineimage004| and |inlineimage005| 52 62 refer to the slit width weighting function and the slit height weighting 53 determined at the q point, respectively. Here, we assumes that the weighting54 function is described by a rectangular function, i.e.,63 determined at the given *q* point, respectively. It is assumed that the weighting 64 function is described by a rectangular function, such that 55 65 56 66 .. image:: sm_image006.gif 57 67 58 Equation 2 68 **[Equation 2]** 59 69 60 70 and … … 62 72 .. image:: sm_image007.gif 63 73 64 Equation 3 65 66 so that |inlineimage008| |inlineimage009| for |inlineimage010| and u. 67 68 The |inlineimage011| and |inlineimage012| stand for 69 the slit height (FWHM/2) and the slit width (FWHM/2) in the q space. Now the 70 integral of Equation 1 is simplified to 74 **[Equation 3]** 75 76 so that |inlineimage008| |inlineimage009| for |inlineimage010| and *u*\ . 77 78 Here |inlineimage011| and |inlineimage012| stand for 79 the slit height (FWHM/2) and the slit width (FWHM/2) in *q* space. 80 81 This simplifies the integral in Equation 1 to 71 82 72 83 .. image:: sm_image013.gif 73 84 74 Equation 4 75 76 Numerical Implementation of Equation 4: Case 1 77 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 78 79 For |inlineimage012| = 0 and |inlineimage011| = constant. 85 **[Equation 4]** 86 87 which may be solved numerically, depending on the nature of |inlineimage011| and |inlineimage012| . 88 89 Solution 1 90 ^^^^^^^^^^ 91 92 **For** |inlineimage012| **= 0 and** |inlineimage011| **= constant.** 80 93 81 94 .. image:: sm_image016.gif 82 95 83 For discrete q values, at the q values from the data points and at the q84 values extended up to qN= qi + |inlineimage011| the smeared85 intensity can be calculated approximately96 For discrete *q* values, at the *q* values of the data points and at the *q* 97 values extended up to *q*\ :sub:`N`\ = *q*\ :sub:`i` + |inlineimage011| the smeared 98 intensity can be approximately calculated as 86 99 87 100 .. image:: sm_image017.gif 88 101 89 Equation 5 90 91 |inlineimage018| = 0 for *Is* in *j* < *i* or *j* > N-1*. 92 93 Numerical Implementation of Equation 4: Case 2 94 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 95 96 For |inlineimage012| = constant and |inlineimage011| = 0. 97 98 Similarly to Case 1, we get 99 100 |inlineimage019| for qp= qi- |inlineimage012| and qN= qi+ |inlineimage012|. |inlineimage018| = 0 101 for *Is* in *j* < *p* or *j* > *N-1*. 102 103 Numerical Implementation of Equation 4: Case 3 104 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 105 106 For |inlineimage011| = constant and 107 |inlineimage011| = constant. 108 109 In this case, the best way is to perform the integration, Equation 1, 110 numerically for both slit height and width. However, the numerical integration 111 is not correct enough unless given a large number of iteration, say at least 112 10000 by 10000 for each element of the matrix, W, which will take minutes and 113 minutes to finish the calculation for a set of typical SAS data. An 114 alternative way which is correct for slit width << slit hight, is used in 115 SasView. This method is a mixed method that combines method 1 with the 116 numerical integration for the slit width. 102 **[Equation 5]** 103 104 where |inlineimage018| = 0 for *I*\ :sub:`s` when *j* < *i* or *j* > *N-1*. 105 106 Solution 2 107 ^^^^^^^^^^ 108 109 **For** |inlineimage012| **= constant and** |inlineimage011| **= 0.** 110 111 Similar to Case 1 112 113 |inlineimage019| for *q*\ :sub:`p` = *q*\ :sub:`i` - |inlineimage012| and *q*\ :sub:`N` = *q*\ :sub:`i` + |inlineimage012| 114 115 **[Equation 6]** 116 117 where |inlineimage018| = 0 for *I*\ :sub:`s` when *j* < *p* or *j* > *N-1*. 118 119 Solution 3 120 ^^^^^^^^^^ 121 122 **For** |inlineimage011| **= constant and** |inlineimage011| **= constant.** 123 124 In this case, the best way is to perform the integration of Equation 1 125 numerically for both slit height and slit width. However, the numerical 126 integration is imperfect unless a large number of iterations, say, at 127 least 10000 by 10000 for each element of the matrix *W*, is performed. 128 This is usually too slow for routine use. 129 130 An alternative approach is used in SasView which assumes 131 slit width << slit height. This method combines Solution 1 with the 132 numerical integration for the slit width. Then 117 133 118 134 .. image:: sm_image020.gif 119 135 120 Equation 7 121 122 for qp= qi- |inlineimage012| and123 qN= qi+ |inlineimage012|. |inlineimage018| = 0 for 124 *Is* in *j* < *p* or *j* > *N-1*.136 **[Equation 7]** 137 138 for *q*\ :sub:`p` = *q*\ :sub:`i` - |inlineimage012| and *q*\ :sub:`N` = *q*\ :sub:`i` + |inlineimage012| 139 140 where |inlineimage018| = 0 for *I*\ :sub:`s` when *j* < *p* or *j* > *N-1*. 125 141 126 142 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 127 143 128 144 Pinhole Smearing 129 ^^^^^^^^^^^^^^^^ 130 131 The pinhole smearing computation is done similar to the case above except 132 that the weight function used is the Gaussian function, so that the Equation 6 133 for this case becomes 145 ---------------- 146 147 **This is the type of smearing normally encountered with data from synchrotron** 148 **SAXS cameras and SANS instruments.** 149 150 The pinhole smearing computation is performed in a similar fashion to the slit- 151 smeared case above except that the weight function used is a Gaussian. Thus 152 Equation 6 becomes 134 153 135 154 .. image:: sm_image021.gif 136 155 137 Equation 8 138 139 For all the cases above, the weighting matrix *W* is calculated when the 140 smearing is called at the first time, and it includes the ~ 60 q values 141 (finely binned evenly) below (\>0) and above the q range of data in order 142 to cover all data points of the smearing computation for a given model and 143 for a given slit size. The *Norm* factor is found numerically with the 144 weighting matrix, and considered on *Is* computation. 156 **[Equation 8]** 145 157 146 158 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 147 159 148 160 2D Smearing 149 ^^^^^^^^^^^ 150 151 The 2D smearing computation is done similar to the 1D pinhole smearing above 152 except that the weight function used was the 2D elliptical Gaussian function 161 ----------- 162 163 The 2D smearing computation is performed in a similar fashion to the 1D pinhole 164 smearing above except that the weight function used is a 2D elliptical Gaussian. 165 Thus 153 166 154 167 .. image:: sm_image022.gif 155 168 156 Equation 9 157 158 In Equation 9, x0 = qcos/theta/ and y0 = qsin/theta/, and the primed axes159 are in the coordinate rotated by an angle /theta/ around the z-axis (below) 160 so that xââ¬â¢0= x0cos/theta/+y0sin/theta/ and yââ¬â¢0= -x0sin/theta/+y0cos/theta/. 161 162 Note that the rotation angle is zero for x-y symmetric elliptical Gaussian 163 distribution. The Ais a normalization factor.169 **[Equation 9]** 170 171 In Equation 9, *x*\ :sub:`0` = *q* cos(|theta|), *y*\ :sub:`0` = *q* sin(|theta|), and 172 the primed axes, are all in the coordinate rotated by an angle |theta| about 173 the z-axis (see the figure below) so that *x'*\ :sub:`0` = *x*\ :sub:`0` cos(|theta|) + 174 *y*\ :sub:`0` sin(|theta|) and *y'*\ :sub:`0` = -*x*\ :sub:`0` sin(|theta|) + 175 *y*\ :sub:`0` cos(|theta|). Note that the rotation angle is zero for a x-y symmetric 176 elliptical Gaussian distribution. The *A* is a normalization factor. 164 177 165 178 .. image:: sm_image023.gif 166 179 167 Now we consider a numerical integration where each bins in /theta/ and R are168 *evenly* (this is to simplify the equation below) distributed by /delta//theta/169 and /delta/R, respectively, and it is assumed that I(xââ¬â¢, yââ¬â¢) is constant170 within the bins which in turn becomes180 Now we consider a numerical integration where each of the bins in |theta| and *R* are 181 *evenly* (this is to simplify the equation below) distributed by |bigdelta|\ |theta| 182 and |bigdelta|\ R, respectively, and it is further assumed that *I(x',y')* is constant 183 within the bins. Then 171 184 172 185 .. image:: sm_image024.gif 173 186 174 Equation 10 175 176 Since we have found the weighting factor on each bin points, it is convenient 177 to transform xââ¬â¢-yââ¬â¢ back to x-y coordinate (rotating it by -/theta/ around z 178 axis). Then, for the polar symmetric smear 187 **[Equation 10]** 188 189 Since the weighting factor on each of the bins is known, it is convenient to 190 transform *x'-y'* back to *x-y* coordinates (by rotating it by -|theta| around the 191 *z* axis). 192 193 Then, for a polar symmetric smear 179 194 180 195 .. image:: sm_image025.gif 181 196 182 Equation 11 197 **[Equation 11]** 183 198 184 199 where … … 186 201 .. image:: sm_image026.gif 187 202 188 while for the x-ysymmetric smear203 while for a *x-y* symmetric smear 189 204 190 205 .. image:: sm_image027.gif 191 206 192 Equation 12 207 **[Equation 12]** 193 208 194 209 where … … 196 211 .. image:: sm_image028.gif 197 212 198 Here, the current version of the SasView uses Equation 11 for 2D smearing 199 assuming that all the Gaussian weighting functions are aligned in the polar 200 coordinate. 201 202 In the control panel, the higher accuracy indicates more and finer binnng 203 points so that it costs more in time. 204 205 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 213 The current version of the SasView uses Equation 11 for 2D smearing, assuming 214 that all the Gaussian weighting functions are aligned in the polar coordinate. 215 216 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 217 218 Weighting & Normalization 219 ------------------------- 220 221 In all the cases above, the weighting matrix *W* is calculated on the first call 222 to a smearing function, and includes ~60 *q* values (finely and evenly binned) 223 below (>0) and above the *q* range of data in order to smear all data points for 224 a given model and slit/pinhole size. The *Norm* factor is found numerically with the 225 weighting matrix and applied on the computation of *I*\ :sub:`s`. 226 227 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 228 229 .. note:: This help document was last changed by Steve King, 01May2015
Note: See TracChangeset
for help on using the changeset viewer.