io.idl

Module Contents

Classes

Pointer(self,index) Class used to define pointers
ObjectPointer() Class used to define object pointers
AttrDict(self,init=dict) A case-insensitive dictionary with access via item, attribute, and call

Functions

_align_32(f) Align to the next 32-bit position in a file
_skip_bytes(f,n) Skip n bytes
_read_bytes(f,n) Read the next n bytes
_read_byte(f) Read a single byte
_read_long(f) Read a signed 32-bit integer
_read_int16(f) Read a signed 16-bit integer
_read_int32(f) Read a signed 32-bit integer
_read_int64(f) Read a signed 64-bit integer
_read_uint16(f) Read an unsigned 16-bit integer
_read_uint32(f) Read an unsigned 32-bit integer
_read_uint64(f) Read an unsigned 64-bit integer
_read_float32(f) Read a 32-bit float
_read_float64(f) Read a 64-bit float
_read_string(f) Read a string
_read_string_data(f) Read a data string (length is specified twice)
_read_data(f,dtype) Read a variable with a specified data type
_read_structure(f,array_desc,struct_desc) Read a structure, with the array and structure descriptors given as
_read_array(f,typecode,array_desc) Read an array of type typecode, with the array descriptor given as
_read_record(f) Function to read in a full record
_read_typedesc(f) Function to read in a type descriptor
_read_arraydesc(f) Function to read in an array descriptor
_read_structdesc(f) Function to read in a structure descriptor
_read_tagdesc(f) Function to read in a tag descriptor
_replace_heap(variable,heap)
readsav(file_name,idict=None,python_dict=False,uncompressed_file_name=None,verbose=False) Read an IDL .sav file.
_align_32(f)

Align to the next 32-bit position in a file

_skip_bytes(f, n)

Skip n bytes

_read_bytes(f, n)

Read the next n bytes

_read_byte(f)

Read a single byte

_read_long(f)

Read a signed 32-bit integer

_read_int16(f)

Read a signed 16-bit integer

_read_int32(f)

Read a signed 32-bit integer

_read_int64(f)

Read a signed 64-bit integer

_read_uint16(f)

Read an unsigned 16-bit integer

_read_uint32(f)

Read an unsigned 32-bit integer

_read_uint64(f)

Read an unsigned 64-bit integer

_read_float32(f)

Read a 32-bit float

_read_float64(f)

Read a 64-bit float

class Pointer(index)

Class used to define pointers

__init__(index)
class ObjectPointer

Class used to define object pointers

_read_string(f)

Read a string

_read_string_data(f)

Read a data string (length is specified twice)

_read_data(f, dtype)

Read a variable with a specified data type

_read_structure(f, array_desc, struct_desc)

Read a structure, with the array and structure descriptors given as array_desc and structure_desc respectively.

_read_array(f, typecode, array_desc)

Read an array of type typecode, with the array descriptor given as array_desc.

_read_record(f)

Function to read in a full record

_read_typedesc(f)

Function to read in a type descriptor

_read_arraydesc(f)

Function to read in an array descriptor

_read_structdesc(f)

Function to read in a structure descriptor

_read_tagdesc(f)

Function to read in a tag descriptor

_replace_heap(variable, heap)
class AttrDict(init=dict)

A case-insensitive dictionary with access via item, attribute, and call notations:

>>> d = AttrDict()
>>> d['Variable'] = 123
>>> d['Variable']
123
>>> d.Variable
123
>>> d.variable
123
>>> d('VARIABLE')
123
__init__(init=dict)
__getitem__(name)
__setitem__(key, value)
readsav(file_name, idict=None, python_dict=False, uncompressed_file_name=None, verbose=False)

Read an IDL .sav file.

file_name : str
Name of the IDL save file.
idict : dict, optional
Dictionary in which to insert .sav file variables.
python_dict : bool, optional
By default, the object return is not a Python dictionary, but a case-insensitive dictionary with item, attribute, and call access to variables. To get a standard Python dictionary, set this option to True.
uncompressed_file_name : str, optional
This option only has an effect for .sav files written with the /compress option. If a file name is specified, compressed .sav files are uncompressed to this file. Otherwise, readsav will use the tempfile module to determine a temporary filename automatically, and will remove the temporary file upon successfully reading it in.
verbose : bool, optional
Whether to print out information about the save file, including the records read, and available variables.
idl_dict : AttrDict or dict
If python_dict is set to False (default), this function returns a case-insensitive dictionary with item, attribute, and call access to variables. If python_dict is set to True, this function returns a Python dictionary with all variable names in lowercase. If idict was specified, then variables are written to the dictionary specified, and the updated dictionary is returned.