help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hdf5 support for more complex structures


From: Przemek Klosowski
Subject: Re: hdf5 support for more complex structures
Date: Thu, 23 Jan 2003 17:08:42 -0500 (EST)

   With octave 2.1.43, it looks like I can just about read in most of the
   actual blocks of numbers, but everything else is of unknown datatypes.

I am interested in HDF5 support for octave. Could you say what is the
issue with reading your control structures? Octave basically has only
double precision arrays, and strings, but that in itself shouldn't be
a problem. The basic types can be combined into structures, and I always
imagined that there could be a mapping between octave structures and
HDF hierarchy. Do you think it might work? There are some issues with
encoding the dataset attributes:

example: HDF file
  data group X
   data element xxx (1 2 3 ; 4 5 6)  attributes (units: kilogram) 
   data group Y
    data element zzz (1 3 5)  attributes (date: "20030122T085959") 
   
might map to 

   File.X.xxx=[1 2 3 ; 4 5 6]
   File.X._attributes_.xxx.units="kilogram"
   File.X.Y.zzz = [ 1 3 5]
   File.X.Y._attributes_.xxx.date="20030122T085959"

This approach is a little grotty---I can't see a nice way of both
simply getting at the data via the simple path name (File.X.xxx,
rather than something like File.X.xxx.data) and having simple name for
attributes, because you can't have data in File.X.xxx and attributes
in, say, File.X.xxx.units. Still, this is not too bad, because Octave
can introspect: "struct_elements(File)" and "for [val,elem]=File ..."
could be used to find out if there are attributes, and match them with
data. Unfortunately, the dataset (i.e. data and attributes) aren't
atomic this way; if we wanted atomic, we'd need to go to xxx.data and
xxx.attributes.

BTW, multidimensional objects at present can be written as cells,
unless there's a better multi-dim approach

       a={[1 2 ; 3 4],[3 4 ; 5 6]; [1 3 ; 2 4],[8 9; 9 7]}


        



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]