Hello, Cecilia
>I would like to export large amounts of data in one file. The data variables >can be of different types; but it is not known beforehand what they are. I saw >examples where the Compound data type was used with a pre-defined "struct". In >this case, I cannot >pre-define my struct. I can ofcourse make everything >string, but I want to take advantage of the faster speed of writing other >types. How should I approach the problem? Do you have available examples? It >would also be nice to make use of the H5NX library >of Pedro Vicente for >faster speed, but I deal with 2D matrices and different data types. It's not clear to me, from your description, the nature of the problem you're trying to solve. If you send further details I'll be glad to help. Regarding the use of H5NX, this page http://www.space-research.org/nexus/h5nx.html has both links for H5NX User's Guide Detailed guide covering critical H5NX features H5NX Reference Manual Detailed C++ interface descriptions >> but I deal with 2D matrices and different data types. The H5NX function H5NXmake_dataset_vector deals with any rank, that is, you can use it to define a 1D array, a 2D array, etc. Just put your data values into a std::vector of any type and define the dimensions in a std::vector<hsize_t> If the size of this dimension vector is, say 2, then you have a matrix, or a 2D array. Since this is C++, there is no need for an extra parameter to the function with the size of the dimension vector (the rank) int H5NXmake_dataset_vector(const std::string &group_path, const std::string &dataset_name, const std::vector<NumT> &vec, const std::vector<hsize_t> &dim_vec); The only function that currently deals exclusively with a 1D array is H5NXappend_slab Regarding the types, I am currently defining it for other types, I'll upload a new version when done. H5NX uses the HDF5 native types corresponding to the C99 fixed width integer types plus the HDF5 string type, used in the "string" functions int8_t uint8_t int16_t uint16_t int32_t uint32_t int64_t uint64_t float double but not all API functions have templates for all types. What are your needs regarding these types and functions ? Pedro ------ Pedro Vicente, Earth System Science University of California, Irvine http://www.ess.uci.edu/ ----- Original Message ----- From: Cecilia Herrera To: '[email protected]' Sent: Monday, March 11, 2013 2:26 AM Subject: [Hdf-forum] Different data types I would like to export large amounts of data in one file. The data variables can be of different types; but it is not known beforehand what they are. I saw examples where the Compound data type was used with a pre-defined "struct". In this case, I cannot pre-define my struct. I can ofcourse make everything string, but I want to take advantage of the faster speed of writing other types. How should I approach the problem? Do you have available examples? It would also be nice to make use of the H5NX library of Pedro Vicente for faster speed, but I deal with 2D matrices and different data types. Thanks for the help! ------------------------------------------------------------------------------ _______________________________________________ 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
