Skip to main content

Module idl

Module idl 

Source
Expand description

IDL .sav files (SciPy’s io.readsav): the SAVE format of Harris Geospatial’s Interactive Data Language, as documented by Craig Markwardt’s Unofficial Format Specification.

A file is SR and a format code (\0\x04, or \0\x06 when every record is zlib-compressed), then records. Each has a type, the absolute offset of the next record (64 bits), four unused bytes and a body. All values are big-endian and padded to 32-bit boundaries: bytes and 16-bit integers take four bytes as scalars, a byte array is padded to a multiple of four, strings carry their length. A VARIABLE record holds a name, a type descriptor (a type code, flags, and for arrays and structures their descriptors) and the data; pointers refer to HEAP_DATA records by index, and are replaced by the values they point to.

Reading covers every scalar type, arrays of up to eight dimensions, strings, structures (nested, in arrays, inherited), pointers and object references, and compressed files. There is no writer; SciPy has none either.

See the book entry Scientific data files.

Structs§

IdlInfo
The descriptive records of a save file, where present.
IdlSave
A parsed save file.

Enums§

IdlType
The type of a numeric IDL value.
IdlValue
A value read from a save file. Arrays have NumPy’s shape, which is IDL’s dimensions reversed: IDL’s a[i, j] is element [j][i]. Data are in the file’s order, which is row-major in that shape. A scalar has empty dims.

Functions§

idl_decode
Parses an IDL save file (SciPy’s readsav): the variables in file order, pointers replaced by what they point to, and the descriptive records. A compressed file (format code \0\x06) is expanded record by record. Record types the reader does not use, such as COMPILED and PROMOTE64, are skipped by their next-record offsets, where SciPy refuses some of them.
read_idl_file
Reads an IDL save file.