[GRASS-user] unexpected i.pansharpen results
Nikos Alexandris
nik at nikosalexandris.net
Wed Jul 31 09:18:15 PDT 2013
Just for the records, the script to draw composite overviews of pan-sharpen
attempts, using the good old frames in G64 ;-)
Nikos
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
#!/bash/sh
# script to draw screenshots, 3 x 3 various methods x inputs
# loop over Methods and Input Types, compose RGBs
for Method_Input in "ihs DNs" "ihs Radiance" "ihs ToAR" \
"brovey DNs" "brovey Radiance" "brovey ToAR" \
"pca DNs" "pca Radiance" "pca ToAR"
do
# parse "${Method_STR}" and set positional parameters
set -- $Method_Input ; echo $1 $2
# compose
r.composite --o \
r=sharp_"${1}"_"${2}"_red \
g=sharp_"${1}"_"${2}"_green \
b=sharp_"${1}"_"${2}"_blue \
out=rgb_sharpened_"${1}"_"${2}"
done
# set wide aspect ratio (16:9, e.g. 1366 width x 768 height)
d.monsize setm=x0 setw=1366 seth=768
# split in 9 frames
d.split.frame frames=9
# preferred font?
d.font DroidSans
# loop over composites
for FRAME in "uno ihs DNs" "dos ihs Radiance" "tres ihs ToAR" \
"cuatro brovey DNs" "cinco brovey Radiance" "seis brovey ToAR" \
"siete pca DNs" "ocho pca Radiance" "nueve pca ToAR"
do
# parse "${FRAMES_STR}" and set positional parameters
set -- $FRAME ; echo $1 $2 $3
# select FRAME
d.frame -s "${1}"
# draw the map
d.rast rgb_sharpened_"${2}"_"${3}"
# draw label on the left and vertically
d.text text="${2}, ${3}" size=8 color=50:50:50 at=10,25 rotation=90
# draw legend ?
d.legend rgb_sharpened_"${2}"_"${3}" -s at=10,90,76,82
done
# re-balance colors
for Method_Input in "ihs DNs" "ihs Radiance" "ihs ToAR" \
"brovey DNs" "brovey Radiance" "brovey ToAR" \
"pca DNs" "pca Radiance" "pca ToAR"
do
# parse "${Method_STR}" and set positional parameters
set -- $Method_Input ; echo $1 $2
# re-balance, re-compose
i.landsat.rgb -p \
r=sharp_"${1}"_"${2}"_red \
g=sharp_"${1}"_"${2}"_green \
b=sharp_"${1}"_"${2}"_blue
# re-compose
r.composite --o \
r=sharp_"${1}"_"${2}"_red \
g=sharp_"${1}"_"${2}"_green \
b=sharp_"${1}"_"${2}"_blue \
out=rgb_sharpened_"${1}"_"${2}"_rebalanced
done
# set wide aspect ratio (16:9, e.g. 1366 width x 768 height)
d.monsize setm=x1 setw=1366 seth=768
# split in 9 frames
d.split.frame frames=9
# preferred font?
d.font DroidSans
# loop over Re-Balanced composites
for FRAME in "uno ihs DNs" "dos ihs Radiance" "tres ihs ToAR" \
"cuatro brovey DNs" "cinco brovey Radiance" "seis brovey ToAR" \
"siete pca DNs" "ocho pca Radiance" "nueve pca ToAR"
do
# parse "${FRAMES_STR}" and set positional parameters
set -- $FRAME ; echo $1 $2 $3
# select FRAME
d.frame -s "${1}"
# draw the map
d.rast rgb_sharpened_"${2}"_"${3}"_rebalanced
# draw label on the left and vertically
d.text text="${2}, ${3}" size=8 color=50:50:50 at=10,25 rotation=90
d.text text="Rebalanced i.landsat.rgb -p" size=6 color=50:50:50 at=14,10
rotation=90
# draw legend ?
d.legend rgb_sharpened_"${2}"_"${3}"_rebalanced -s at=10,90,76,82
done
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
More information about the grass-user
mailing list