Opening Maiac HDFs

would it be possible to have an example of loading one of the Maiac HDFs provided and the environment used? I seem to have issues with them with both xarray and h5py.

The MAIAC data is provided in HDF4 format, so unfortunately h5py won’t work as it only supports HDF5. xarray could work if you installed it with the pynio backend (note: this will be deprecated soon, if not already).

Alternatively, you can use pyhdf. There’s a bit of an outdated example of reading it in here. We’ll be publishing an updated version of this soon that should include additional helpful snippets.

Lastly, gdal also supports hdf4. You can read it in with something like:

from osgeo import gdal

file = gdal.Open(filepath)
subdatasets = file.GetSubDatasets()

How exactly should be the format for filepath?? It would be of great help if any of you could assist!!!

1 Like