HDF5 Table reading / writing for IDL [message #84325] |
Tue, 14 May 2013 05:52 |
markb77
Messages: 217 Registered: July 2006
|
Senior Member |
|
|
Hi,
I have written a library of IDL functions for reading, writing, and
modifying HDF5 tables. I essentially ported the source code from HDF5
itself, making use of the low level H5* functions which are already
implemented in IDL. The new library mimics the functionality of most
of the existing HDF5 Table API (H5TB).
The library is called wmb_lib, and it is available at GitHub, here:
www.github.com/superchromix
The main hdf5 table reading/writing functions in the library are:
Table creation:
wmb_h5tb_make_table.pro
Storage:
wmb_h5tb_append_records.pro
wmb_h5tb_write_records.pro
wmb_h5tb_write_fields_index.pro
wmb_h5tb_write_fields_name.pro
Retrieval:
wmb_h5tb_read_table.pro
wmb_h5tb_read_records.pro
wmb_h5tb_read_fields_index.pro
wmb_h5tb_read_fields_name.pro
Query:
wmb_h5tb_get_table_info.pro
wmb_h5tb_get_field_info.pro
Modification:
wmb_h5tb_insert_records.pro
wmb_h5tb_add_records_from.pro
wmb_h5tb_combine_tables.pro
Documentation and examples of how to use these functions can be found
in:
wmb_h5tb_examples.pro
Also, the HDF5 table functions are documented online here:
http://www.hdfgroup.org/HDF5/Tutor/h5table.html
http://www.hdfgroup.org/HDF5/doc/HL/RM_H5TB.html
Since the HDF5 Table API is based on HDF5 version 1.8, I was surprised
that it was possible to create this library at all using IDL's HDF5
interface functions (based on HDF5 version 1.6). There are some
limitations, however.
Limitations:
(as compared with the HDF5 Tables API in HDF5 version 1.8.10)
1. This library does not support fill values - if you want the table
automatically filled with something other than zeros you have to write
the fill data explicitly.
2. The library does not have a way to write to only one column of a
multi-column table. The wmb_h5tb_write_fields_* functions mimic this
functionality, but they do so by loading the full sized records from
the table, modifying the data in memory, and writing the full records
back to the table.
3. The size of a table cannot be reduced - i.e. records cannot be
deleted from a table.
4. Once a table is created, fields (columns) cannot be added or
removed.
At present it is not possible to view HDF5 Tables in the IDL HDF5 data
browser (H5_BROWSER). For viewing / editing tables therefore you can
use the free HDFView tool available here:
http://www.hdfgroup.org/hdf-java-html/hdfview/
I hope that this is useful and I would welcome comments, improvements,
bugfixes etc!
cheers,
Mark Bates
|
|
|