\(\renewcommand\AA{\unicode{x212B}}\)
Here we aim to write a small algorithm that performs a reduction and conversion to energy transfer of some raw data. This is essentially a snippet of the proper reduction done for the direct-geometry inelastic instruments.
Write an algorithm called ConvertToEnergy
. The algorithm should have
4 properties:
FileProperty
for a file to load (ignore extensions).FloatArrayProperty
that will contain the binning of the final
workspace.MatrixWorkspaceProperty
to hold the final result.The steps the algorithm should perform are:
LoadMonitors = "Exclude"
.Target='DeltaE', EMode='Direct', EFixed=value
of Ei property.Params=value
of
the BinParams
property.Rebin
(Hint: Use the WorkspaceFactory
and create a workspace
that uses the existing one as a template but with one row).OutputWorkspace
property.To test the algorithm, execute the file that contains the algorithm to register it with Mantid. It will then show up in the list of algorithms. Use the following inputs:
Filename
: MAR11015.rawEi
: 12.9729BinParams
: -11,0.01,11OutputWorkspace
: DeltaEPlot the single spectrum that has been output and the peak should have its centre at 0 and look like this:
Once finished check your answer with the provided Exercise 4 Solutions