.. algorithm:: .. summary:: .. relatedalgorithms:: .. properties:: Description ----------- Algorithm Reference Discussion ------------------------------ Transmission for scattering at large angles should be modified to account for the longer path length after the scattering event [#Brulet]_ [#Ghosh]_. The longer path length after scattering will also slightly increase the probability of a second scattering event, but this is not dealt with here. If our on-axis transmission is :math:`T_0` through a sample of thickness :math:`d`, then the transmission at some other thickness :math:`x` is :math:`\exp(-\mu x)` where attenuation coefficient :math:`\mu = -\ln( \frac{T_0}{d})`. If a neutron scatters at angle :math:`2\theta` at distance :math:`x` into the sample, its total transmission is then: .. math:: T^{''} = \exp(-\mu x) \exp( \frac{-\mu(d-x)}{\cos(2\theta)}) :math:`T^{''}` should be integrated and averaged between :math:`x = 0` and :math:`x = d`. The resulting integral can be approximated, see page 208 of [#Hammouda]_, as: .. math:: T^{'} = \frac{T_0(T_0^A - 1)}{A \ln(T_0)} With :math:`A = \frac{1}{\cos(2\theta)} - 1`. For example, if :math:`T_0 = 0.2` and :math:`2\theta = 40` then :math:`T^{'} = 0.158`, a shift of :math:`~20`\ % of the SANS curve. Note that the result is independent of sample thickness. :math:`T_0` is a function of neutron wavelength, whilst :math:`A` is a function of detector pixel location. The output of this algorithm is: :math:`\text{Output Workspace}=\frac{T^\prime}{T_0}` Error Propagation ################# The error propagation follows this formula: :math:`\text{OutputWorkspace}_{error} = \frac{T_{0E} ^A - 1}{A\ln(T_0E)}` Which means, that we do not consider the error in the definition of :math:`2\theta` (the parameter A) Enabling Wide Angle Correction for Reduction of SANS ISIS --------------------------------------------------------- The Wide Angle Correction was set on the legacy user file with the command: ``SAMPLE/PATH/ON`` For TOML user files, the ``wide_angle_correction`` boolean flag can be set on the transmission field, if the flag is not present on the TOML file, the default value is ``false``: .. code-block:: yaml [transmission] wide_angle_correction=true More information on :ref:`sans_toml_v1-ref`. SANS ISIS Reduction ------------------- The output of SANSWideAngleCorrection is used as WavePixelAdj parameter at :ref:`algm-Q1D`. Wide Angle Correction and the SANS Reduction -------------------------------------------- The equation for the reduction is (see :ref:`algm-Q1D`) .. math:: P_I(Q) = \frac{\sum_{\{i, j, n\} \supset \{I\}} S(i,j,n)}{\sum_{\{i, j, n\} \supset \{I\}}M(n)\eta(n)T(n)\Omega_{i j}F_{i j}} But :math:`T(n)` is now a function of the detector position to account for wide angles, :math:`T(n,theta)` or :math:`T(n,i,j)`. Thus, the correction changes to: .. math:: P_I(Q) = \frac{\sum_{\{i, j, n\} \supset \{I\}} S(i,j,n)}{\sum_{\{i, j, n\} \supset \{I\}}M(n)\eta(n)T(n)\Omega_{i j}F_{i j}Corr(i,j,n)} Where Corr (Correction factor) in this case will be: :math:`\text{Corr}(i,j,n) = \frac{T_0^A - 1}{A \ln(T_0)}` Which is the OutputWorkspace of SANSWideAngleCorrection. This workspace enters inside :ref:`algm-Q1D` as the workspace property ``WavePixelAdj``, but this step is handled automatically inside the reduction workflow. Comparison with Wide Angle Correction at SNS -------------------------------------------- The transmission correction applied at SNS is described :ref:`here `, and it is applied through the :ref:`algm-ApplyTransmissionCorrection` algorithm. The correction applied there is an approximation for the same equations described here. The picture above compare their results .. figure:: /images/SNS_ISIS_WideAngleCorrections.png :alt: SNS_ISIS_WideAngleCorrections.png Note a difference among them is when they are applied. At SNS, the correction is applied before averaging the counters per bin inside :ref:`algm-Q1D` algorithm, while at ISIS, it is used after, inside the :ref:`algm-Q1D` algorithm, for the division of the counters per bin normalized by the transmission counters. References ---------- .. [#Brulet] Annie Brulet et al. - Improvement of data treatment in small-angle neutron scattering - `J. Appl.Cryst. (2007). 40 `_ .. [#Ghosh] Ghosh, Egelhaaf & Rennie - Computing guide for Small Angle Scattering .. [#Hammouda] Hammouda B. The SANS toolbox. NIST Center for Neutron Research, 2008 Usage ----- **Example - Correcting Some Dummy Data** .. testcode:: ExCorrection # Create some dummy data, but crop it for quick demonstration purposes. sample = CreateSimulationWorkspace(Instrument='SANS2D', BinParams=[5,500,100005], UnitX='TOF') sample = CropWorkspace(sample,StartWorkspaceIndex=0,EndWorkspaceIndex=20) # Create a dummy transmission workspace. transmission = CropWorkspace(sample,StartWorkspaceIndex=10,EndWorkspaceIndex=10) transmission *= 2 corrected_data = SANSWideAngleCorrection(sample, transmission) print("{:.6f} was corrected to {:.6f}.".format(sample.readY(19)[0], corrected_data.readY(19)[0])) Output: .. testoutput:: ExCorrection 1.000000 was corrected to 1.004997. .. categories:: .. sourcelink::