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

SaveNexusGeometry v1

../_images/ImageNotFound.png

Enable screenshots using DOCS_SCREENSHOTS in CMake

Summary

Save the instrument from a workspace to a Nexus-format HDF file. WARNING: shapes are NOT saved in the present version (1.0).

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

MatrixWorkspace

Mandatory

Workspace containing the Instrument.

Filename

Input

string

Full path to save destination file

EntryName

Input

string

entry

(optional) Name of the H5 root group in which the Instrument is to be saved. Default name: ‘entry’.

Description

Saves the Instrument geometry from the workspace to a Nexus file. Saves detector positions and rotations. Current version (1.0) does NOT save instrument shapes of instrument components. file is compliant to Nexus standards. For more information on the Nexus format, see https://www.nexusformat.org/

the Instrument will be extracted from the specified workspace, and written to the specified location.

The (optional) H5 root group name is the parent group in which the Instrument and sample data are stored. If no name is given, the root group will have a default nme of ‘entry’

Usage

Example - basic example using SaveNexusGeometry, with default H5 root group

import os

ws = CreateSampleWorkspace()
file_name  = "example_save_nexus_geometry.nxs"
path = os.path.join(os.path.expanduser("~"), file_name)

SaveNexusGeometry(ws, path)
print(os.path.isfile(path))

Output:

True

Categories: AlgorithmIndex | DataHandling\Instrument

Source

C++ header: SaveNexusGeometry.h

C++ source: SaveNexusGeometry.cpp