A most easy way is to set the units as comment to the dataset object:

http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-SetComment


An alternative is going to unicode and use the appropriate math character:

http://www.fileformat.info/info/unicode/char/2215/index.htm


Though actually I'd prefer to have HDF5 names of groups and datasets
to be free of reserver characters, though changing this established
behavior in the library now would probably break too many existing codes.


        Werner


On Thu, 01 Apr 2010 18:24:56 -0400, Mark Miller <[email protected]> wrote:
Hmm. '|' (better), '\' (backwards) '%' (integral mod) or ':' (ratio)
 or if you want to get verbose '.|.' which kinda looks like the ole'
character you find on most calculator keyboards but turned 90 degress.
Best I can think of.

Beware another developer's suggestion; you can store strings containing
slashes as the 'values' (and maybe even names) of attributes on your
dataset(s).

Mark

On Thu, 2010-04-01 at 14:56, Dr. X wrote:
Thanks, Mark. I thought the field name (const char *) is packaged
differently than the data tree. I am bumping my head to find an
alternative character to represent division intuitively. Any suggestions?

Best,
xunlei
On 4/1/2010 5:48 PM, Mark Miller wrote:
> Yes, I am pretty sure the slash character is used by HDF5 library to
> break up dataset names into group paths much like a unix filesystem
> does.
>
> I don't know if there is a way to tell HDF5 to use a different separator
> character for this purpose for a given file.
>
> Mark
>
> On Thu, 2010-04-01 at 14:42, Dr. X wrote:
>
>> Hi All,
>> I am trying
>>                hid_t dataset_id = H5Dcreate(group_frame_id, "mass
>> (GeV/(c^2))", std_type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
>> And the returned dataset_id = -1. If I changed the string to "mass
>> (GeV_(c^2))", I got a valid dataset_id.
>> Is "/" a special/reserved character in HDF5? Is there such a reserved
>> character list for HDF5?
>> Thanks so much.
>>
>> Best,
>> xunlei
>>
>>
>> _______________________________________________
>> Hdf-forum is for HDF software users discussion.
>> [email protected]
>> http://**mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
>>


_______________________________________________
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

Reply via email to