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

LoadAscii v1

../_images/ImageNotFound.png

Enable screenshots using DOCS_SCREENSHOTS in CMake

Warning

LoadAscii is deprecated. Use LoadAscii version 2 instead.

Summary

Loads data from a text file and stores it in a 2D workspace (Workspace2D class).

Properties

Name

Direction

Type

Default

Description

Filename

Input

string

Mandatory

The name of the text file to read, including its full or relative path. The file extension must be .txt, .dat, or .csv. Allowed values: [‘.dat’, ‘.txt’, ‘.csv’, ‘’]

OutputWorkspace

Output

Workspace

Mandatory

The name of the workspace that will be created, filled with the read-in data and stored in the [[Analysis Data Service]].

Separator

Input

string

Automatic

The separator between data columns in the data file. The possible values are “CSV”, “Tab”, “Space”, “SemiColon”, or “Colon” (default: Automatic selection). Allowed values: [‘Automatic’, ‘CSV’, ‘Tab’, ‘Space’, ‘Colon’]

Unit

Input

string

Energy

The unit to assign to the X axis (anything known to the [[Unit Factory]] or “Dimensionless”). Allowed values: [‘Dimensionless’, ‘AtomicDistance’, ‘Degrees’, ‘DeltaE’, ‘DeltaE_inFrequency’, ‘DeltaE_inWavenumber’, ‘dSpacing’, ‘dSpacingPerpendicular’, ‘Empty’, ‘Energy’, ‘Energy_inWavenumber’, ‘Label’, ‘Momentum’, ‘MomentumTransfer’, ‘Phi’, ‘QSquared’, ‘SpinEchoLength’, ‘SpinEchoTime’, ‘Temperature’, ‘Time’, ‘TOF’, ‘Wavelength’]

SkipNumLines

Input

number

Optional

If given, skip this number of lines at the start of the file.

Description

The LoadAscii algorithm reads in spectra data from a text file and stores it in a Workspace2D as data points. The data in the file must be organized in columns separated by commas, tabs, spaces, colons or semicolons. Only one separator type can be used throughout the file; use the “Separator” property to tell the algorithm which to use. The algorithm SaveAscii v2 is normally able to produce such a file.

By default the algorithm attempts to guess which lines are header lines by trying to see where a contiguous block of numbers starts. This can be turned off by specifying the “SkipNumLines” property, which will then tell the algorithm to simply use that as the the number of header lines.

The format can be one of:

  • Two columns: 1st column=X, 2nd column=Y, E=0

  • For a workspace of n spectra, 2n+1 columns: 1st column=X, 2ith column=Y, 2i+1th column =E

  • Four columns: 1st column=X, 2nd column=Y, 3rd column=E, 4th column=DX (X error)

The number of bins is defined by the number of rows.

The resulting workspace will have common X binning for all spectra.

This algorithm cannot load a file created by SaveAscii v2 if it has X errors written and several spectra.

Categories: AlgorithmIndex | DataHandling\Text | Deprecated

Source

C++ header: LoadAscii.h

C++ source: LoadAscii.cpp