$$\renewcommand\AA{\unicode{x212B}}$$

## Summary¶

Attempts to load some information about the instrument from a Nexus file. It 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.

## Properties¶

Name

Direction

Type

Default

Description

Workspace

InOut

MatrixWorkspace

Mandatory

The name of the workspace in which to attach the imported instrument

Filename

Input

string

Mandatory

The name (including its full or relative path) of the Nexus file to attempt to load the instrument from. The file extension must either be .nxs or .NXS. Allowed extensions: [‘.nxs’]

## Description¶

Attempts to load information about the instrument from a ISIS NeXus file. In particular, it attempts to read the reference frame axis. Also adds dummy source and samplepos components to instrument.

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

## Usage¶

Note

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

print("The name of the instrument is '{}'.".format(inst.getName().strip()))
print("The source position is at:  {}.".format(source.getPos()))


Output:

The name of the instrument is 'MUSR'.
The source position is at:  [0,-10,0].


Categories: AlgorithmIndex | DataHandling\Instrument