[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] | 19 | Smearing Functions |
---|
| 20 | ================== |
---|
[da53353] | 21 | |
---|
[5ed76f8] | 22 | Sometimes the instrumental geometry used to acquire the experimental data has |
---|
| 23 | an impact on the clarity of features in the reduced scattering curve. For |
---|
| 24 | example, 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 |
---|
| 26 | remove the resolution contribution - a process called *desmearing* - or add the |
---|
| 27 | resolution contribution into a model calculation/simulation (which by definition |
---|
| 28 | will be exact) to make it more representative of what has been measured |
---|
[27aabc1] | 29 | experimentally - a process called *smearing*. SasView will do the latter. |
---|
| 30 | |
---|
[5ed76f8] | 31 | Both smearing and desmearing rely on functions to describe the resolution |
---|
[27aabc1] | 32 | effect. SasView provides three smearing algorithms: |
---|
[da53353] | 33 | |
---|
[a0637de] | 34 | * *Slit Smearing* |
---|
| 35 | * *Pinhole Smearing* |
---|
| 36 | * *2D Smearing* |
---|
[da53353] | 37 | |
---|
[5ed76f8] | 38 | SasView also has an option to use $Q$ resolution data (estimated at the time of |
---|
[27aabc1] | 39 | data reduction) supplied in a reduced data file: the *Use dQ data* radio button. |
---|
| 40 | |
---|
| 41 | .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
---|
| 42 | |
---|
| 43 | dQ Smearing |
---|
| 44 | ----------- |
---|
[5ed76f8] | 45 | |
---|
| 46 | If this option is checked, SasView will assume that the supplied $dQ$ values |
---|
[27aabc1] | 47 | represent the standard deviations of Gaussian functions. |
---|
| 48 | |
---|
[a0637de] | 49 | .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
---|
[da53353] | 50 | |
---|
| 51 | Slit 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] | 57 | The slit-smeared scattering intensity is defined by |
---|
[da53353] | 58 | |
---|
[6aad2e8] | 59 | .. image:: sm_image002.png |
---|
[da53353] | 60 | |
---|
[f256d9b] | 61 | where *Norm* is given by |
---|
[da53353] | 62 | |
---|
[6aad2e8] | 63 | .. image:: sm_image003.png |
---|
[da53353] | 64 | |
---|
[f256d9b] | 65 | **[Equation 1]** |
---|
[da53353] | 66 | |
---|
[5ed76f8] | 67 | The functions $W_v(v)$ and $W_u(u)$ |
---|
| 68 | refer to the slit width weighting function and the slit height weighting |
---|
| 69 | determined at the given $q$ point, respectively. It is assumed that the weighting |
---|
[f256d9b] | 70 | function is described by a rectangular function, such that |
---|
[da53353] | 71 | |
---|
[6aad2e8] | 72 | .. image:: sm_image006.png |
---|
[da53353] | 73 | |
---|
[f256d9b] | 74 | **[Equation 2]** |
---|
[da53353] | 75 | |
---|
| 76 | and |
---|
| 77 | |
---|
[6aad2e8] | 78 | .. image:: sm_image007.png |
---|
[da53353] | 79 | |
---|
[f256d9b] | 80 | **[Equation 3]** |
---|
[da53353] | 81 | |
---|
[5ed76f8] | 82 | so that $\Delta q_\alpha = \int_0^\infty d\alpha W_\alpha(\alpha)$ |
---|
| 83 | for $\alpha = v$ and $u$. |
---|
[da53353] | 84 | |
---|
[5ed76f8] | 85 | Here $\Delta q_u$ and $\Delta q_v$ stand for |
---|
| 86 | the slit height (FWHM/2) and the slit width (FWHM/2) in $q$ space. |
---|
[f256d9b] | 87 | |
---|
| 88 | This simplifies the integral in Equation 1 to |
---|
[da53353] | 89 | |
---|
[6aad2e8] | 90 | .. image:: sm_image013.png |
---|
[da53353] | 91 | |
---|
[f256d9b] | 92 | **[Equation 4]** |
---|
| 93 | |
---|
[5ed76f8] | 94 | which may be solved numerically, depending on the nature of |
---|
| 95 | $\Delta q_u$ and $\Delta q_v$. |
---|
[da53353] | 96 | |
---|
[f256d9b] | 97 | Solution 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] | 104 | For discrete $q$ values, at the $q$ values of the data points and at the $q$ |
---|
| 105 | values extended up to $q_N = q_i + \Delta q_u$ the smeared |
---|
[f256d9b] | 106 | intensity can be approximately calculated as |
---|
[da53353] | 107 | |
---|
[6aad2e8] | 108 | .. image:: sm_image017.png |
---|
[da53353] | 109 | |
---|
[f256d9b] | 110 | **[Equation 5]** |
---|
[da53353] | 111 | |
---|
[5ed76f8] | 112 | where |inlineimage018| = 0 for $I_s$ when $j < i$ or $j > N-1$. |
---|
[da53353] | 113 | |
---|
[f256d9b] | 114 | Solution 2 |
---|
| 115 | ^^^^^^^^^^ |
---|
[da53353] | 116 | |
---|
[5ed76f8] | 117 | **For $\Delta q_v = \text{constant}$ and $\Delta q_u= 0$.** |
---|
[da53353] | 118 | |
---|
[f256d9b] | 119 | Similar 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] | 125 | where |inlineimage018| = 0 for $I_s$ when $j < p$ or $j > N-1$. |
---|
[da53353] | 126 | |
---|
[f256d9b] | 127 | Solution 3 |
---|
| 128 | ^^^^^^^^^^ |
---|
| 129 | |
---|
[5ed76f8] | 130 | **For $\Delta q_u = \text{constant}$ and $\Delta q_v = \text{constant}$.** |
---|
[f256d9b] | 131 | |
---|
| 132 | In this case, the best way is to perform the integration of Equation 1 |
---|
| 133 | numerically for both slit height and slit width. However, the numerical |
---|
| 134 | integration is imperfect unless a large number of iterations, say, at |
---|
| 135 | least 10000 by 10000 for each element of the matrix *W*, is performed. |
---|
| 136 | This is usually too slow for routine use. |
---|
| 137 | |
---|
| 138 | An alternative approach is used in SasView which assumes |
---|
| 139 | slit width << slit height. This method combines Solution 1 with the |
---|
| 140 | numerical integration for the slit width. Then |
---|
[da53353] | 141 | |
---|
[6aad2e8] | 142 | .. image:: sm_image020.png |
---|
[da53353] | 143 | |
---|
[f256d9b] | 144 | **[Equation 7]** |
---|
| 145 | |
---|
[5ed76f8] | 146 | for *q_p = q_i - \Delta q_v$ and $q_N = q_i + \Delta q_v$ |
---|
| 147 | where |inlineimage018| = 0 for *I_s$ when $j < p$ or $j > N-1$. |
---|
[da53353] | 148 | |
---|
[a0637de] | 149 | .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
---|
[da53353] | 150 | |
---|
| 151 | Pinhole 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] | 157 | The pinhole smearing computation is performed in a similar fashion to the slit- |
---|
| 158 | smeared case above except that the weight function used is a Gaussian. Thus |
---|
| 159 | Equation 6 becomes |
---|
[da53353] | 160 | |
---|
[6aad2e8] | 161 | .. image:: sm_image021.png |
---|
[da53353] | 162 | |
---|
[f256d9b] | 163 | **[Equation 8]** |
---|
[da53353] | 164 | |
---|
[a0637de] | 165 | .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
---|
[da53353] | 166 | |
---|
| 167 | 2D Smearing |
---|
[f256d9b] | 168 | ----------- |
---|
[da53353] | 169 | |
---|
[f256d9b] | 170 | The 2D smearing computation is performed in a similar fashion to the 1D pinhole |
---|
| 171 | smearing above except that the weight function used is a 2D elliptical Gaussian. |
---|
| 172 | Thus |
---|
[da53353] | 173 | |
---|
[6aad2e8] | 174 | .. image:: sm_image022.png |
---|
[da53353] | 175 | |
---|
[f256d9b] | 176 | **[Equation 9]** |
---|
[da53353] | 177 | |
---|
[5ed76f8] | 178 | In Equation 9, $x_0 = q \cos(\theta)$, $y_0 = q \sin(\theta)$, and |
---|
| 179 | the primed axes, are all in the coordinate rotated by an angle $\theta$ about |
---|
| 180 | the 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)$. |
---|
| 183 | Note that the rotation angle is zero for a $xy$ symmetric |
---|
| 184 | elliptical Gaussian distribution. The $A$ is a normalization factor. |
---|
[da53353] | 185 | |
---|
[6aad2e8] | 186 | .. image:: sm_image023.png |
---|
[da53353] | 187 | |
---|
[5ed76f8] | 188 | Now 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$ |
---|
| 190 | and $\Delta R$, respectively, and it is further assumed that $I(x',y')$ is constant |
---|
[f256d9b] | 191 | within the bins. Then |
---|
[da53353] | 192 | |
---|
[6aad2e8] | 193 | .. image:: sm_image024.png |
---|
[da53353] | 194 | |
---|
[f256d9b] | 195 | **[Equation 10]** |
---|
| 196 | |
---|
| 197 | Since the weighting factor on each of the bins is known, it is convenient to |
---|
[5ed76f8] | 198 | transform $x'y'$ back to $xy$ coordinates (by rotating it by $-\theta$ around the |
---|
| 199 | $z$ axis). |
---|
[da53353] | 200 | |
---|
[f256d9b] | 201 | Then, for a polar symmetric smear |
---|
[da53353] | 202 | |
---|
[6aad2e8] | 203 | .. image:: sm_image025.png |
---|
[da53353] | 204 | |
---|
[f256d9b] | 205 | **[Equation 11]** |
---|
[da53353] | 206 | |
---|
| 207 | where |
---|
| 208 | |
---|
[6aad2e8] | 209 | .. image:: sm_image026.png |
---|
[da53353] | 210 | |
---|
[5ed76f8] | 211 | while for a $xy$ symmetric smear |
---|
[da53353] | 212 | |
---|
[6aad2e8] | 213 | .. image:: sm_image027.png |
---|
[da53353] | 214 | |
---|
[f256d9b] | 215 | **[Equation 12]** |
---|
[da53353] | 216 | |
---|
| 217 | where |
---|
| 218 | |
---|
[6aad2e8] | 219 | .. image:: sm_image028.png |
---|
[da53353] | 220 | |
---|
[f256d9b] | 221 | The current version of the SasView uses Equation 11 for 2D smearing, assuming |
---|
| 222 | that all the Gaussian weighting functions are aligned in the polar coordinate. |
---|
[da53353] | 223 | |
---|
[f256d9b] | 224 | .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ |
---|
| 225 | |
---|
| 226 | Weighting & Normalization |
---|
| 227 | ------------------------- |
---|
| 228 | |
---|
[5ed76f8] | 229 | In all the cases above, the weighting matrix $W$ is calculated on the first call |
---|
| 230 | to a smearing function, and includes ~60 $q$ values (finely and evenly binned) |
---|
| 231 | below (>0) and above the $q$ range of data in order to smear all data points for |
---|
| 232 | a given model and slit/pinhole size. The $Norm$ factor is found numerically with the |
---|
| 233 | weighting 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 |
---|