sw_tofres#
Syntax#
spectra = sw_tofres(spectra,Name,Value)
Description#
spectra = sw_tofres(spectra,Name,Value) simulates the finite bin size
of the cuts of direct TOF neutron scattering data. It calculates the
spectrum at multiple points within the given bin volume and sums them up.
The function is usefull if relatively large bins were used to analyse the
data due to low signal to noise ratio of the measurement.
Input Arguments#
spectraInput structure, contains calculated correlation functions withouth the resolution effect.
Name-Value Pair Arguments#
'method'String that determines the method to generate the \(Q\) points, options:
'random'The bin volume will be randomly sampled.'grid'The bin volume will be split up to a finer regular grid.
'dQ'Row vector with 3 elements. The width of the \(Q\) bin along the three reciprocal lattice directions. The spectrum will be integrated in the \(Q\pm (\delta Q/2)\) range. Default value is
[0.1 0.1 0.1].'nQ'Row vector with 3 elements when
methodisgridand gives the number of \(Q\) points along the three reciprocal lattice directions to average over. Whenmethodisrandomit is a scalar that determines the number of random \(Q\) points.'fid'Defines whether to provide text output. The default value is determined by the
fidpreference stored in swpref. The possible values are:0No text output is generated.1Text output in the MATLAB Command Window.fidFile ID provided by thefopencommand, the output is written into the opened file stream.
'tid'Determines if the elapsed and required time for the calculation is displayed. The default value is determined by the
tidpreference stored in swpref. The following values are allowed (for more details see sw_timeit):0No timing is executed.1Display the timing in the Command Window.2Show the timing in a separat pup-up window.
Output Arguments#
spectraSame as the input except that it contains the calculated intensity in the
swConvfield.
See Also#
*[TOF]: Time Of Flight