\(\renewcommand\AA{\unicode{x212B}}\)
Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | MatrixWorkspace | Mandatory | The input workspace |
Filename | Input | string | Mandatory | The filename to use for the saved data. Allowed extensions: [‘.gsa’, ‘.gss’, ‘.gda’, ‘.txt’] |
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’] |
DataFormat | Input | string | FXYE | Saves RALF data as either FXYE or alternative format. Allowed values: [‘FXYE’, ‘ALT’] |
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 continuous bank IDs are applied. |
UserSpecifiedGSASHeader | Input | str list | Each line will be put to the header of the output GSAS file. | |
OverwriteStandardHeader | Input | boolean | True | If true, then the standard header will be replaced by the user specified header. Otherwise, the user specified header will be inserted before the original header |
UserSpecifiedBankHeader | Input | str list | Each string will be used to replaced the standard GSAS bank header.Number of strings in the give array must be same as number of banks.And the order is preserved. | |
SLOGXYEPrecision | Input | int list | 9,9,9 | Enter 3 integers as the precisions of output X, Y and E for SLOG data only.Default is (9, 9, 9) if it is left empty. Otherwise it is not allowed. |
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 . 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, unless SplitFiles is on.
Example - a basic example using SaveGSS.
import os
# Create a workspace to save
ws = CreateSampleWorkspace(OutputWorkspace="SaveGSSWorkspace")
ws = ExtractSingleSpectrum(ws, WorkspaceIndex=0)
# Save to the users home directory
file_name = "myworkspace.ascii"
path = os.path.join(os.path.expanduser("~"), file_name)
SaveGSS(ws, path)
# Does the file exist
path = os.path.join(os.path.expanduser("~"), file_name)
print(os.path.isfile(path))
Output:
True
Example - an example using SaveGSS with additional options.
import os
ws = CreateSampleWorkspace(OutputWorkspace="SaveGSSWorkspace")
# GSAS file cannot have more than 99 entries
ws = CropWorkspace(ws, StartWorkspaceIndex=0, EndworkspaceIndex=98)
# Save out GSAS file
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: AlgorithmIndex | Diffraction\DataHandling | DataHandling\Text
C++ header: SaveGSS.h (last modified: 2020-03-20)
C++ source: SaveGSS.cpp (last modified: 2020-04-07)