A Wednesday 09 March 2011 11:08:28 Michael Rissi escrigué:
> Hello Pytablers,
> 
> In our readout software for a PET scanner, I write the data to an
> HDF5 array of compound datatypes (in C++).
> When I want to read this table in ipython with pytables, I get the
> message:
> 
> 
> In [11]:  import tables
> 
> In [11]: f=tables.openFile("Events_0012.h5")
> 
> In [12]: f.root.dset
> /usr/local/lib/python2.6/dist-packages/tables/path.py:102:
> NaturalNameWarning: object name is not a valid Python identifier:
> 'ToT '; it does not match the pattern ``^[a-zA-Z_][a-zA-Z0-9_]*$``;
> you will not be able to use natural naming to access this object;
> using ``getattr()`` will still work, though
>   NaturalNameWarning )
> /usr/local/lib/python2.6/dist-packages/tables/group.py:1215:
> UserWarning: problems loading leaf ``/dset``::
> 
>   table ``/dset``, column ``hits``: data type not understood
> 
> The leaf will become an ``UnImplemented`` node.
>   % (self._g_join(childName), exc))
> Out[12]:
> /dset (UnImplemented(16384,)) ''
>   NOTE: <The UnImplemented object represents a PyTables unimplemented
>          dataset present in the 'Events_0012.h5' HDF5 file.  If you
> want to see this
>          kind of HDF5 dataset implemented in PyTables, please contact
> the developers.>
> 
> 
> I also attached the C++ code which writes the table.
> Should I write the HDF5 file in a different way in order to read the
> data with pytables?

I've been looking at your table description, and the ``hits`` column is 
an array of compound types, and this is currently unsupported in 
PyTables.

What you can do is to create the fields of the array in the ``hits`` 
column at the top-level table description.  Or, if you still want to set 
these fields apart, you can create them as nested fields of ``hits`` 
(that is, ``hits`` will become a compound of compounds), which is fully 
supported.

Hope this helps,

-- 
Francesc Alted

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to