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

SetCrystalLocation v1

../_images/SetCrystalLocation-v1_dlg.png

SetCrystalLocation dialog.

Summary

This algorithm sets the sample location of the input event workspace.

Properties

Name Direction Type Default Description
InputWorkspace Input EventWorkspace Mandatory Original event workspace
OutputWorkspace Output EventWorkspace Mandatory Output event workspace with a modified sample position
NewX Input number 0 New Absolute X position of crystal.
NewY Input number 0 New Absolute Y position of crystal.
NewZ Input number 0 New Absolute Z position of crystal.

Description

This algorithm changes the sample location for an events workspace. If the InputWorkspace and OutputWorkspace are the same, the position is simply changed. If the InputWorkspace and OutputWorkspace are different, the InputWorkspace is cloned then the clone’s position is changed. The former is faster, especially for large workspaces.

Usage

Example:

events = Load('BSS_11841_event.nxs')
sample = mtd['events'].getInstrument().getSample()
print('Sample position before SetCrystalLocation: {}'.format(sample.getPos()))
SetCrystalLocation(InputWorkspace=events, OutputWorkspace=events, NewX=0.1, NewY=0.1, NewZ=0.1)
print('Sample position after SetCrystalLocation: {}'.format(sample.getPos()))

Output:

Sample position before SetCrystalLocation: [0,0,0]
Sample position after SetCrystalLocation: [0.1,0.1,0.1]

Categories: AlgorithmIndex | Crystal\Corrections