Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | MatrixWorkspace | Mandatory | The input workspace, which must be in time-of-flight |
Filename | Input | string | Mandatory | The filename to use for the saved data |
SplitFiles | Input | boolean | True | Whether to save each spectrum into a separate file (‘true’) or not (‘false’). Note that this is a string, not a boolean property. |
Append | Input | boolean | True | If true and Filename already exists, append, else overwrite |
Bank | Input | number | 1 | The bank number to include in the file header for the first spectrum, i.e., the starting bank number. This will increment for each spectrum or group member. |
Format | Input | string | RALF | GSAS format to save as. Allowed values: [‘RALF’, ‘SLOG’] |
MultiplyByBinWidth | Input | boolean | True | Multiply the intensity (Y) by the bin width; default TRUE. |
ExtendedHeader | Input | boolean | False | Add information to the header about iparm file and normalization |
UseSpectrumNumberAsBankID | Input | boolean | False | If true, then each bank’s bank ID is equal to the spectrum number; otherwise, the continous bank IDs are applied. |
Saves a focused data set into a three column GSAS format containing X_i, Y_i*step, and E_I*step. Exclusively for the crystallography package GSAS and data needs to be in time-of-flight. For data where the focusing routine has generated several spectra (for example, multi-bank instruments), the option is provided for saving all spectra into a single file, separated by headers, or into several files that will be named “workspaceName_”+workspace_index_number.
From the GSAS manual a description of the format options:
The format is limited to saving 99 spectra in total. Trying to save more will generate an error.
Example - a basic example using SaveGSS.
import os
ws = CreateSampleWorkspace()
ws = ExtractSingleSpectrum(ws, WorkspaceIndex=0)
file_name = "myworkspace.ascii"
path = os.path.join(os.path.expanduser("~"), file_name)
SaveGSS(ws, path)
path = os.path.join(os.path.expanduser("~"), "myworkspace-0.ascii")
print os.path.isfile(path)
Output:
True
Example - an example using SaveGSS with additonal options.
import os
ws = CreateSampleWorkspace()
#GSAS file cannot have more than 99 entries
ws = CropWorkspace(ws, StartWorkspaceIndex=0, EndworkspaceIndex=98)
file_name = "myworkspace.ascii"
path = os.path.join(os.path.expanduser("~"), file_name)
SaveGSS(ws, path, SplitFiles=False, ExtendedHeader=True, UseSpectrumNumberAsBankID=True)
print os.path.isfile(path)
Output:
True
Categories: Algorithms | Diffraction\DataHandling | DataHandling\Text