I downloaded the MODIS images with HDF format from NASA EOSDIS Reverb website. And I am trying to project MOD09GQ from Sinusoidal to WGS84 using gdalwarp with Python. However, the DN value range (data type) in the output Geotiff after projecting MODIS using gdalwarp with python has been changed.

gdalwarp -of GTIFF -r near -t_srs EPSG:4326 -ot Float32 HDF4_EOS:EOS_GRID:"MOD09GQ.A2014279.h11v02.006.2015291113528.hdf":MODIS_Grid_2D:sur_refl_b01_1 20142792.tif
0...10...20...30...40...50...60...70...80...90...100 - done.

enter image description here I used the above code. And I also projected the image using the MCTK of ENVI. The DN value range of the image which has processed by the MCTK is same with the original image. The DN value of the image which was processed by GDALwarp has been changed from [0,1.15] to [112,11422]. But, I set up the data type of the output Geotiff to float 32-ot Float32. Moreover, I have tried to set up -ot Int16 (is same with original data type of Modis). Its DN value range still was changed.

How do I keep the original DN value range (data type) after projecting MODIS using gadlwarp?

  • If the original range is [0,0.30] it either can't be Int16 or then there is also scaling involved. Check the min/max/std.dev values with gdalinfo -stats.
    – user30184
    Commented Oct 30, 2017 at 21:21
  • See the answer below as well - the MCTK is showing a "normalized" raster (meaning on a scale of 0 to 1). 16-bit data means each pixel has a whole-number value, with 2^16 possible values (or about 65,000). MODIS docs say the values should be in the 0-16000 range, so the gdalwarp reprojection looks accurate here.
    – AlecZ
    Commented Oct 30, 2017 at 21:56

1 Answer 1


MODIS raw data comes in integer values. Check product documentation

MCTK reprojects and applies scale factors. From MCTK user manual:

If scale and offset factors are present for a particular dataset, they are automatically applied during the conversion process

If you check products supported, you'll find MOD09GQ. So, the result is a scene with scale factor applied (0.0001).

gdal_warp only reprojects data. So the result will have the same datatype from the input (integer values).

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.