hdf5 file read problem.

조회 수: 68 (최근 30일)
Mahdi
Mahdi 2015년 9월 24일
편집: per isakson 2015년 10월 2일
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.

채택된 답변

per isakson
per isakson 2015년 9월 26일
편집: per isakson 2015년 10월 2일
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
Mahdi
Mahdi 2015년 9월 28일
lol, can't believe I missed the space but that was it!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by