spectra = sw_instrument(spectra,Name,Value)
spectra = sw_instrument(spectra,Name,Value) can convolute an energy
binned spectrum with different energy resolution functions and add other
effects that introduced by measurement (such as the kinematic limit for
neutron scattering, finite momentum resolution or finite detector
Name-Value Pair Arguments
- Convolutes the spectrum with a Gaussian in energy, where the width is
defined by the FWHM value. The accepted values are:
- string File name, that contains the FWHM energy resolution values as a function of energy transfer. The file has to contain two columns, first is the energy values, the second is the FWHM resolution at the given energy transfer value, see sw_res function for details.
- number Constant FWHM energy resolution given by the number.
- matrix Dimensions of , where the first column contains the energy transfer values, second column contains the FWHM resolution values. These discrete values will be fitted using a polynomial with a fixed degree, see sw_res for details.
- function Function handle of a resolution function
with the following header:
E_FWHM = res_fun(E)
E_FWHMis the FWHM energy resolution and
Eis the energy transfer value.
- Shape of the energy resolution function if different from Gaussian. For details see sw_resconv.
- Degree of the polynomial that is fitted to the discrete energy
resolution data. Only used if
dEis a matrix of string. Default value is 5.
- Momentum transfer resolution of the instrument, FWHM is given in Å units by default, unless different units are defined in spinw.unit. Default value is 0 for no convolution.
- Minimum scattering angle in °, default value is 0. Can be only
applied if one of the
Efparameters is defined.
- If the resolution is read from file and plot option is
true, the energy dependent resolution values together with the
polynomial fit will be plotted in a new figure. Default value is
- If true, the data is normalized to mbarn units. Default is false. If no g-tensor is included in the spin wave calculation, will be assumed for the conversion.
false, the already modified
spectra.swConvfield is modified further instead of the original powder spectrum stored in
spectra.swRaw. Default value is
For simulating the effect of the neutron kinematic limit or the finite detector coverage of a neutron spectrometer one of the following parameter has to be given. The unit of these quantities is defined in spinw.unit with default momentum unit of Å and energy unit of meV.
- Fixed momentum of the incident neutrons.
- Fixed energy of the incident neutrons.
- Fixed final momentum of the neutrons.
- Fixed final energy of the neutrons.
- Defines whether to provide text output. The default value is determined
fidpreference stored in swpref. The possible values are:
0No text output is generated.
1Text output in the MATLAB Command Window.
fidFile ID provided by the
fopencommand, the output is written into the opened file stream.
- Struct variable, same as input with following additional fields:
true, if the spectrum is normalised to mbarn units.
kiFixed incident neutron wave vector if defined in the input.
kfFixed final neutron wave vector if defined in the input.
dEEnergy resolution polynomial as given in the input.
dQFWHM of the momentum resolution.
swRawOriginal simulated data before the application of