I thought I could know all about a dataset in one go.
Thanks a lot,
Dominik
···
On Friday 28 December 2007 16.28:30 Pedro Vicente Nunes wrote:
Hello
At 07:01 AM 12/28/2007, Dominik Szczerba wrote:
>Hi,
>1) Is it possible to know the rank of the dataset by a single call to
>H5LTget_dataset_info? I know this is possible with
> h5ltget_dataset_ndims_f, but I believe it should is also possible without
> it (otherwise it is returning a pointer to array of unknown size?)the corresponding C function is H5LTget_dataset_ndims.
check out the manual page athttp://www.hdfgroup.uiuc.edu/HDF5/doc_1.8pre/doc/HL/RM_H5LT.html
>2) is hsize_t* dims allocated by H5LTget_dataset_info or should be
>preallocated? (this is a general remark, this kind of information is
> missing on many manual pages).
>thanks a lot and best regards,it should be preallocated.
the typical usage is to get the rank with H5LTget_dataset_ndims, allocate a
buffer with the rank and then call H5LTget_dataset_infofor example
int rank;
hsize_t *dims;H5LTget_dataset_ndims (dset_id, "dset_name", &rank );
dims = malloc( rank );
H5LTget_dataset_info(file_id, "dset_name" ,dims,NULL,NULL);
free ( dims );
Pedro
>--
>Dominik Szczerba, Ph.D.
>Computer Vision Lab CH-8092 Zurich
>http://www.vision.ee.ethz.ch/~domiPedro Vicente Nunes
--------------------------------------------------------------
http://hdfgroup.org/
HDF5 tools main developer
phone: (217)-265-0311
pvn@hdfgroup.org
--
Dominik Szczerba, Ph.D.
Computer Vision Lab CH-8092 Zurich
http://www.vision.ee.ethz.ch/~domi
----------------------------------------------------------------------
This mailing list is for HDF software users discussion.
To subscribe to this list, send a message to hdf-forum-subscribe@hdfgroup.org.
To unsubscribe, send a message to hdf-forum-unsubscribe@hdfgroup.org.