I recently got hold of h5 files (Hierarchical Data Format (HDF)) and I tried to load them into QGIS and they were drawing in the wrong places.This was because they were were not georeferenced. I set out to georeference them using gdal. Since I was dealing with many h5 files I searched for an automated way to georeference them and could not find one complete solution hence I decided to do it myself with the help of Tim Sutton.
The following script is the one I used to automate georeferencing h5 files in Ubuntu 16.04.
I copied the script and saved it as reproject_h5.sh and made it executable in bash. I then ran the script as
./reproject_h5.sh MER_FSG.h5. You can also run the script by looping through a text file that contains filenames for the h5 rasters.