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

CreateCalFileByNames v1

../_images/ImageNotFound.png

Enable screenshots using DOCS_SCREENSHOTS in CMake

Summary

Create a calibration file (extension .cal) for diffraction focusing based on the names of the components in the instrument tree.

See Also

ReadGroupsFromFile, CreateDummyCalFile, AlignDetectors, DiffractionFocussing, LoadCalFile, SaveCalFile, MergeCalFiles

Properties

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.

Description

Instrument Tree

Instrument Tree

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.

Usage

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 Mantid 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: {}".format(os.path.exists(newFile)))

Output:

File Exists: True

Categories: AlgorithmIndex | Diffraction\DataHandling\CalFiles

Source

C++ header: CreateCalFileByNames.h

C++ source: CreateCalFileByNames.cpp