Language/Format: Numpy, Python
Application type(s): Data Read/Write
Related project(s):


This tool is a generic Python module for reading for all binary files consisting in some headers followed by records with the same pattern.

Headers and record patterns are described in text files. Datasets are returned as Numpy arrays.


In this version, multiple record patterns are not supported.


At the beginning of your Python code, add the line:

 from ReadRawFile import *

then use the following instruction:

 hdrs, dsets = ReadRawFile(file, hdr_descs, rec_desc, big [, dset_names])


 file     : binary file to read
 hdr_descs: list of headers patterns description files
 rec_desc : record pattern description file
 big      : True if big-endian file, False otherwise
 dset_names: list of required dataset names (as defined in rec_desc);
  this argument can be omitted: in this case, all datasets are returned

A t-uple (hdrs, dsets) is returned, where hdrs and dsets are dictionnaries containing values for named variables of headers and record.



Sources can be downloaded here :


Package can be browsed here :




List prerequisites :

  • Python (2.5 ot higher)
  • Numpy (1.4 ot higher)


The module must lie in a directory that will be scanned when searching Python Liraries.

You can copy the module in such a directory or add the parent directory of the module in the PYTHONPATH environment variable; if you are using the bash shell, this can be done via the export command :

> export PYTHONPATH=<Module Directory>:$PYTHONPATH 


Copyright (C) 2010 Icare -

Bruno SIX,

This program is a free software; you can redistribute it and/or modify it under the terms of the CeCILL Public License as published by (License version 2 or later).

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL Public License for more details.

You should have received a copy of the CeCILL Public License along with this program; if not, please contact

For any questions or concerns regarding this program, or general information about the ICARE Project, please email to

Author(s): Bruno SIX (ICARE)