2

I'm import and reprojected MOD11A1 with GDAL 1.10....my shell script is easy..

for file in *.hdf; do
echo "map: $file"

gdal_translate -of Gtiff -ot Int16 HDF4_EOS:EOS_GRID:"$file":MODIS_Grid_Daily_1km_LST:LST_Day_1km  -a_nodata -9999 out/${file}.tif
echo "out/"${file}".tif" | awk 'BEGIN{FS=".";}{ print "mv "$0" "$1"."$2"."$3"."$4"."$5"."$7}' |sh`

but when running script reprojected something is wrong with data...

for file in *.tif; do
echo "map: $file"


gdalwarp -s_srs "+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs" -t_srs EPSG:32719 \
    -te 333524.4980000000214204 6618581.1791345691308379 422017.2268572300090455 6679275.1449999995529652 -tr 926.625 -926.625 \
    -dstnodata -9999 -ot Int16 $file utm/${file}

done

look my screenshot on qgis....sript 1 import hdf

script 2 reprojected tif

any idea how to solve?

5

As mentioned in the files metadata, the modis source data has a scale factor of 0.02. QGIS applies it on-the-fly.

But the reprojection with gdalwarp destroys the scale factor information, hence the result is unscaled. You have to apply it manually to get the correct results.

  • Thanks a lot AndreJ... thats right gdalwarp destroy factor scale data of 0.02 now working in a Shell Script for multiply 5000 img...any idea... – Sigologo Feb 23 '16 at 20:21
0

Ok My Solution .... write next scrip for scaling data Land Surface Temperature MOD11A1.....

for file in *.tif; do
echo "map: $file"
gdal_calc.py -A $file --outfile=sc/$file  --calc=A*0.02

done

Nice!!!!!!! Linux is wonderful specially if you want more 5500 images...

Thanks a Lot AndreJ... for you comments

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.