Dipu
Dipu

Reputation: 123

How to read and extract a attribute data from HE5 (HDF5) dataset in R

The dataset contains following groups with different attribute data. How can i extract and plot the attribute number 8 with latitude longitude using the packages 'rhdf5','rgdal' and 'raster'?

8  /HDFEOS/GRIDS/ColumnAmountNO2/Data Fields              ColumnAmountNO2Trop H5I_DATASET  FLOAT 1440 x 720

h5ls("D:/NO2/NO2 Data/2008/1Jan/OMI-Aura_L3-OMNO2d_2008m0101_v003-2018m0626t175046.he5")

                                       group                             name       otype dclass        dim
0                                          /                           HDFEOS   H5I_GROUP                  
1                                    /HDFEOS                       ADDITIONAL   H5I_GROUP                  
2                         /HDFEOS/ADDITIONAL                  FILE_ATTRIBUTES   H5I_GROUP                  
3                                    /HDFEOS                            GRIDS   H5I_GROUP                  
4                              /HDFEOS/GRIDS                  ColumnAmountNO2   H5I_GROUP                  
5              /HDFEOS/GRIDS/ColumnAmountNO2                      Data Fields   H5I_GROUP                  
6  /HDFEOS/GRIDS/ColumnAmountNO2/Data Fields                  ColumnAmountNO2 H5I_DATASET  FLOAT 1440 x 720
7  /HDFEOS/GRIDS/ColumnAmountNO2/Data Fields     ColumnAmountNO2CloudScreened H5I_DATASET  FLOAT 1440 x 720
8  /HDFEOS/GRIDS/ColumnAmountNO2/Data Fields              ColumnAmountNO2Trop H5I_DATASET  FLOAT 1440 x 720
9  /HDFEOS/GRIDS/ColumnAmountNO2/Data Fields ColumnAmountNO2TropCloudScreened H5I_DATASET  FLOAT 1440 x 720
10 /HDFEOS/GRIDS/ColumnAmountNO2/Data Fields                           Weight H5I_DATASET  FLOAT 1440 x 720
11                                         /               HDFEOS INFORMATION   H5I_GROUP                  
12                       /HDFEOS INFORMATION                 StructMetadata.0 H5I_DATASET STRING      ( 0 )

I used the following command to read the attribute within a group but it shows error

E = h5read("D:/NO2/NO2 Data/2008/1Jan/OMI-Aura_L3-OMNO2d_2008m0101_v003-2018m0626t175046.he5","HDFEOS/GRIDS/ColumnAmountNO2/Data Fields/ColumnAmountNO2Trop")
Warning message:
In h5checktypeOrOpenLoc(file, readonly = TRUE, native = native) :
  An open HDF5 file handle exists. If the file has changed on disk meanwhile, the function may not work properly. Run 'h5closeAll()' to close all open HDF5 object handles.

Any help would be appreciated. Thanks

Upvotes: 3

Views: 836

Answers (0)

Related Questions