Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | MatrixWorkspace | Mandatory | The name of the workspace containing the data you wish to save |
Filename | Input | string | Mandatory | The filename to use for the saved data. Allowed values: [‘.his’, ‘.txt’, ‘’] |
IncludeHeader | Input | boolean | True | Whether to include the header lines (default: true) |
OpenGenieFormat | Input | string | ENGIN-X Format | The format required to succesfully load the file to OpenGnie: ENGIN-X Format (default). Allowed values: [‘ENGIN-X Format’, ‘Basic Format’] |
SpecNumberField | Input | string | Spec number is a required field for ENGIN-X format of OpenGenie,an example of spec number would be: 1201 - 1400 |
This algorithm outputs the data in OpenGenie ASCII file, which can also be generated by put /New/Ascii... ` on OpenGenie. The algorithm takes a focused workspaces which would generate an OpenGenie ASCII file with data saved inside. The algorithm will assume focused data (which contains single spectrum) has been provided, but if a workspace with multiple spectra is passed, the algorithm will save the first spectrum, while ignoring the rest. The algorithms will write out the x, y and e axis for each spectra along with all the sample logs which are available in the nexus file which is provided. The x, y, e axis and the sample logs are sorted by ascending alphabetical order within the file, which matches the format of OpenGenie ASCII file. The`ntc field is also included, which is required in order to run the generated file on OpenGenie, the value for ntc is the number of bins of the provided workspace.
Example - a basic example using SaveOpenGenieAscii.
import os
ws = CreateSampleWorkspace()
ws = ExtractSingleSpectrum(ws, WorkspaceIndex=0)
file_name = "myworkspace.ascii"
path = os.path.join(os.path.expanduser("~"), file_name)
SaveOpenGenieAscii(ws, path)
path = os.path.join(os.path.expanduser("~"), "myworkspace.ascii")
print os.path.isfile(path)
Output:
True
Categories: Algorithms | Diffraction\DataHandling | DataHandling\Text