\(\renewcommand\AA{\unicode{x212B}}\)
Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | MatrixWorkspace | Mandatory | A workspace to be converted. |
OutputWorkspace | Output | MatrixWorkspace | Mandatory | A workspace with (2theta, TOF) units. |
AngleStep | Input | number | Optional | The angle step for detector grouping, in degrees. |
GroupingFilename | Input | string | A grouping file that will be created; a corresponding .par file wille be created as well. Allowed extensions: [‘.xml’] |
This algorithm converts a workspace from (spectrum number, TOF) coordinates to (\(2\theta\), TOF). The latter view is useful for visualization and diagnostics purposes of direct geometry spectrometers with large PSD arrays. The algorithm performs the following steps:
A default AngleStep
can be defined in the instrument parameters. The parameter is called natural-angle-step
; its type should be float
and value the desired AngleStep
in degrees.
The instrument should have an l2
parameter defined which is the nominal sample to detector distance. Also, sample logs should include a wavelength
entry (in Angstroms). See ConvertToConstantL2 for more details.
By default, the .xml
and .par
files generated by GenerateGroupingPowder are stored in a temporary location and deleted when the algorithm finishes. If these files are needed afterwards, a name for the .xml
file can be given by GroupingFilename
. The .par
file will have the same name except for the file extension which is changed from .xml
to .par
. Note that this algorithm forces the .xml
extension to GroupingFilename
.
Example - Applying SofTwoThetaTOF and plotting the result
from mantid.simpleapi import *
import directtools as dt
ws = CreateSampleWorkspace(Function='Quasielastic Tunnelling', NumBanks=1, BankPixelWidth=20)
AddSampleLog(ws, 'wavelength', '6.26', 'Number', 'Angstrom')
SetInstrumentParameter(ws, ParameterName='l2', ParameterType='String', Value='5')
SofTT = SofTwoThetaTOF(ws, AngleStep=1)
fig, axes = dt.subplots()
axes.pcolor(SofTT)
axes.set_xlim(0.)
# Uncomment the line below to show the plot.
#fig.show()
(Source code, png, hires.png, pdf)
Categories: AlgorithmIndex | Inelastic | ILL\Direct
C++ header: SofTwoThetaTOF.h (last modified: 2020-03-20)
C++ source: SofTwoThetaTOF.cpp (last modified: 2020-04-07)