Hi,
i'm not quite sure that i understand your question?
You are trying to:
1. write part of a compound datatype. - "the ability to write part of a
compound datatype, rather than all of it in one go."
2. write part of a dataset. - "but none that obviously
give me a mechanism for selecting what part of the dataset is to be
written."
As to the first one, i'm not familiar with a way to do it. (Maybe there is
a way, i don't know)
The second one:
The signature of the H5Dwrite function is:
herr_t H5Dwrite(hid_t dataset_id, hid_t mem_type_id, hid_t mem_space_id,
hid_t file_space_id, hid_t xfer_plist_id, const void * buf )
In order to specify which part of the dataset is the passed data referenced
by the buf pointer (essentially where in the dataset to store the provided
data), you should call
herr_t H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t
*start, const hsize_t *stride, const hsize_t *count, const hsize_t *block )
before H5Dwrite with the same space_id argument as file_space_id
in H5Dwrite.
Eexample:
Assuming you want to store an array([500]) of compound datatype
(structures) from the beginning of the dataset to the 500th element.
// Create file_space, mem_space, mem_type, dataset, etc.
hsize_t start = 0;
hsize_t stride = 0;
hsize_t count = 500;
hsize_t block = 0;
H5Sselect_hyperslab( file_space_id, H5S_SELECT_SET, &start, &stride,
&count, &block );
H5Dwrite( dataset_id, mem_type_id, mem_space_id, file_space_id,
xfer_plist_id, data );
More info about H5Sselect_hyperslab at:
http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectHyperslab
Best Regards,
V. Daskalov
I'd like to pursue a particular detail of the compound datatype thread
from yesterday. Specifically, the ability to write part of a compound
datatype, rather than all of it in one go. I've spent some time today
trying to figure out what's involved, but haven't got a clear idea. I'm
assuming that the writing would be accomplished by calling H5Dwrite and
passing it the id of a dataset created using H5Dcreate2() - (I'm cribbing
from the listing of the sample program h5_compound). H5Dwrite() has a
variety of arguments, but none that obviously give me a mechanism for
selecting what part of the dataset is to be written. I've got a couple of
guesses:
1. there's some work to be done on the dataset prior to the write that
selects what is supposed to be written, or
2. the property list argument can somehow convey the information.
Any guidance would be gratefully received.
-Josiah
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
···
On 18 July 2013 00:13, Josiah Slack <josiahnmi@gmail.com> wrote: