User Tools

Site Tools


wiki:weld_hdf

How to manipulate HDF with open source.

The HDF format is supported by GDAL and can be manipulated using scripting routines on a Linux machine.

Download the data

wget ftp://weldftp.cr.usgs.gov/CONUS/2011/monthly/month07/CONUS.month07.2011.h08v08.v1.5.hdf

It is possible to see the internal structure of the HDF format using gdalinfo

gdalinfo CONUS.month07.2011.h08v08.v1.5.hdf



You can extract an HDF WELD band and convert it into GeoTiff format:

gdal_translate HDF4_EOS:EOS_GRID:"CONUS.month07.2011.h08v08.v1.5.hdf":WELD_GRID:Band1_TOA_REF Band1_TOA_REF.tif 

You can do this for many bands:

for file in `gdalinfo CONUS.month07.2011.h08v08.v1.5.hdf | grep NAME | awk -F "=" '{print $2}'` ; do
   gdal_translate $file   ${file:65}.tif
done

Create a RGB composit

gdal_merge.py -separate  -o RGB_TOA_REF.tif    Band4_TOA_REF.tif Band3_TOA_REF.tif Band2_TOA_REF.tif

See the data with openev

openev RGB_TOA_REF.tif



wiki/weld_hdf.txt · Last modified: 2017/12/05 22:53 (external edit)