Read Hierarchical Data Format file
masoomjethwa

masoomjethwa @masoomjethwa

About: I am Planetary science Researcher, Opensource advocate and Python enthusiast.

Location:
India
Joined:
Dec 25, 2022

Read Hierarchical Data Format file

Publish Date: Dec 25 '22
0 0

HDF is a hierarchical data format developed by the National Center for Supercomputing Applications (NCSA)
to support Earth science data from NASA's Earth Observing System (EOS). The specific data structures that contain scientific data are: grid, swath, area average, and range.
Lets know how to open the file and read some important information.

import h5py
fname = r'MOP03J-20100801-L3V5.2.3.he5'
ff = h5py.File(fname, 'r')
Enter fullscreen mode Exit fullscreen mode

Studying the structure of the file by printing what HDF5 groups are present

for key in ff.keys():
    print(key)
Enter fullscreen mode Exit fullscreen mode

Names of the groups in HDF5 file.

Extracting the data

Get the HDF5 group

group = ff[key]
Enter fullscreen mode Exit fullscreen mode

Checkout what keys are inside that group.

for key in group.keys():
    print(key)
Enter fullscreen mode Exit fullscreen mode

Its my first post. Roast me.

Comments 0 total

    Add comment