I have a .h5 file of size 128x128x64, hdf5read or h5read command is reading 64x128x128, I want MATLAB to read original size of the file, can you please help me?

조회 수: 8 (최근 30일)
data = h5read( 'Soln_700.00279.h5','/T')
or
file = hdf5info('Soln_700.00279.h5')
data_P = hdf5read(file.GroupHierarchy.Datasets(1))
I have tried above both commands, but MATLAB is reading the size in reverse I guess, but I do not know which column is x and y, except z that I know is of size 64. I would appreciate any help.
Thank you

답변 (1개)

Walter Roberson
Walter Roberson 2022년 7월 26일
You need to examine the hdf5info that is returned, looking at the dimensions information for file.GroupHierarchy.Datasets(1) to try to figure out which is x and which is y.
The most common arrangement in hdf5 files is x, y, z -- which is not the same as what MATLAB uses. MATLAB uses y, x, z so it is common to see something like
data_P = permute(data_P, [2 1 3]);
  댓글 수: 1
Vinay Tripathi
Vinay Tripathi 2022년 7월 26일
Hi, thank you for responding.
But here, I have 64 grids in z direction that is how I know 64 dimension is in z direction. but x and y I don't understand, given same number of grids in both the directions. Matlab is showing either z, x, y or z, y, x, that I still need help with!
here is the hdf5 info -
info =
struct with fields:
Filename: '\Soln_700.00279.h5'
Name: '/'
Groups: []
Datasets: [8×1 struct]
Datatypes: []
Links: []
Attributes: []
HDF5 Soln_700.00279.h5
Group '/'
Dataset 'P'
Size: 64x128x128
MaxSize: 64x128x128
Datatype: H5T_IEEE_F64LE (double)
ChunkSize: []
Filters: none
FillValue: 0.000000
Dataset 'T'
Size: 64x128x128
MaxSize: 64x128x128
Datatype: H5T_IEEE_F64LE (double)
ChunkSize: []
Filters: none
FillValue: 0.000000
Dataset 'Vx'
Size: 64x128x128
MaxSize: 64x128x128
Datatype: H5T_IEEE_F64LE (double)
ChunkSize: []
Filters: none
FillValue: 0.000000
Dataset 'Vy'
Size: 64x128x128
MaxSize: 64x128x128
Datatype: H5T_IEEE_F64LE (double)
ChunkSize: []
Filters: none
FillValue: 0.000000
Dataset 'Vz'
Size: 64x128x128
MaxSize: 64x128x128
Datatype: H5T_IEEE_F64LE (double)
ChunkSize: []
Filters: none
FillValue: 0.000000
Dataset 'X'
Size: 128
MaxSize: 128
Datatype: H5T_IEEE_F64LE (double)
ChunkSize: []
Filters: none
FillValue: 0.000000
Dataset 'Y'
Size: 128
MaxSize: 128
Datatype: H5T_IEEE_F64LE (double)
ChunkSize: []
Filters: none
FillValue: 0.000000
Dataset 'Z'
Size: 64
MaxSize: 64
Datatype: H5T_IEEE_F64LE (double)
ChunkSize: []
Filters: none
FillValue: 0.000000

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

카테고리

Help CenterFile Exchange에서 Text Files에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by