\(\renewcommand\AA{\unicode{x212B}}\)

VesuvioCorrections v1

Summary

Apply post fitting steps to vesuvio data

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

MatrixWorkspace

Mandatory

Input TOF workspace

WorkspaceIndex

Input

number

0

Index of spectrum to calculate corrections for

FitParameters

Input

TableWorkspace

Table containing the calculated fit parametersfor the data in the workspace

Masses

Input

dbl list

Mandatory

Mass values for fitting

MassIndexToSymbolMap

Input

Dictionary

null

A map from the index of the mass in the Masses property to a chemical symbol.

MassProfiles

Input

string

Mandatory

Functions used to approximate mass profile. The format is function=Function1Name,param1=val1,param2=val2;function=Function2Name,param3=val3,param4=val4

IntensityConstraints

Input

string

A semi-colon separated list of intensity constraints defined as lists e.g [0,1,0,-4];[1,0,-2,0]

HydrogenConstraints

Input

Dictionary

null

Constraints used to approximate the intensity of the hydrogen peak in back-scattering spectra for multiple scattering corrections.

ContainerWorkspace

Input

MatrixWorkspace

Container workspace in TOF

ContainerScale

Input

number

0

Scale factor to apply to container, set to 0 for automatic scale based on linear fit

GammaBackground

Input

boolean

True

If true, correct for the gamma background

GammaBackgroundScale

Input

number

0

Scale factor to apply to gamma background, set to 0 for automatic scale based on linear fit

MultipleScattering

Input

boolean

True

If true, correct for the effects of multiple scattering

BeamRadius

Input

number

2.5

Radius of beam in cm

SampleHeight

Input

number

5

Height of sample in cm

SampleWidth

Input

number

5

Width of sample in cm

SampleDepth

Input

number

5

Depth of sample in cm

SampleDensity

Input

number

1

Sample density in g/cm^3

Seed

Input

number

123456789

NumScatters

Input

number

3

NumRuns

Input

number

10

NumEvents

Input

number

50000

Number of neutron events

SmoothNeighbours

Input

number

3

CorrectionWorkspaces

Output

WorkspaceGroup

Workspace group containing correction intensities for each correction

CorrectedWorkspaces

Output

WorkspaceGroup

Workspace group containing individual corrections applied to raw data

LinearFitResult

Output

TableWorkspace

Table workspace containing the fit parameters used tolinearly fit the corrections to the data

OutputWorkspace

Output

MatrixWorkspace

Mandatory

The name of the output workspace

Description

Performs the post fitting corrections steps for Vesuvio data. These steps in include corrections for multiple scattering and gamma.

Usage

Example - VesuvioCorrections

###### Simulates LoadVesuvio with spectrum number 135-136 #################
tof_ws = CreateSimulationWorkspace(Instrument='Vesuvio',BinParams=[50,0.5,562],UnitX='TOF')
tof_ws = CropWorkspace(tof_ws,StartWorkspaceIndex=134,EndWorkspaceIndex=135) # index one less than spectrum number
tof_ws = ConvertToPointData(tof_ws)
SetInstrumentParameter(tof_ws, ParameterName='t0',ParameterType='Number',Value='0.5')
SetInstrumentParameter(tof_ws, ParameterName='sigma_l1', ParameterType='Number', Value='0.021')
SetInstrumentParameter(tof_ws, ParameterName='sigma_l2', ParameterType='Number', Value='0.023')
SetInstrumentParameter(tof_ws, ParameterName='sigma_tof', ParameterType='Number', Value='0.3')
SetInstrumentParameter(tof_ws, ParameterName='sigma_theta', ParameterType='Number', Value='0.028')
SetInstrumentParameter(tof_ws, ParameterName='hwhm_lorentz', ParameterType='Number', Value='24.0')
SetInstrumentParameter(tof_ws, ParameterName='sigma_gauss', ParameterType='Number', Value='73.0')
# Algorithm allows separate parameters for the foils
SetInstrumentParameter(tof_ws, ComponentName='foil-pos0', ParameterName='hwhm_lorentz',
                       ParameterType='Number', Value='144.0')
SetInstrumentParameter(tof_ws, ComponentName='foil-pos0', ParameterName='sigma_gauss',
                       ParameterType='Number', Value='20.0')
SetInstrumentParameter(tof_ws, ComponentName='foil-pos1', ParameterName='hwhm_lorentz',
                       ParameterType='Number', Value='144.0')
SetInstrumentParameter(tof_ws, ComponentName='foil-pos1', ParameterName='sigma_gauss',
                       ParameterType='Number', Value='20.0')

#######################Create dummy fit parameters#############################
params = CreateEmptyTableWorkspace(OutputWorkspace='__VesuvioCorrections_test_fit_params')

params.addColumn('str', 'Name')
params.addColumn('float', 'Value')
params.addColumn('float', 'Error')

params.addRow(['f0.Width', 4.72912, 0.41472])
params.addRow(['f0.FSECoeff', 0.557332, 0])
params.addRow(['f0.C_0', 11.8336, 1.11468])
params.addRow(['f1.Width', 10, 0])
params.addRow(['f1.Intensity', 2.21085, 0.481347])
params.addRow(['f2.Width', 13, 0])
params.addRow(['f2.Intensity', 1.42443, 0.583283])
params.addRow(['f3.Width', 30, 0])
params.addRow(['f3.Intensity', 0.499497, 0.28436])
params.addRow(['f4.A0', -0.00278903, 0.00266163])
params.addRow(['f4.A1', 14.5313, 22.2307])
params.addRow(['f4.A2', -5475.01, 35984.4])
params.addRow(['Cost function value', 2.34392, 0])


masses = [1.0079, 16.0, 27.0, 133.0]
profiles = "function=GramCharlier,hermite_coeffs=[1, 0, 0],k_free=0,sears_flag=1,width=[2, 5, 7];function=Gaussian,width=10;function=Gaussian,width=13;function=Gaussian,width=30"



corrections, corrected, linear_fit, out_ws = VesuvioCorrections(InputWorkspace=tof_ws,
                                                                GammaBackground=True,
                                                                FitParameters=params,
                                                                Masses=masses,
                                                                MassProfiles=profiles,
                                                                ContainerScale=0.1,
                                                                GammaBackgroundScale=0.2)

Categories: AlgorithmIndex | Inelastic\Indirect\Vesuvio

Source

Python: VesuvioCorrections.py