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

SaveNexusESS v1

../_images/SaveNexusESS-v1_dlg.png

SaveNexusESS dialog.

Summary

Saves intermediate, also known as ‘processed’ nexus file with data and geometry

Properties

Name Direction Type Default Description
InputWorkspace Input Workspace Mandatory Name of the workspace to be saved
Filename Input string Mandatory The name of the Nexus file to write, as a full or relative path. Allowed extensions: [‘.nxs’, ‘.nx5’, ‘.xml’]
Title Input string   A title to describe the saved workspace
WorkspaceIndexMin Input number 0 Index number of first spectrum to write, only for single period data.
WorkspaceIndexMax Input number Optional Index of last spectrum to write, only for single period data.
WorkspaceIndexList Input int list   List of spectrum numbers to read, only for single period data.
Append Input boolean False Determines whether .nxs file needs to be over written or appended
PreserveEvents Input boolean True For EventWorkspaces, preserve the events when saving (default). If false, will save the 2D histogram version of the workspace with the current binning parameters.
CompressNexus Input boolean False For EventWorkspaces, compress the Nexus data field (default False). This will make smaller files but takes much longer.

Description

Saves a processed nexus file similar to SaveNexusProcessed v1, but provides nexus geometry which is an accurate snapshot of the calibrated/transformed instrument geometry in-memory. One current major difference between the two algorithms is that SaveNexusESS does not support the generation of a single processed file based on a GroupWorkspace input.

The algorithm writes out spectra-detector mappings and can handle detector groupings.

This algorithm may be deprecated in future in favour of a master SaveNexusProcessed v1 algorithm.

This algorithm currently provides not shape information for component geometry.

Usage

Example - SaveNexusESS

from mantid.simpleapi import *
import os
import tempfile
simple_run = CreateSampleWorkspace(NumBanks=2, BankPixelWidth=10)
destination = os.path.join(tempfile.gettempdir(), "sample_processed.nxs")
SaveNexusESS(Filename=destination, InputWorkspace=simple_run)
print("Created: {}".format(os.path.isfile(destination)))
os.remove(destination)

Output:

Created: True

Categories: AlgorithmIndex | DataHandling\Nexus

Source

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

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