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

LoadEmptyInstrument v1

../_images/LoadEmptyInstrument-v1_dlg.png

LoadEmptyInstrument dialog.

Summary

Loads an Instrument Definition File (IDF) into a workspace rather than a data file.

Properties

Name Direction Type Default Description
Filename Input string   The filename (including its full or relative path) of an instrument definition file. The file extension must either be .xml or .XML when specifying an instrument definition file. Files can also be .hdf5 or .nxs for usage with NeXus Geometry files. Note Filename or InstrumentName must be specified but not both. Allowed extensions: [‘.xml’, ‘.nxs’, ‘.hdf5’]
InstrumentName Input string   Name of instrument. Can be used instead of Filename to specify an IDF
OutputWorkspace Output MatrixWorkspace Mandatory The name of the workspace in which to store the imported instrument
DetectorValue Input number 1 This value affects the colour of the detectors in the instrument display window (default 1)
MonitorValue Input number 2 This value affects the colour of the monitors in the instrument display window (default 2)
MakeEventWorkspace Input boolean False Set to True to create an EventWorkspace (with no events) instead of a Workspace2D.

Description

This algorithm is to enable you to inspect the instrument geometry without having to load a full data file.

This algorithm works with both Instrument Definition Files and NeXus format (hdf5) files.

Input files only provide the instrument geometry. The instrument is referred to as being empty because there is no real data associated with it. The algorithm provides some limited options to determine what fake data will be used.

Usage

Example - Loading an instrument IDF from an XML file

wsOut = LoadEmptyInstrument(Filename="INES_Definition.xml")
print("The workspace contains {} spectra".format(wsOut.getNumberHistograms()))

Output:

The workspace contains 146 spectra

Example - Loading an instrument from an NeXus file

ws = LoadEmptyInstrument(Filename="LOKI_Definition.hdf5")
print("The workspace contains {} spectra".format(ws.getNumberHistograms()))
print("Instrument is {}".format(ws.getInstrument().getName()))

Output:

The workspace contains 8000 spectra
Instrument is LOKI

Categories: AlgorithmIndex | DataHandling\Instrument

Source

C++ header: LoadEmptyInstrument.h (last modified: 2021-03-31)

C++ source: LoadEmptyInstrument.cpp (last modified: 2021-03-31)