NCSU-Libraries / data-science-cookbook

MIT License
6 stars 1 forks source link

Code snippet to convert HDF5 to TIFF #8

Open eternalscholar opened 3 years ago

eternalscholar commented 3 years ago

The following Colab notebook includes a code snippet that I created to convert an HDF5 file to a TIFF file. Converting an HDF file to one or more TIFF files is necessary for visualization and/or spatial analysis of the data within GIS softwares/packages.

This particular code snippet uses data from the Global Fire Emissions Database (https://www.geo.vu.nl/~gwerf/GFED/GFED4/) and converts the data for the month of June into a TIFF file.

https://colab.research.google.com/drive/1OHmjAacJZW7rlmSGR73D1pJo8Mppf2G3?usp=sharing

The above notebook was created last semester to help a patron.

mikenutt commented 3 years ago

@eternalscholar I'm not familiar with HDF5. When is that format used?

eternalscholar commented 3 years ago

@mikenutt Hierarchical Data Format (HDF) is designed to store large volumes of data. This is commonly used in the fields of atmospheric sciences, meteorological sciences etc. To give you an example, a single HDF file could be used to store the atmospheric pressure data of Raleigh at 10m X 10m resolution, from earth's surface to 1km high into the atmosphere in 100m intervals, at time intervals of half-an-hour for 365 days (that's a lot of data!).

mikenutt commented 3 years ago

@eternalscholar It looks like there are other solutions that use gdal_translate...this sounds like it could be useful, but is there a particular problem you were trying to solve instead of using other methods, e.g., https://www.igismap.com/convert-hdf5-to-geotiff/ ? If so, it might be good to use a readme file to highlight the reason why your code uses a different approach or what problem it solves.

tytystot commented 1 year ago

@eternalscholar How could I modify your script to iterate over all hdf5s in a folder? This is a fantastic resource though I unfortunately have 268 files so some kind of iteration would be great. Thanks!

srikar-iist commented 5 months ago

Hi, is there any code or convert to convert tiff format to hdf5