KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Using HDF5DotNet , can anyone point me at example code, which will open an hdf5 file, extract the contents of a dataset, and print the contents to standard output? So far I have the following: H5.Open(); var h5 = H5F.open("example.h5", H5F.OpenMode.ACC_RDONLY); var dataset = H5D.open(h5, "/Timings/aaPCBTimes"); var space = H5D.getSpace(dataset); var size = H5S.getSimpleExtentDims(space); Then it gets a bit confusing. I actually want to do some processing on the contents of the dataset but I think once I have dump to standard output I can work it out from there. UPDATE: I've hacked around this sufficient to solve my own problem. I failed to realise a dataset was a multi-array - I thought it was more like a db table. In the unlikely event anyone is interested, double[,] dataArray = new double[size[0], 6]; var wrapArray = new H5Array<double>(dataArray); var dataType = H5D.getType(d); H5D.read(dataset, dataType, wrapArray); Console.WriteLine(dataArray[0, 0]);
Tags (comma-separated)
Save Edits
Cancel