\(\renewcommand\AA{\unicode{x212B}}\)

SaveGSSCW v1

Summary

Save constant wavelength powder diffraction data to a GSAS file in FXYE format

See Also

SaveGSSCW

SaveGSS-v1

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

Workspace

Mandatory

Workspace to save

OutputFilename

Input

string

Mandatory

Name of the GSAS file to save to. Allowed extensions: [‘.gss’]

Description

Saves a constant wavelength diffraction pattern in units Degrees to FXYE GSAS format.

From the GSAS manual a description of the format options: If TYPE is ‘FXY’ or ‘FXYE’ then the data records give the position, intensity and in the case of ‘FXYE’ the esd in the intensity with one set per record and in free format. The values may also be in scientific form. The position is either in centidegrees for CW data or microseconds for TOF data. Each record must be padded out to 80 characters and end with CR/LF.

Usage

Example - a basic example using SaveGSSCW.

import os
# Create a workspace to save
ws = CreateSampleWorkspace(OutputWorkspace="SaveGSSWorkspace", XUnit='Degrees')
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

Categories: AlgorithmIndex | DataHandling\Nexus

Source

Python: SaveGSSCW.py