\(\renewcommand\AA{\unicode{x212B}}\)
Table of Contents
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. |
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.
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
C++ header: SetCrystalLocation.h (last modified: 2021-03-31)
C++ source: SetCrystalLocation.cpp (last modified: 2021-03-31)