Arrays are an extension of simple data types. In addition to the type code and VARFLAGS field, there is an additional segment called ARRAY_DESC, which describes the structure of the array:
Type | Name | Description | ||||||||
LONG | TYPECODE | IDL variable type code | ||||||||
LONG | VARFLAGS | Bit flags for a type descriptor, OR'd as follows:
|
||||||||
ARRAY_DESC | -- | Array descriptor segment |
An array descriptor structure is a fixed-length segment describing the dimensions of the array.
Type | Name | Description |
LONG | ARRSTART | Indicates start of array descriptor (= 8) |
LONG | NBYTES_EL | Number of bytes per element of the array? (string= 12) |
LONG | NBYTES | Number of bytes in array |
LONG | NELEMENTS | Number of elements in array |
LONG | NDIMS | Number of dimensions in array |
LONG2 | -- | Unknown (= [0,0]) |
LONG | NMAX | Number of stored dimensions (always 8?) |
LONGNMAX | DIMS | Dimensions of array, padded with 1s to NMAX |
NOTES: The ARRAY_DESC descriptor indicates the size of the array in a number of different manners. The total number of elements is given by the NELEMENTS field. The number of dimensions in the array is given by NDIMS. Even if NDIMS is less than 8, the array descriptor always appears to contain NMAX (=8) stored dimensions. The ``unused'' dimensions are padded with values of 1. The fields NBYTES_EL and NBYTES appear to be unused by readers. There is some evidence that setting these fields to values of 0 does not harm the readers' ability to parse the file.