[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 | .. |beta| unicode:: U+03B2 |
---|
| 7 | .. |gamma| unicode:: U+03B3 |
---|
| 8 | .. |mu| unicode:: U+03BC |
---|
| 9 | .. |sigma| unicode:: U+03C3 |
---|
| 10 | .. |phi| unicode:: U+03C6 |
---|
| 11 | .. |theta| unicode:: U+03B8 |
---|
| 12 | .. |chi| unicode:: U+03C7 |
---|
| 13 | |
---|
| 14 | .. |inlineimage004| image:: sm_image004.gif |
---|
| 15 | .. |inlineimage005| image:: sm_image005.gif |
---|
| 16 | .. |inlineimage008| image:: sm_image008.gif |
---|
| 17 | .. |inlineimage009| image:: sm_image009.gif |
---|
| 18 | .. |inlineimage010| image:: sm_image010.gif |
---|
| 19 | .. |inlineimage011| image:: sm_image011.gif |
---|
| 20 | .. |inlineimage012| image:: sm_image012.gif |
---|
| 21 | .. |inlineimage018| image:: sm_image018.gif |
---|
| 22 | .. |inlineimage019| image:: sm_image019.gif |
---|
| 23 | |
---|
| 24 | |
---|
| 25 | .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
---|
| 26 | |
---|
| 27 | Smearing Computation |
---|
| 28 | -------------------- |
---|
| 29 | |
---|
[a0637de] | 30 | The following three smearing algorithms are provided |
---|
[da53353] | 31 | |
---|
[a0637de] | 32 | * *Slit Smearing* |
---|
| 33 | * *Pinhole Smearing* |
---|
| 34 | * *2D Smearing* |
---|
[da53353] | 35 | |
---|
[a0637de] | 36 | .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
---|
[da53353] | 37 | |
---|
| 38 | Slit Smearing |
---|
[cfc5917] | 39 | ^^^^^^^^^^^^^ |
---|
[da53353] | 40 | |
---|
| 41 | The sit smeared scattering intensity for SAS is defined by |
---|
| 42 | |
---|
| 43 | .. image:: sm_image002.gif |
---|
| 44 | |
---|
| 45 | where Norm = |
---|
| 46 | |
---|
| 47 | .. image:: sm_image003.gif |
---|
| 48 | |
---|
| 49 | Equation 1 |
---|
| 50 | |
---|
| 51 | The functions |inlineimage004| and |inlineimage005| |
---|
| 52 | refer to the slit width weighting function and the slit height weighting |
---|
| 53 | determined at the q point, respectively. Here, we assumes that the weighting |
---|
| 54 | function is described by a rectangular function, i.e., |
---|
| 55 | |
---|
| 56 | .. image:: sm_image006.gif |
---|
| 57 | |
---|
| 58 | Equation 2 |
---|
| 59 | |
---|
| 60 | and |
---|
| 61 | |
---|
| 62 | .. image:: sm_image007.gif |
---|
| 63 | |
---|
| 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 |
---|
| 71 | |
---|
| 72 | .. image:: sm_image013.gif |
---|
| 73 | |
---|
| 74 | Equation 4 |
---|
| 75 | |
---|
[cfc5917] | 76 | Numerical Implementation of Equation 4: Case 1 |
---|
| 77 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
---|
[da53353] | 78 | |
---|
| 79 | For |inlineimage012| = 0 and |inlineimage011| = constant. |
---|
| 80 | |
---|
| 81 | .. image:: sm_image016.gif |
---|
| 82 | |
---|
| 83 | For discrete q values, at the q values from the data points and at the q |
---|
| 84 | values extended up to qN= qi + |inlineimage011| the smeared |
---|
| 85 | intensity can be calculated approximately |
---|
| 86 | |
---|
| 87 | .. image:: sm_image017.gif |
---|
| 88 | |
---|
| 89 | Equation 5 |
---|
| 90 | |
---|
| 91 | |inlineimage018| = 0 for *Is* in *j* < *i* or *j* > N-1*. |
---|
| 92 | |
---|
[cfc5917] | 93 | Numerical Implementation of Equation 4: Case 2 |
---|
| 94 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
---|
[da53353] | 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 | |
---|
[cfc5917] | 103 | Numerical Implementation of Equation 4: Case 3 |
---|
| 104 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
---|
[da53353] | 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. |
---|
| 117 | |
---|
| 118 | .. image:: sm_image020.gif |
---|
| 119 | |
---|
| 120 | Equation 7 |
---|
| 121 | |
---|
| 122 | for qp= qi- |inlineimage012| and |
---|
| 123 | qN= qi+ |inlineimage012|. |inlineimage018| = 0 for |
---|
| 124 | *Is* in *j* < *p* or *j* > *N-1*. |
---|
| 125 | |
---|
[a0637de] | 126 | .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
---|
[da53353] | 127 | |
---|
| 128 | Pinhole Smearing |
---|
[cfc5917] | 129 | ^^^^^^^^^^^^^^^^ |
---|
[da53353] | 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 |
---|
| 134 | |
---|
| 135 | .. image:: sm_image021.gif |
---|
| 136 | |
---|
| 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. |
---|
| 145 | |
---|
[a0637de] | 146 | .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
---|
[da53353] | 147 | |
---|
| 148 | 2D Smearing |
---|
[cfc5917] | 149 | ^^^^^^^^^^^ |
---|
[da53353] | 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 |
---|
| 153 | |
---|
| 154 | .. image:: sm_image022.gif |
---|
| 155 | |
---|
| 156 | Equation 9 |
---|
| 157 | |
---|
| 158 | In Equation 9, x0 = qcos/theta/ and y0 = qsin/theta/, and the primed axes |
---|
| 159 | 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 A is a normalization factor. |
---|
| 164 | |
---|
| 165 | .. image:: sm_image023.gif |
---|
| 166 | |
---|
| 167 | Now we consider a numerical integration where each bins in /theta/ and R are |
---|
| 168 | *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 constant |
---|
| 170 | within the bins which in turn becomes |
---|
| 171 | |
---|
| 172 | .. image:: sm_image024.gif |
---|
| 173 | |
---|
| 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 |
---|
| 179 | |
---|
| 180 | .. image:: sm_image025.gif |
---|
| 181 | |
---|
| 182 | Equation 11 |
---|
| 183 | |
---|
| 184 | where |
---|
| 185 | |
---|
| 186 | .. image:: sm_image026.gif |
---|
| 187 | |
---|
| 188 | while for the x-y symmetric smear |
---|
| 189 | |
---|
| 190 | .. image:: sm_image027.gif |
---|
| 191 | |
---|
| 192 | Equation 12 |
---|
| 193 | |
---|
| 194 | where |
---|
| 195 | |
---|
| 196 | .. image:: sm_image028.gif |
---|
| 197 | |
---|
| 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 |
---|