0

I have imported the following libraries to access the data sets from a HDF4 file in Python 2.7

from pyhdf.SD import SD, SDC

hdf = SD(FILE_NAME, SDC.READ)
hdf.datasets()

While I don't have any issues in accessing the contents of the data sets, I am unable to access the metadata.

I have earlier accessed the metadata in MATLAB using the following commands:

metadata = hdfread(infile, '/metadata', 'Fields', 'Lidar_Data_Altitudes', 'FirstRecord',1 ,'NumRecords',1)

alts = metadata{1}

What are the equivalent commands in Python for accessing the metadata fields from a HDF file in Python?

Madhavan
  • 49
  • 1
  • 2
  • 11
  • Possible duplicate of [could not figure out how to read the metadata](https://stackoverflow.com/questions/26559319/could-not-figure-out-how-to-read-the-metadata) – Joe May 22 '19 at 08:46
  • https://www.science-emergence.com/Articles/How-to-read-a-MODIS-HDF-file-using-python-/ – Joe May 22 '19 at 08:48

0 Answers0