Error in hdfread (line 219)/ Error using hdfread>parseInput
7 views (last 30 days)
Show older comments
Augusto Gabriel da Costa Pereira
on 9 Sep 2023
Commented: Walter Roberson
on 9 Sep 2023
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 Comments
Accepted Answer
Walter Roberson
on 9 Sep 2023
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 Comments
Walter Roberson
on 9 Sep 2023
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"
More Answers (0)
See Also
Categories
Find more on HDF5 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!