SaveNISTDAT v1

../_images/SaveNISTDAT-v1_dlg.png

SaveNISTDAT dialog.

Summary

Save I(Qx,Qy) data to a text file compatible with NIST and DANSE readers.

Properties

Name Direction Type Default Description
InputWorkspace Input MatrixWorkspace Mandatory  
Filename Input string Mandatory The filename of the output text file. Allowed extensions: [‘.dat’]

Description

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.

Usage

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: Algorithms | SANS | DataHandling\Text

Source

C++ source: SaveNISTDAT.cpp

C++ header: SaveNISTDAT.h