Error in hdfread (line 219)/ Error using hdfread>parseInput
조회 수: 8 (최근 30일)
이전 댓글 표시
Augusto Gabriel da Costa Pereira
2023년 9월 9일
댓글: Walter Roberson
2023년 9월 9일
My goal is to insert the values from the .hdf file into X and Y; however, I'm encountering the error that I will insert shortly. Does anyone have an alternative solution? The link to the .hdf file is available on the drive link next to it: https://drive.google.com/drive/folders/18GgPs-iN3brZHQ3pZNK8GyLt4SOmemY8?usp=drive_link
I am using the following script:
clc
clear
close all
DirDSc=pwd; DirDMO='/home/augusto/Downloads';
cd(DirDMO); fn=dir('MCD19A2.A2010006.h13v09.061.2022327230416.hdf');
X = hdfread(fn.name, 'grid1km', 'Data_Fields', 'XDim');
Y = hdfread(fn.name, 'grid1km', 'Data_Fields', 'YDim');
and this error occurs:
Error using hdfread>parseInput 'Data_Fields' is not a recognized parameter. For a list of valid name-value pair arguments, see the documentation for this function.
Error in hdfread>dataSetInfo (line 366) params = parseInput(varargin(3:end));
Error in hdfread (line 219) [hinfo,params] = dataSetInfo(varargin{:});
댓글 수: 0
채택된 답변
Walter Roberson
2023년 9월 9일
For this purpose, I wrote a tool to recursively search structures and cells and objects looking for fieldnames or field contents that are the same as given strings.
The result is that... grid1km exists as a Vgroup name inside the file, but there is no XDmim or mod04 or Latitude
The named datasets for the grid1km Vgroup are "Optical_Depth_047" "Optical_Depth_055" "AOD_Uncertainty" "Column_WV" "AngstromExp_470-780" "AOD_QA" "FineModeFraction" "Injection_Height"
Your file does not have the data you expect
You also used hdfread() incorrectly, but it would not matter since the data you are looking for is not present.
댓글 수: 2
Walter Roberson
2023년 9월 9일
Tested:
filename = 'MCD19A2.A2010006.h13v09.061.2022327230416.hdf';
XD = hdfread(filename, 'XDim:grid1km');
OD47 = hdfread(filename, 'Optical_Depth_047');
XDim turned out to exist as part of names:
//Vgroup(1)/Vgroup(1)/SDS(1)/Dims(3)/Name -> XDim:grid1km
//Vgroup(1)/Vgroup(1)/SDS(2)/Dims(3)/Name -> XDim:grid1km
//Vgroup(1)/Vgroup(1)/SDS(3)/Dims(3)/Name -> XDim:grid1km
//Vgroup(1)/Vgroup(1)/SDS(4)/Dims(3)/Name -> XDim:grid1km
//Vgroup(1)/Vgroup(1)/SDS(5)/Dims(3)/Name -> XDim:grid1km
//Vgroup(1)/Vgroup(1)/SDS(6)/Dims(3)/Name -> XDim:grid1km
//Vgroup(1)/Vgroup(1)/SDS(7)/Dims(3)/Name -> XDim:grid1km
//Vgroup(1)/Vgroup(1)/SDS(8)/Dims(3)/Name -> XDim:grid1km
//Vgroup(2)/Vgroup(1)/SDS(1)/Dims(3)/Name -> XDim:grid5km
//Vgroup(2)/Vgroup(1)/SDS(2)/Dims(3)/Name -> XDim:grid5km
//Vgroup(2)/Vgroup(1)/SDS(3)/Dims(3)/Name -> XDim:grid5km
//Vgroup(2)/Vgroup(1)/SDS(4)/Dims(3)/Name -> XDim:grid5km
//Vgroup(2)/Vgroup(1)/SDS(5)/Dims(3)/Name -> XDim:grid5km
It can also be found (without the grid name) in //Attributes(2)/Value . It turns out that the defined dimension names for the grids are "Orbits", "XDim", and "YDim"
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 HDF5에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!