Module gpkimgclass
source code
This module is a python interface to the gpkio library.
That library can read in a variety of 2-dimensional image
types and multichannel audio data.
When used with a current version of the libgpkio library,
* it reads and writes in NASA FITS files that contain 2-D images
(these are used for astronomical data, typically
images from telescopes),
* it reads HTK HParm format files
(these are used for speech data and feature vectors
for the HTK Hidden Markov Model Toolkit,
for speech recognition systems),
* it reads and writes the NIST SPHERE speech data format
(though not all variants),
* it reads a header + data format called GPK ASCII Image
that I frequently use. (This format can
give you a completely ASCII data file, or have
a human-readable ASCII header followed by binary
data. It's designed for 2-D images and adapts well
to multichannel audio data.)
* it reads and writes the obsolete J. A. Tyson data format called FOCAS,
which is a binary format for 2-D astronomical images,
* it reads and writes an old AT&T speech data format called SIG
(used for speech data),
* it reads an old AT&T speech data format called ATTSSW
(used for speech data),
* it reads a data format called "EST" from the "Edinburgh
Speech Tools".
The code is designed to share an ontology, so that you can
read in one format and write the data in another format,
without the user needing to transform the header or data.
The code is designed to support data formats that have a
header that can store key=value strings, followed by a
1- or 2-dimensional data array.
Some of the data formats have fewer restrictions than FITS
as to the content of file headers: longer keys or attributes
may be allowed, and/or a wider variety of characters.
The module does its best not to lose header information,
but sometimes it must be re-keyed or truncated.
|
read(f)
Reads in a data file (f is the name) and returns a class gpk_img
object. |
source code
|
|
|
|
Imports:
types,
Num,
gpkimg
Reads in a data file (f is the name) and returns a class gpk_img
object. File names may end in .Z or .gz if the data is compressed.
Raises CannotReadDataFile if it does not recognize the file format.
|
Reads in a data file (f is the name) and returns a class gpk_img
object. File names may end in .Z or .gz if the data is compressed.
Raises CannotReadDataFile if it does not recognize the file format.
|