1

I am trying to make a rgb map of MODIS data (Dataset09 Radiances) with QGIS.

First I converted it to tif with gdal (and python). Since I did not really understand all of GDALs funcionality I used a lot of temp. results:

gdal_merge.py -v -o band1.tif HDF4_EOS:EOS_GRID:MOD09GA.A2001244.h20v11.005.2008275152329.hdf:MODIS_Grid_500m_2D:sur_refl_b01_1 HDF4_EOS:EOS_GRID:MOD09GA.A2001244.h20v12.005.2008275162824.hdf:MODIS_Grid_500m_2D:sur_refl_b01_1
gdal_merge.py -v -o band3.tif HDF4_EOS:EOS_GRID:MOD09GA.A2001244.h20v11.005.2008275152329.hdf:MODIS_Grid_500m_2D:sur_refl_b03_1 HDF4_EOS:EOS_GRID:MOD09GA.A2001244.h20v12.005.2008275162824.hdf:MODIS_Grid_500m_2D:sur_refl_b03_1
gdal_merge.py -v -o band4.tif HDF4_EOS:EOS_GRID:MOD09GA.A2001244.h20v11.005.2008275152329.hdf:MODIS_Grid_500m_2D:sur_refl_b04_1 HDF4_EOS:EOS_GRID:MOD09GA.A2001244.h20v12.005.2008275162824.hdf:MODIS_Grid_500m_2D:sur_refl_b04_1

gdal_merge.py -separate band1.tif band4.tif band3.tif -o MOD09GA.A2001244-allBands-noRepro.tif

I also did some reprojection:

gdalwarp -of GTIFF -t_srs EPSG:4326 MOD09GA.A2001244-allBands-noRepro.tif warpRepro.tif

If I load the result into QGIS every pixel has a different color, but similar values do not have similar colors. (The picture reminds me of the "ant-wars" or "blizzard" or "static noise" in old TVs, when there was no signal) I googled a bit and read that QGIS can only display Rasters with values between 0 and 255. I tried scaling, similar to:

gdal_translate -scale -ot Byte band1.tif band1rescale.tif

If I load the new scaled and merged tif in QGIS, the result is a rgb image but the colors look too weak (brightness and contrast seems off. i think in a photosoftware I would solve the problem with an histogramm normalization (equalization???) )

Maybe somebody here knows a solution?


I also wrote my own normalization in python, but with the same result. The snow on the scene is super bright and all the other ground is dark and undistinguishable.

  • Did you use the scale factor of 0.0001 for the individual images? – xunilk Apr 14 '15 at 8:28
2

You can do the complete procedure perfectly in QGIS (GDAL has HDF4/HDF5 support) without previous reprojection. You have to load all corresponding sub sets at the Map Canvas (sinusuoidal projection by default) and, by using the raster calculator, each image must be multiplied by the scale factor of 0.0001 (Table 2 of http://www.gscloud.cn/userfiles/file/MOD09_UserGuide.pdf). Afterward, by using Raster -> Miscellaneous -> Merge menu option, you can stack the images as a rgb map. Later, the layer stack can be saved as reprojected *.tif with Raster -> Conversion -> Translate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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