I am having some problems with the conversion from HDF to GeoTiff.

I am following the steps described in this webpage. The problem is that I can't find what is the NDVI subdataset name (XXXX) in order to run the gdaltranslate command.

gdal_translate -of GTiff HDF4_EOS:EOS_GRID:"MOD13C2.A2001001.005.2007078152825.hdf"
 :MOD_Grid_monthly_CMG_VI:XXXX modis_ndvi01.tif

This is the gdalinfo output for one of the files(MOD13C2.A2001001.005.2007078152825.hdf):

E:\GDAL>gdalinfo MOD13C2.A2001001.005.2007078152825.hdf
Driver: HDF4/Hierarchical Data Format Release 4
Files: MOD13C2.A2001001.005.2007078152825.hdf
Size is 512, 512
Coordinate System is `'
  REPROCESSINGPLANNED=further update is anticipated
  AUTOMATICQUALITYFLAGEXPLANATION=No automatic quality assessment is performed in the PGE
  SCIENCEQUALITYFLAGEXPLANATION=See http://landweb.nascom.nasa.gov/cgi-bin/QA_WWW/qaFlagPage.cgi?sat=terra for the product Science Quality status.


  SUBDATASET_1_NAME=HDF4_EOS:EOS_GRID:"MOD13C2.A2001001.005.2007078152825.hdf":MOD_Grid_monthly_CMG_VI:CMG 0.05 Deg Monthly NDVI
  SUBDATASET_1_DESC=[3600x7200] CMG 0.05 Deg Monthly NDVI MOD_Grid_monthly_CMG_VI (16-bit integer)
  SUBDATASET_2_NAME=HDF4_EOS:EOS_GRID:"MOD13C2.A2001001.005.2007078152825.hdf":MOD_Grid_monthly_CMG_VI:CMG 0.05 Deg Monthly EVI
  SUBDATASET_2_DESC=[3600x7200] CMG 0.05 Deg Monthly EVI MOD_Grid_monthly_CMG_VI (16-bit integer)
  SUBDATASET_3_NAME=HDF4_EOS:EOS_GRID:"MOD13C2.A2001001.005.2007078152825.hdf":MOD_Grid_monthly_CMG_VI:CMG 0.05 Deg Monthly VI Quality
  SUBDATASET_3_DESC=[3600x7200] CMG 0.05 Deg Monthly VI Quality MOD_Grid_monthly_CMG_VI (16-bit unsigned integer)
  SUBDATASET_4_NAME=HDF4_EOS:EOS_GRID:"MOD13C2.A2001001.005.2007078152825.hdf":MOD_Grid_monthly_CMG_VI:CMG 0.05 Deg Monthly red reflectance
  SUBDATASET_4_DESC=[3600x7200] CMG 0.05 Deg Monthly red reflectance MOD_Grid_monthly_CMG_VI (16-bit integer)
  SUBDATASET_5_NAME=HDF4_EOS:EOS_GRID:"MOD13C2.A2001001.005.2007078152825.hdf":MOD_Grid_monthly_CMG_VI:CMG 0.05 Deg Monthly NIR reflectance
  SUBDATASET_5_DESC=[3600x7200] CMG 0.05 Deg Monthly NIR reflectance MOD_Grid_monthly_CMG_VI (16-bit integer)
  SUBDATASET_6_NAME=HDF4_EOS:EOS_GRID:"MOD13C2.A2001001.005.2007078152825.hdf":MOD_Grid_monthly_CMG_VI:CMG 0.05 Deg Monthly blue reflectance
  SUBDATASET_6_DESC=[3600x7200] CMG 0.05 Deg Monthly blue reflectance MOD_Grid_monthly_CMG_VI (16-bit integer)
  SUBDATASET_7_NAME=HDF4_EOS:EOS_GRID:"MOD13C2.A2001001.005.2007078152825.hdf":MOD_Grid_monthly_CMG_VI:CMG 0.05 Deg Monthly MIR reflectance
  SUBDATASET_7_DESC=[3600x7200] CMG 0.05 Deg Monthly MIR reflectance MOD_Grid_monthly_CMG_VI (16-bit integer)
  SUBDATASET_8_NAME=HDF4_EOS:EOS_GRID:"MOD13C2.A2001001.005.2007078152825.hdf":MOD_Grid_monthly_CMG_VI:CMG 0.05 Deg Monthly Avg sun zen angle
  SUBDATASET_8_DESC=[3600x7200] CMG 0.05 Deg Monthly Avg sun zen angle MOD_Grid_monthly_CMG_VI (16-bit integer)
  SUBDATASET_9_NAME=HDF4_EOS:EOS_GRID:"MOD13C2.A2001001.005.2007078152825.hdf":MOD_Grid_monthly_CMG_VI:CMG 0.05 Deg Monthly NDVI std dev
  SUBDATASET_9_DESC=[3600x7200] CMG 0.05 Deg Monthly NDVI std dev MOD_Grid_monthly_CMG_VI (16-bit integer)
  SUBDATASET_10_NAME=HDF4_EOS:EOS_GRID:"MOD13C2.A2001001.005.2007078152825.hdf":MOD_Grid_monthly_CMG_VI:CMG 0.05 Deg Monthly EVI std dev
  SUBDATASET_10_DESC=[3600x7200] CMG 0.05 Deg Monthly EVI std dev MOD_Grid_monthly_CMG_VI (16-bit integer)
  SUBDATASET_11_NAME=HDF4_EOS:EOS_GRID:"MOD13C2.A2001001.005.2007078152825.hdf":MOD_Grid_monthly_CMG_VI:CMG 0.05 Deg Monthly #1km pix used
  SUBDATASET_11_DESC=[3600x7200] CMG 0.05 Deg Monthly #1km pix used MOD_Grid_monthly_CMG_VI (8-bit unsigned integer)
  SUBDATASET_12_NAME=HDF4_EOS:EOS_GRID:"MOD13C2.A2001001.005.2007078152825.hdf":MOD_Grid_monthly_CMG_VI:CMG 0.05 Deg Monthly #1km pix +-30deg VZ
  SUBDATASET_12_DESC=[3600x7200] CMG 0.05 Deg Monthly #1km pix +-30deg VZ MOD_Grid_monthly_CMG_VI (8-bit unsigned integer)
  SUBDATASET_13_NAME=HDF4_EOS:EOS_GRID:"MOD13C2.A2001001.005.2007078152825.hdf":MOD_Grid_monthly_CMG_VI:CMG 0.05 Deg Monthly pixel reliability
  SUBDATASET_13_DESC=[3600x7200] CMG 0.05 Deg Monthly pixel reliability MOD_Grid_monthly_CMG_VI (8-bit integer)
  • 1
    What happens if you try the full name 'HDF4_EOS:EOS_GRID:"MOD13C2.A2001001.005.2007078152825.hdf":MOD_Grid_monthly_CMG_VI:CMG 0.05 Deg Monthly NDVI' as input?
    – Chethan S.
    Commented Apr 21, 2013 at 13:29
  • @Chethan S. My apologies Chethan. I didn't see your comment when I posted my answer. If you would like to post your comment as an answer, I will go ahead and delete mine.
    – Cyrus
    Commented Apr 21, 2013 at 13:41
  • No worries Cyrus, I am still not sure if it works. I liked your answer and upvoted it too. So please do not delete it. :)
    – Chethan S.
    Commented Apr 21, 2013 at 13:48
  • 2
    Thanks guys! Didn't work exactly how you suggested but it was close: gdal_translate -of GTiff HDF4_EOS:EOS_GRID:"MOD13C2.A2001001.005.2007078152825.hdf":MOD_Grid_monthly_CMG_VI:"CMG 0.05 Deg Monthly NDVI" ndvi.tiff
    – Gago-Silva
    Commented Apr 21, 2013 at 13:54
  • 1
    @A.R I took another look at the link that you posted in your question and noticed that it mentions FWTools. I tested the method that Chethan and I suggested on Ubuntu and it worked okay, but I didn't test it with FWTools on Windows. Maybe the input name gets parsed a bit differently using FWTools? In any case, I'm glad you found a solution. I use FWTools at work sometimes and I'm sure I will refer back to your answer sooner or later. Thanks.
    – Cyrus
    Commented Apr 21, 2013 at 15:57

1 Answer 1


I think you almost have it. Be sure to add single quotes around the entire input name with double quotes around the hdf file name.

gdal_translate -of GTiff 'HDF4_EOS:EOS_GRID:"MOD13C2.A2001001.005.2007078152825.hdf":MOD_Grid_monthly_CMG_VI:CMG 0.05 Deg Monthly NDVI'

Hope that helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.