SpecularReflectionPositionCorrect v2

../_images/SpecularReflectionPositionCorrect-v2_dlg.png

SpecularReflectionPositionCorrect dialog.

Summary

Corrects a detector component vertically based on TwoTheta.

Properties

Name Direction Type Default Description
InputWorkspace Input MatrixWorkspace Mandatory An input workspace to correct.
TwoTheta Input number Mandatory Angle used to correct the detector component.
DetectorComponentName Input string Mandatory Name of the detector component to correct, i.e. point-detector
SampleComponentName Input string some-surface-holder Name of the sample component, i.e. some-surface-holder
OutputWorkspace Output MatrixWorkspace Mandatory An output workspace.

Description

Moves the specified detector component vertically so that the angle between the beam and the sample-to-detector vector is TwoTheta. The detector component is moved as a block. The rest of the instrument components remain in the original position.

Previous Versions

For version 1 of the algorithm, please see SpecularReflectionPositionCorrect-v1.

Usage

Note

To run these usage examples please first download the usage data, and add these to your path. In MantidPlot this is done using Manage User Directories.

Example - Correct ‘point-detector’

polref = Load(Filename=r'POLREF00004699.raw', PeriodList=1)
polref = polref[0]

instr = polref.getInstrument()
print instr.getComponentByName('point-detector').getPos()

polref = SpecularReflectionPositionCorrect(polref, TwoTheta = 2*0.49, DetectorComponentName='point-detector')
instr = polref.getInstrument()
print instr.getComponentByName('point-detector').getPos()

Output:

[25.6,0,0.0444961]
[25.6,0,0.0444753]

Example - Correct ‘lineardetector’

polref = Load(Filename=r'POLREF00004699.raw', PeriodList=1)
polref = polref[0]

instr = polref.getInstrument()
print instr.getComponentByName('lineardetector').getPos()

polref = SpecularReflectionPositionCorrect(polref, TwoTheta = 2*0.49, DetectorComponentName='lineardetector')
instr = polref.getInstrument()
print instr.getComponentByName('lineardetector').getPos()

Output:

[26,0,0]
[26,0,0.0513177]

Example - Correct ‘OSMOND’

polref = Load(Filename=r'POLREF00004699.raw', PeriodList=1)
polref = polref[0]

instr = polref.getInstrument()
print instr.getComponentByName('OSMOND').getPos()

polref = SpecularReflectionPositionCorrect(polref, TwoTheta = 2*0.49, DetectorComponentName='OSMOND')
instr = polref.getInstrument()
print instr.getComponentByName('OSMOND').getPos()

Output:

[26,0,0]
[26,0,0.0513177]

Categories: Algorithms | Reflectometry