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

LoadInstrumentFromRaw v1

Summary

Attempts to load information about the instrument from a ISIS raw file. In particular attempt to read L2 and 2-theta detector position values and add detectors which are positioned relative to the sample in spherical coordinates as (r,theta,phi)=(L2,2-theta,0.0). Also adds dummy source and samplepos components to instrument. If the L1 source - sample distance is not available in the file then it may be read from the mantid properties file using the key instrument.L1, as a final fallback a default distance of 10m will be used.

See Also

LoadInstrument

Properties

Name

Direction

Type

Default

Description

Workspace

InOut

MatrixWorkspace

Mandatory

The name of the workspace in which to store the imported instrument.

Filename

Input

string

Mandatory

The filename (including its full or relative path) of an ISIS RAW file. The file extension must either be .raw or .s?? Allowed extensions: [‘.raw’, ‘.s*’]

MonitorList

Output

int list

List of detector ids of monitors loaded into the workspace

Description

Attempts to load information about the instrument from a ISIS raw file. In particular, attempts to read L2 and 2-theta detector position values and add detectors which are positioned relative to the sample in spherical coordinates as (r,theta,phi)=(L2,2-theta,0.0). Also adds dummy source and samplepos components to instrument.

LoadInstrumentFromRaw is intended to be used as a child algorithm of other Load algorithms, rather than being used directly.

Usage

Example - Saving Some Pre-existing Data

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.

# Create a dummy ws containing arbitrary data, into which we will load the instrument.
ws = CreateSampleWorkspace("Histogram","Flat background")

det_id_list = LoadInstrumentFromRaw(ws, "LOQ48127.raw")

inst = ws.getInstrument()

print("The name of the instrument is '{}'.".format(inst.getName().strip()))
print("The position of the source is {}.".format(inst.getSource().getPos()))
print("The position of detector 5 is {}.".format(inst.getDetector(5).getPos()))
print("Is detector 1 a monitor? {}".format(inst.getDetector(1).isMonitor()))
print("Is detector 8 a monitor? {}".format(inst.getDetector(8).isMonitor()))

Output:

The name of the instrument is 'LOQ'.
The position of the source is [0,0,-11].
The position of detector 5 is [0,0,-11.15].
Is detector 1 a monitor? True
Is detector 8 a monitor? False

Categories: AlgorithmIndex | DataHandling\Instrument | DataHandling\Raw

Source

C++ header: LoadInstrumentFromRaw.h

C++ source: LoadInstrumentFromRaw.cpp