Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | MatrixWorkspace | Mandatory | |
Filename | Input | string | Mandatory | The filename of the output text file. Allowed extensions: [‘.dat’] |
Qxy rebins a 2D workspace in units of wavelength into 2D Q. It also normalises to the solid angle of each detector pixel. The result is stored in a 2D workspace with two numeric axes, both in units of Q. SaveNISTDAT can then save the output of Qxy to an ASCII file in a form that can be read by NIST software.
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 MantidPlot this is done using Manage User Directories.
import os
# Load in some data which is already in a form that SaveNISTDAT expects,
# then save it back out to a file.
data = Load("saveNISTDAT_data.nxs")
file_path = os.path.join(config["defaultsave.directory"], "example.dat")
SaveNISTDAT(data, file_path)
# Load it back in and inspect what we have.
reloaded_data = LoadAscii(file_path)
print("The data read back in is " + str(reloaded_data.readY(0)))
Output:
The data read back in is [-0.0735 -0.0735 -0.0735 ..., 0.0685 0.0685 0.0685]
Categories: AlgorithmIndex | SANS | DataHandling\Text
C++ source: SaveNISTDAT.cpp (last modified: 2019-06-05)
C++ header: SaveNISTDAT.h (last modified: 2018-10-05)