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§
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 emptydims.
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 asCOMPILEDandPROMOTE64, are skipped by their next-record offsets, where SciPy refuses some of them. - read_
idl_ file - Reads an IDL save file.