Sunday 10 April 2016

gdal - Raster Caculator Qgis 2.6 v/s Gdal_calc.py by Terminal


I need calculated monthly mean of Snowcover data by MODIS product, and then modify this script gdal_calc.py in this section


# create alphabetic list for storing input layers
AlphaList=["A","B","C","D","E","F","G","H","I","J","K","L","M",
"N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e"]

and wrote this script:


!/bin/bash echo -n "./gdal_calc.py " > comandos_py.sh array=(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e) cont=0 for file in MCD10A1_*.tif ; do echo "map: $file" letra=${array[$cont]} echo -n "-$letra ${file} " >> comandos_py.sh cont=$[cont+1] done echo -n "--outfile=MEAN_2013_06.tif --calc=\"(A+B+C+D+E+F+G+H+I+J+K+M+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+a+b+c+d)/30\" --NoDataValue=-9999 --type=Float32" >> comandos_py.sh



both running well..... but the output file is incorrect...


in another way! load all file on QGIS 2.6, open RASTER CALCULATOR insert 30 image SNOWCOVER DAILY sum and divided by 30 and the output file IS CORRECT....


can someone explain to me why this happens?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...