# General Outline and Data Structure of Images

Section basically up to date

The GILDAS software is designed to work in an heterogeneous network, where each computer may have its own floating point and integer number representation and its own operating system. Images created on any computer should be accessible transparently from any other computer in the network.

To allow such a portability and yet preserve efficiency when working on a single type of machines, all files are written in the binary representation of the machine on which they were created. A library of subroutines is used to access the images and perform the necessary format conversion between the different representations of real and integer numbers. So far, 3 representations are recognized: VAX format (a dead dinosaur...), IEEE format (the so-called big-endians, like DEC DS Workstation, Intel & AMD PCs and most affordable current computers) and EEEI format (big-endians, like Sun SparcStation, IBM RS-6000 series, and other obsolescent machines...).

The images have the following organization :

- Images are basically direct access files with a logical blocksize of 512 bytes. This correspond to the system block size on VAX-VMS machines.
- The first block is a header block, defining the size of the image and all major parameters, such as World Coordinate System definition.
- The following blocks containing the image array itself.
- There may be trailing blocks for additional information. These trailing blocks are not compulsory, and may be ignored by the processing software.
- the number of logical blocks is rounded upwards to a multiple of 16 blocks, to allow reading with 8192 byte blocks.

The header starts with 'GILDAS', followed by one character which indicates the type of integer and floating point number representation

- The inferior sign “” for swapped IEEE machines (big-endians, IBM RS-6000, SUN Sparc, etc...), with a 64-bit header (so-called GDFV2 data version)
- The superior sign “” for non-swapped IEEE machines (little-endians) with a 64-bit header (so-called GDFV2 data version)
- Underscore “_” for VAX machines
- Dot “.” for swapped IEEE machines (IBM RS-6000, SUN Sparc, etc...)
- Minus “-” for non-swapped IEEE machines (DEC DS series)

The last 3 cases are inherited from the GDFV1 data version, in which all size informations were limited to 32-bit numbers. The latest GDFV2 data version has some integers using 64 bit values to handle large data sets.

After the version/hardware sign, an extra text indicates the type of information in the image:

- IMAGE for all images (up to 4-D arrays)
- UVFIL for UV tables

This character string, being human readable, is intended for quick checks, but a more specific information about the actual type of data file is available through an integer code in the data header.