### 4 Supported data formats

SPLAT-VO can read and write spectra stored in a wide variety of formats, either stored as 1D spectra or as columns in tables. 1D spectral formats supported are Starlink NDF & NDX, FITS and simple TEXT files. Table formats supported are FITS (binary and ascii), VOTable and more complex TEXT files. The 1D data formats currently have the best coordinate system support, so are recommended when a choice can be made. Some support is available for 2 and 3D data, see later).

Normally SPLAT-VO differentiates these types using a preset list of file extensions, for instance NDFs can only be stored in container files that have the extension .sdf, FITS files usually have one of the extensions .fits or .fit and TEXT files .txt or .lis and NDX format spectra, when stored on disk, will have extension .xml. However, you can choose a specific format when opening a file using the File->Open dialogue, so you can ask that a TEXT file is opened as a table, this allows you to select the columns. There is also a special type known as guess. When you choose that attempts to open the spectrum as different types are made until one succeeds, or the possibilities are exhausted.

You can specify a type for all the spectra opened on the command-line using the --type argument. Valid values for --type are:

fits
hds
text
hdx
table
line ids
guess

You free to truncate these values as long as they remain unique (so --type line will work for line identifiers).

Currently line identifier catalogues represent a special case and currently may have a single format - TEXT based in files with extension .ids.

1D spectra stored in TEXT files must have the format of one, two or three columns of data, separated by whitespace (that is spaces or tabs). Any comments in the file must be indicated by a hash sign, blank lines are also allowed. The three columns should have the following values:

[wavelength] count [error-in-count]

The wavelength and error columns being optional (if you don’t have a wavelength column a simple row index is used, note you cannot have errors without wavelengths) . If you choose to open a TEXT file as a table you can select which columns should be used for these values, and the following rules apply:

• Each table row is represented by a single text line
• Anything after a ‘#’ character on a line is ignored (except for optional heading line)
• Blank lines are ignored
• Within a line, fields are separated by one or more whitespace characters (space or tab)
• A field is either a sequence of non-whitespace characters or a sequence of characters between two matching quote characters (single (’) or double (") quotes) - spaces are therefore allowed in quoted fields.
• In a quoted field any character preceded by a backslash is interpreted literally, so it is possible to insert quotes into a quoted string
• An empty string (two adjacent quotes) represents a null element
• All lines must contain exactly the same number of fields
• An optional heading line may be included: if the last comment line (line starting with a ‘#’ before the first data line) contains the same number of fields as the columns in the table, these fields are interpreted as the headings (names) of the columns

The format of line identification catalogues is like that of simple TEXT spectral files, except the second column contains a string that identifies the line (with no spaces, i.e. H-alpha not H alpha). It is also possible to define the system of the coordinate values in a header section, see the SPLAT-VO built-in catalogues for examples of this.

NDFs stored within container files can be accessed, but only by entering the full HDS path on the command-line or in the File->Open dialogue. FITS extensions may also be open in this fashion (by appending the extension number in square brackets).

An alternative to specifying the component information is to use the component browser window , to see the contents of FITS and NDF files and choose the component to display directly. This uses the same techniques as the special guess type.

Internally all these formats are stored as double precision coordinates and data values. SPLAT-VO only requires that coordinates increase or decrease monotonically when performing any analyses.

#### 4.1 Handling 2 and 3D data

If you have images or cubes that contain data that you want to view as spectra in some fashion, then SPLAT-VO will attempt to do this for you. There are three fundamental modes for doing this:

• Collapsing images into a spectrum or the planes of a cube into a set of spectra by adding together all values that lie perpendicular to the dispersion axis (so the spectra run along this axis, what a good spectral displaying tool should do).
• Extracting all spectra from each data line running along the dispersion axis of images and cubes.
• Vectorizing the whole data set into a single data line without any reference to its dimensionality (in effect mapping the whole image/cube as a single contiguous data line).

The default is to collapse. When collapsing cubes you have the option of which axis to step along selecting image planes, this is known as the select axis. To determine which option is used to handle your cubes or images you can either set values on the command-line, along with your spectra, or choose options in the open file dialogue. A command line that uses axis 3 as the dispersion axis and steps along axis 2 when choosing image planes might look like:

% splat --ndaction collapse --dispax 3 --selectax 2 <spectral_cube> &

or in shorthand:

% splat -n c -d 3 -s 2 <spectral_cube> &

If you don’t choose a dispersion axis SPLAT-VO will make a good intelligent guess about this and step along the first axis that isn’t the dispersion axis. The other possible values for ndaction are extract and vectorize. These are described as extract all spectra and open whole as 1D, respectively, in the open file dialogue.