SaveILLCosmosAscii v1

../_images/SaveILLCosmosAscii-v1_dlg.png

SaveILLCosmosAscii dialog.

Warning

SaveILLCosmosAscii is deprecated (on 2018-06-29). Use SaveReflectometryAscii instead.

Summary

Saves a 2D workspace to a ascii file of format mft.

Properties

Name Direction Type Default Description
InputWorkspace Input MatrixWorkspace Mandatory The name of the workspace containing the data you want to save.
Filename Input string Mandatory The filename of the output file. Allowed extensions: [‘.mft’]
LogList Input str list   List of logs to write to file.
UserContact Input string   Text to be written to the User-local contact field
Title Input string   Text to be written to the Title field
Separator Input string tab The separator used for splitting data columns. Allowed values: [‘comma’, ‘space’, ‘tab’]

Description

SaveILLCosmosAscii is an export-only ASCII-based save format with no associated loader. It is based on a python script by Maximilian Skoda, written for the ISIS Reflectometry GUI

Limitations

While Files saved with SaveILLCosmosAscii can be loaded back into Mantid using LoadAscii, the resulting workspaces won’t be useful as the data written by SaveILLCosmosAscii is not in the normal X,Y,E,DX format.

Usage

Example - Save a workspace in ILL Cosmos ASCII format

#import the os path libraries for directory functions
import os

# create histogram workspace
dataX1 = [0,1,2,3,4,5,6,7,8,9] # or use dataX1=range(0,10)
dataY1 = [0,1,2,3,4,5,6,7,8] # or use dataY1=range(0,9)
dataE1 = [1,1,1,1,1,1,1,1,1] # or use dataE1=[1]*9

ws1 = CreateWorkspace(dataX1, dataY1, dataE1)

#Create an absolute path by joining the proposed filename to a directory
#os.path.expanduser("~") used in this case returns the home directory of the current user
savefile = os.path.join(os.path.expanduser("~"), "ILLCosmosAsciiFile.mft")

# perform the algorithm
SaveILLCosmosAscii(InputWorkspace=ws1,Filename=savefile)

print("File Exists: {}".format(os.path.exists(savefile)))

Output:

File Exists: True

Categories: AlgorithmIndex | DataHandling\Text | Deprecated

Source

C++ source: SaveILLCosmosAscii.cpp (last modified: 2019-06-04)

C++ header: SaveILLCosmosAscii.h (last modified: 2018-10-05)