Werner,
I did not understand exactly what is this. Does it mean creating some
additional groups with names of units and making links to the data?
I worry it is too complicated especially for those who never saw the
data before and needs just take a quick look into the file they received?
Maybe I missed the point. Maybe h5dump would show more details?
Anton
> Anton,
>
> would something like the following do? HDF5 file and source code attached.
>
> It's not as elegant as the forthcoming method to have attributes directly
> at the compound type's members, but is some kind of workaround with the
> existing methods.
>
> Werner
>
>
> h5ls -rvd test.h5
> Opened "test.h5" with sec2 driver.
> / Group
> Location: 1:96
> Links: 1
> /data Dataset {5/5}
> Location: 1:1504
> Links: 1
> Storage: 80 logical bytes, 80 allocated bytes, 100.00% utilization
> Type: shared-1:1224 struct {
> "t" +0 native double
> "x" +8 native double
> } 16 bytes
> Data:
> (0) {1, 2}, {3, 4}, {1, 4}, {1, 5}, {5, 0}
> /meter Type
> Location: 1:800
> Links: 2
> Type: shared-1:800 native double
> /seconds Type
> Location: 1:1176
> Links: 2
> Type: shared-1:1176 native double
> /spatiotemporal Type
> Attribute: t {1}
> Type: shared-1:1176 native double
> Data: 0
> Attribute: x {1}
> Type: shared-1:800 native double
> Data: 0
> Location: 1:1224
> Links: 2
> Type: shared-1:1224 struct {
> "t" +0 native double
> "x" +8 native double
> } 16 bytes
>
>
>
> On Thu, 18 Mar 2010 11:40:10 -0500, Anton Kulchitsky <[email protected]>
> wrote:
>
>> Francesc,
>>
>> I think this is a really nice and elegant solution. Honestly, I am still
>> thinking of attributes as of simple strings. Now I see the advantage to
>> use other types. Thank you!
>>
>> I see just another problem with this though. Actually, what I really
>> want is attributes for the types, not the data! When attributes are
>> associated with data, this compound attribute need to be written every
>> time when I write data of this type. However, what I really need for
>> compound type are attributes of the type. Indeed, once fields are
>> described there is no need to repeat this every time I write the data
>> into a file.
>>
>> Anton
>>
>>> A Tuesday 16 March 2010 23:56:38 Anton Kulchitsky escrigué:
>>>> I would like to specify physical units and long names for every field of
>>>> a compound object. I have an array of particles. Each particle is
>>>> specified as a C structure with many fields associated with it. I would
>>>> like to have an attribute for every field. However, when I create a
>>>> compound object, I am not able to specify an attribute for a
>>>> field. I am wondering if anyone has similar problem?
>>>
>>> An elegant solution for this would be to write a compound type attribute,
>>> with
>>> the first field specifying the field to be described and the others with
>>> complementary info. For example, if you have a table with two fields, one
>>> possibility is to describe it with a `descr` attribute like:
>>>
>>> Attribute: descr {2}
>>> Type: struct {
>>> "fieldname" +0 10-byte null-terminated ASCII
>>> string
>>> "unit" +10 10-byte null-terminated ASCII
>>> string
>>> "expl" +20 60-byte null-terminated ASCII
>>> string
>>> "scale" +80 native double
>>> } 88 bytes
>>> Data: {"field1", "kg", "long explanatory field 1", 1.2},
>>> {"field2", "km/s", "long explanatory field 2", 24.3}
>>>
>>> This is simple and quite powerful, IMO.
>>
>> _______________________________________________
>> Hdf-forum is for HDF software users discussion.
>> [email protected]
>> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
>>
>
>
> --
> ___________________________________________________________________________
> Dr. Werner Benger Visualization Research
> Laboratory for Creative Arts and Technology (LCAT)
> Center for Computation & Technology at Louisiana State University (CCT/LSU)
> 211 Johnston Hall, Baton Rouge, Louisiana 70803
> Tel.: +1 225 578 4809 Fax.: +1 225 578-5362
>
>
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> [email protected]
> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
--
There is no place like $HOME
Anton Kulchitsky, PhD
HPC Specialist
University of Alaska Fairbanks,
Arctic Region Supercomputing Center
West Ridge Research Building
909 Koyukuk Drive, Suite 105
PO Box 756020 Fairbanks, AK 99775-6020
Tel. (907)450-8689 Fax. (907)450-8603
E-mail: [email protected]
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org