User Tools

Site Tools


wiki:weld_hdf

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

wiki:weld_hdf [2017/12/05 22:53] (current)
Line 1: Line 1:
 +====== 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
 +<code bash>
 +wget ftp://​weldftp.cr.usgs.gov/​CONUS/​2011/​monthly/​month07/​CONUS.month07.2011.h08v08.v1.5.hdf
 +</​code>​
 +It is possible to see the internal structure of the HDF format using gdalinfo
 +<code bash>
 +gdalinfo CONUS.month07.2011.h08v08.v1.5.hdf
 +</​code>​
 +\\
 +|{{:​wiki:​hdf_gdalinfo.png?​800}}|\\
 +\\
 +You can extract an HDF WELD band and convert it into GeoTiff format:
 +<code bash>
 +gdal_translate HDF4_EOS:​EOS_GRID:"​CONUS.month07.2011.h08v08.v1.5.hdf":​WELD_GRID:​Band1_TOA_REF Band1_TOA_REF.tif ​
 +</​code>​
 +You can do this for many bands: ​
 +<code bash>
 +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
 +</​code>​
 +Create a RGB composit ​
 +<code bash>
 +gdal_merge.py -separate ​ -o RGB_TOA_REF.tif ​   Band4_TOA_REF.tif Band3_TOA_REF.tif Band2_TOA_REF.tif
 +</​code>​
 +See the data with openev
 +<code bash>
 +openev RGB_TOA_REF.tif
 +</​code>​
 +\\
 +|{{:​wiki:​rgb_openev.png?​700}}|\\
 +\\
  
wiki/weld_hdf.txt ยท Last modified: 2017/12/05 22:53 (external edit)