hi Folks

I have an hdf5 file created by another application that I wish to read into 
python via pytables. I'm an hdf5 novice and basically want to remain so ...  
I'm also a pytables novice, but am happy to learn a bit more since python is 
my addiction of choice.

After mucking around with h5dump I can see the file has some groups in it, and 
each group has some ATTRIBUTES which are strings.

Each group also has some DATASETS in it, and each dataset has a simple 
dataspace (i.e. a standard array) and some attributes (which are the names of 
the variables held in the arrays).

I'm finding it hard to get started from the documentation which is based 
around creating and reading pytables files in hdf, whereas what I'm trying to 
do is introspect the file ...

Anyway, this is my starting script:
import tables
f='blah.hdf'
ff=tables.openFile(f)
for a in ff:
        try:
                print a
                print type(a)
                print a.getAttr()
                x=a.attrs._f_list('all')
        except: pass

So you can see I'm just trying to bootstrap some info about these things. the 
output of that script looks like this:

UserWarning: file ``blah.hdf`` exists and it is an HDF5 file, but it does not 
have a PyTables format; I will try to do my best to guess what's there using 
HDF5 metadata
  METADATA_CACHE_SIZE, nodeCacheSize)
/ (RootGroup) ''
<class 'tables.Group.RootGroup'>
/DATA (Group) ''
<class 'tables.Group.Group'>
/GEO (Group) ''
<class 'tables.Group.Group'>
/DATA/X (CArray(72L, 144L), zlib(6)) ''
<class 'tables.CArray.CArray'>
/DATA/Y (CArray(3L, 72L, 144L), zlib(6)) ''

So my questions is rather simple: how do I get at the group and dataset 
attributes in pytables? I know this ought to be obvious, so feel free to 
point me to the right page in the manual ...

Thanks in advance,
Bryan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to