hdf5 file read problem.

68 vues (au cours des 30 derniers jours)
Mahdi
Mahdi le 24 Sep 2015
Modifié(e) : per isakson le 2 Oct 2015
Hi, I have a series of cgns files which I want to process in Matlab. I use a command of cgnstools in linux named adf2hdf and also cgnsconvert to convert the cgns files into hdf5 files. I can get the structures with h5info and h5disp, but when I want to use h5read it complains with following error:
Error using h5readc
The HDF5 library encountered an error and produced the following stack trace information:
H5Dopen2 not a dataset
Error in h5read (line 59)
[data,var_class] = h5readc(Filename,Dataset,start,count,stride);
A sample file has been attached. I had to change the extension to png so I can upload it. After download you can change it back to hdf5 but it doesn't really matter for Matlab.

Réponse acceptée

per isakson
per isakson le 26 Sep 2015
Modifié(e) : per isakson le 2 Oct 2015
I would call this a practical joke. There is a leading space in the names of the datasets. (Caveat: This is the first time I encounter the CFD General Notation System.)
You didn't tell what you tried to read, however, try
>> num = h5read( 'h:\m\cssm\xy.h5', '/ format' )'
num =
73 69 69 69 95 76 73 84 84 76 69 95 51 50 0
and
>> num = h5read( 'h:\m\cssm\xy.h5', '/xyplane/sidesplane/ZoneType/ data' )'
num =
85 110 115 116 114 117 99 116 117 114 101 100
This is an excerpt of a h5disp output.
  1 commentaire
Mahdi
Mahdi le 28 Sep 2015
lol, can't believe I missed the space but that was it!

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by