IDLSave

A Python module to read IDL 'save' files
Download

IDLSave Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Thomas Robitaille
  • Publisher web site:

IDLSave Tags


IDLSave Description

A Python module to read IDL 'save' files IDLSave is a pure Python library designed to import variables from IDL 'save' files (e.g. .sav) into Python, and does not require IDL to work. It has a very simple command-line interface, and converts all IDL variables to Python types. Arrays are converted to Numpy arrays, and Structures are converted to Numpy record arrays.Installation:To install, simply run python setup.py install inside the idlsave-x.x.x directory.Quick start:The following example demonstrates how to read a .sav file into python. This is done using the idlsave.read method, which returns an IDLSaveFile instance. The variables are then accessible as attributes to the IDLSaveFile instance. Variable names are not case-sensitive. For structures (i.e. recarrays), variable names can be access either lower or upper case, but not mixed-case.Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) on darwinType "help", "copyright", "credits" or "license" for more information.>>> import idlsave>>> s = idlsave.read('varsandstructs.sav')--------------------------------------------------Date: Tue Sep 22 11:15:11 2009User: johndoeHost: hal9000--------------------------------------------------Format: 9Architecture: x86_64Operating System: linuxIDL Version: 7.0--------------------------------------------------Successfully read 11 records of which: - 7 are of type VARIABLE - 1 are of type TIMESTAMP - 1 are of type NOTICE - 1 are of type VERSION--------------------------------------------------Available variables: - nan [] - nstruct [] - floatarray [] - astruct [] - journalver [] - stringarray [] - zstruct []-------------------------------------------------->>> s.journalver800>>> s.floatarrayarray(, , , ..., , , ], dtype=float32) >>> s.nstructrec.array(, , , ..., , , ], dtype=float32), array(, , , ..., , , ], dtype=object), 'named structure')], dtype=) >>> s.nstruct.stringarrayarray( ..., ]], dtype=object)IDL is a registered trademark of ITT Visual Information Systems, Inc. for their Interactive Data Language software. Requirements: · Python · NumPy


IDLSave Related Software