LoadCalFile v1#
Summary#
Loads a 5-column ASCII .cal file into up to 3 workspaces: a GroupingWorkspace, OffsetsWorkspace and/or MaskWorkspace.
See Also#
LoadDiffCal, ReadGroupsFromFile, CreateDummyCalFile, CreateCalFileByNames, DiffractionFocussing, SaveCalFile, MergeCalFiles
Properties#
Name |
Direction |
Type |
Default |
Description |
|---|---|---|---|---|
InputWorkspace |
Input |
Optional: An input workspace with the instrument we want to use. |
||
InstrumentName |
Input |
string |
Optional: Name of the instrument on which to base the GroupingWorkspace. |
|
InstrumentFilename |
Input |
string |
Optional: Path to a file (full or relative) defining the instrument on which to base the GroupingWorkspace. The file could be an IDF or a NeXus Geometry file. Note, InstrumentFilename or InstrumentName must be specified, but not both. Allowed extensions: [‘.xml’, ‘.hdf5’, ‘.nxs’, ‘.nxs.h5’] |
|
CalFilename |
Input |
string |
Mandatory |
Path to the old-style .cal grouping/calibration file (multi-column ASCII). You must also specify the instrument. Allowed extensions: [‘.cal’] |
MakeGroupingWorkspace |
Input |
boolean |
True |
Set to true to create a GroupingWorkspace with called WorkspaceName_group. |
MakeOffsetsWorkspace |
Input |
boolean |
True |
Set to true to create a OffsetsWorkspace with called WorkspaceName_offsets. |
MakeMaskWorkspace |
Input |
boolean |
True |
Set to true to create a MaskWorkspace with called WorkspaceName_mask. |
WorkspaceName |
Input |
string |
The base of the output workspace names. Names will have ‘_group’, ‘_cal’, ‘_offsets’, ‘_mask’ appended to them. |
Description#
This algorithm loads an ARIEL-style 5-column ASCII .cal file into up to
3 workspaces: a GroupingWorkspace, OffsetsWorkspace and/or MaskWorkspace.
The format is described here.
Usage#
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.
The following provides a simple example that uses just the instrument geometry to create the necessary workspaces.
# Grouping, offsets and masking workspaces are all made by default.
# WorkspaceName parameter is required in spite of docs not saying so.
ws = LoadCalFile(InstrumentName="GEM", CalFilename="offsets_2006_cycle064.cal",
WorkspaceName="ws")
print("Total number of workspaces = {}".format(len(ws)))
print("Workspace 1 type = {}".format(ws[0].id()))
print("Workspace 2 type = {}".format(ws[1].id()))
print("Workspace 3 type = {}".format(ws[2].id()))
print("Workspace 4 type = {}".format(ws[3].id()))
Output:
Total number of workspaces = 4
Workspace 1 type = GroupingWorkspace
Workspace 2 type = OffsetsWorkspace
Workspace 3 type = MaskWorkspace
Workspace 4 type = TableWorkspace
Categories: AlgorithmIndex | DataHandling\Text | Diffraction\DataHandling\CalFiles
Source#
C++ header: LoadCalFile.h
C++ source: LoadCalFile.cpp