Table of Contents
Create a calibration file (extension .cal) for diffraction focusing based on the names of the components in the instrument tree.
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InstrumentWorkspace | Input | MatrixWorkspace | Mandatory | A workspace that contains a reference to the instrument of interest. You can use LoadEmptyInstrument to create such a workspace. |
GroupingFileName | Input | string | Mandatory | The name of the output CalFile. Allowed extensions: [‘.cal’] |
GroupNames | Input | string | A string of the instrument component names to use as separate groups. / or , can be used to separate multiple groups. |
Create a calibration file for diffraction focusing based on list of names of the instrument tree.
If a new file name is specified then offsets in the file are all sets to zero and all detectors are selected. If a valid calibration file already exists at the location specified by the GroupingFileName then any existing offsets and selection values will be maintained and only the grouping values changed.
Detectors not assigned to any group will appear as group 0, i.e. not included when using AlignDetector or DiffractionFocussing algorithms.
The group number is assigned based on a descent in the instrument tree assembly. If two assemblies are parented, say Bank1 and module1, and both assembly names are given in the GroupNames, they will get assigned different grouping numbers. This allows to isolate a particular sub-assembly of a particular leaf of the tree.
Example - create cal file from GEM instrument
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.
import os
# Prepare output file
newFile = os.path.join(os.path.expanduser("~"), "output.cal")
# Create test workspace. Normally just use reduced one
GEM = LoadEmptyInstrument(Filename="GEM_Definition.xml")
# Run the algorithm
CreateCalFileByNames("GEM",newFile,"bank1,bank2,module1")
# Check the output file
print "File Exists:", os.path.exists(newFile)
Output:
File Exists: True
Categories: Algorithms | Diffraction