Raw Data File Import

Both raw ASCII and binary data files and files in unsupported formats can be imported with rawfile module – with some effort. Raw data import can be explicitly invoked by selecting Raw data files type in the file open dialog. It can be also set to appear automatically when you try to open a file in an unknown format. This is controlled in the raw file dialog by option Automatically offer raw data import of unknown files.

Information

Its first tab, Information, allows to set basic file information:

Horizontal size, Vertical size

Horizontal and vertical data resolution (number of samples).

Square sample

Fixes horizontal and vertical resolution to the same value.

Width, Height

Physical sample dimensions.

Identical measure

Keeps the ratio between physical dimension and number of samples equal for horizontal and vertical direction, that is the data has square pixels.

Z-scale (per sample unit)

The factor to multiply raw data with to get physical values.

Missing value substitute

Special value that denotes missing data. Often a value at the edge of raw data range is used, e.g. -32768 for signed 16bit data. For text data it is also possible to give a string, e.g. BAD or NODATA, that substitutes missing data in the file.

If the missing value handling is enabled all pixels with the specified substitute value will be masked and replaced with a neutral value in the imported data field.

Invalid values (not-a-number, NaN) in floating point data types are masked and replaced automatically so you only need to enable the replacement if some other (finite) value is used to denote missing data.

Data Format

On the second tab, Data Format, particular data format can be chosen. There are two independent possibilities: Text data and Binary data.

Text files are assumed to be organized by lines, each line containing a one data row, data being represented by integers or floating point numbers in standard notation. Following options are available:

Start from line

The line data starts at, that is the number of lines to ignore from file start. All types of end-of-line markers (Unix, MS-DOS, Macintosh) are recognized.

Each row skip

The number of fields to ignore at the begining of each line.

Field delimiter, Other delimiter

If delimiter is Any whitespace, then any nonzero number of whitespace characters counts as field delimiter. If a whitespace character is selected, the delimiter must be this character. Otherwise field are separated by specified character or string and all whitespace around delimiters is ignored.

Decimal separator is comma

By default, floating point numbers are assumed to use decimal point. This option changes it to comma.

Following options are available for binary files:

Binary data

You can either select one of predefined standard data formats, or User defined to specify a format with odd number of bits per sample or other peculiarities.

Byte swap pattern

How bytes in samples are swapped. This option is only available for predefined formats larger than one byte. Its bits correspond to groups of bytes to swap: if the j-th bit is set, adjacent groups of 2j bits are swapped.

For example, value 3 means sample will be divided into couples (bit 1) of bytes and adjacent couples of bytes swapped, and then divided into single bytes (bit 0) and adjacent bytes swapped. The net effect is reversal of byte order in groups of four bytes. More generally, if you want to reverse byte order in groups of size 2j, which is the common case, use byte swap pattern j − 1.

Start at offset

Offset in file, in bytes, the data starts at.

Sample size

Size of one sample in bits for user defined formats. E.g., if you have a file with only 4 bits per sample, type 4 here. For predefined formats, their sample size is displayed, but it is not modifiable.

After each sample skip

The number of bits to skip after each sample.

Usually, samples are adjacent to each other in the file. But sometimes there are unused bits or bytes between them, that can be specified with this option. Note for predefined types the value must be a multiple of 8 (i.e., only whole bytes can be skipped).

After each row skip

The number of bits to skip after each sample in addition to bits skipped after each sample.

Usually, rows are adjacent to each other in the file. But sometimes there are unused bits or bytes between them, that can be specified with this option. Note for predefined types the value must be a multiple of 8 (i.e., only whole bytes can be skipped).

Reverse bits in bytes

Whether the order of bits in each byte should be reversed.

Reverse bits in samples

Whether the order bits in each sample should be reversed for user defined samples.

Samples are signed

Whether samples are to be interpreted as signed numbers (as opposed to unsigned). For predefined formats, their signedness is displayed, but it is not modifiable.

Presets

Import settings can be saved as presets that allow to easily import the same file – or the same file type – later.

Button Store saves current import settings under the name in Preset name field. Rename renames currently selected preset to specified name, Delete deletes selected preset, and Load replaced current import setting with selected preset.