LoadCalFile v1

../_images/LoadCalFile-v1_dlg.png

LoadCalFile dialog.

Summary

Loads a 5-column ASCII .cal file into up to 3 workspaces: a GroupingWorkspace, OffsetsWorkspace and/or MaskWorkspace.

Properties

Name Direction Type Default Description
InputWorkspace Input MatrixWorkspace   Optional: An input workspace with the instrument we want to use.
InstrumentName Input string   Optional: Name of the instrument to base the GroupingWorkspace on which to base the GroupingWorkspace.
InstrumentFilename Input string   Optional: Path to the instrument definition file on which to base the GroupingWorkspace. Allowed extensions: [‘.xml’]
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

  • Number: ignored.* UDET: detector ID.* Offset: calibration offset. Goes to the OffsetsWorkspace.
  • Select: 1 if selected (not masked out). Goes to the MaskWorkspace.
  • Group: group number. Goes to the GroupingWorkspace.

Usage

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.

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 inspite of docs not saying so.
ws = LoadCalFile(InstrumentName="GEM", CalFilename="offsets_2006_cycle064.cal",
                 WorkspaceName="ws")
print "Total number of workspaces =", len(ws)
print "Workspace 1 type =", ws[0].id()
print "Workspace 2 type =", ws[1].id()
print "Workspace 3 type =", ws[2].id()
print "Workspace 4 type =", 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: Algorithms | DataHandling\Text | Diffraction\DataHandling\CalFiles

Source

C++ source: LoadCalFile.cpp

C++ header: LoadCalFile.h