[GRASS-SVN] r47484 - grass-addons/grass7/imagery/i.topo.corr

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Aug 7 12:48:34 EDT 2011


Author: neteler
Date: 2011-08-07 09:48:34 -0700 (Sun, 07 Aug 2011)
New Revision: 47484

Modified:
   grass-addons/grass7/imagery/i.topo.corr/test_i.topo.corr_synthetic_DEM_NC.sh
Log:
added cosine test; cosmetics

Modified: grass-addons/grass7/imagery/i.topo.corr/test_i.topo.corr_synthetic_DEM_NC.sh
===================================================================
--- grass-addons/grass7/imagery/i.topo.corr/test_i.topo.corr_synthetic_DEM_NC.sh	2011-08-07 16:48:24 UTC (rev 47483)
+++ grass-addons/grass7/imagery/i.topo.corr/test_i.topo.corr_synthetic_DEM_NC.sh	2011-08-07 16:48:34 UTC (rev 47484)
@@ -12,7 +12,7 @@
 
 export GRASS_OVERWRITE=1
 
-# we use the NC location
+# we use the NC location, time zone UTM-5
 g.region n=308500 s=215000 w=630000 e=704800 nsres=250 ewres=250 -pa
 
 # note: no daylight saving time in summer 1954!
@@ -29,12 +29,12 @@
 TIMEZ=`echo $DATETIME | cut -d' ' -f5 | awk '{printf "%d", $1/100}'`
 unset TMPTIME
 
-# create synthetic DEM (kind of pyramid)
+# create synthetic DEM (kind of roof)
 r.plane --o myplane0 dip=45 az=0 east=637500 north=221750 elev=1000 type=float
 r.plane --o myplane90 dip=45 az=90 east=684800 north=221750 elev=1000 type=float
 r.plane --o myplane180 dip=45 az=180 east=684800 north=260250 elev=1000 type=float
 r.plane --o myplane270 dip=45 az=270 east=684800 north=221750 elev=1000 type=float
-r.mapcalc "myplane_pyr = double(min(myplane90,myplane270,myplane0,myplane180)/10 + 8600)"
+r.mapcalc "myplane_pyr = double(min(myplane90,myplane270,myplane0,myplane180)/10. + 8600.)"
 
 # nviz
 # nviz myplane_pyr
@@ -43,47 +43,66 @@
 eval `r.sunmask -s -g output=dummy elev=myplane_pyr year=$YEAR month=8 day=$DAY hour=$HOUR minute=$MIN second=$SEC timezone=$TIMEZ`
 
 solarzenith=`echo $sunangleabovehorizon | awk '{printf "%f", 90. - $1}'`
+echo "Sun position ($DATETIME): solarzenith: $solarzenith, sunazimuth: $sunazimuth"
 
 # shade relief
 r.shaded.relief input=myplane_pyr output=myplane_pyr_shaded altitude=$sunangleabovehorizon azimuth=$sunazimuth
-d.mon stop=wx0
+d.mon stop=wx0 > /dev/null
 d.mon wx0
 d.rast myplane_pyr_shaded
 
 # pre-run: illumination map
-i.topo.corr -i input=myplane_pyr output=myplane_pyr_illumination basemap=myplane_pyr zenith=$solarzenith azimuth=$sunazimuth method=c-factor
+i.topo.corr -i input=myplane_pyr output=myplane_pyr_illumination \
+	    basemap=myplane_pyr zenith=$solarzenith azimuth=$sunazimuth 
+r.colors myplane_pyr_illumination color=gyr
 
 # show original
 d.erase -f
-r.colors myplane_pyr col=grey
+r.colors myplane_pyr color=grey
 d.rast.leg myplane_pyr
+echo "Original" | d.text color=black
 
-#making the 'band' reflectance file
+# nviz with illumination draped over
+# nviz myplane_pyr color=myplane_pyr_illumination
+
+# making the 'band' reflectance file from the shade map
 r.mapcalc "myplane_pyr_band = double((myplane_pyr_shaded - 60.)/18.)"
-d.mon stop=wx0
+r.colors myplane_pyr_band color=gyr
+d.mon stop=wx0 > /dev/null
 d.mon wx0
 d.rast myplane_pyr_band
 d.legend myplane_pyr_band
+echo "Band reflectance" | d.text color=black
 
 ## test it:
 # percent
 METHOD=percent
 i.topo.corr input=myplane_pyr_band output=myplane_pyr_topocorr_${METHOD} basemap=myplane_pyr_illumination zenith=$solarzenith method=$METHOD
-d.mon stop=wx1
+d.mon stop=wx1 > /dev/null
 d.mon wx1
 d.rast.leg myplane_pyr_topocorr_${METHOD}.myplane_pyr_band
+echo "METHOD=percent" | d.text color=black
 
 # minnaert
 METHOD=minnaert
 i.topo.corr input=myplane_pyr_band output=myplane_pyr_topocorr_${METHOD} basemap=myplane_pyr_illumination zenith=$solarzenith method=$METHOD
-d.mon stop=wx2
+d.mon stop=wx2 > /dev/null
 d.mon wx2
 d.rast.leg myplane_pyr_topocorr_${METHOD}.myplane_pyr_band
+echo "METHOD=minnaert" | d.text color=black
 
 # c-factor
 METHOD=c-factor
 i.topo.corr input=myplane_pyr_band output=myplane_pyr_topocorr_${METHOD} basemap=myplane_pyr_illumination zenith=$solarzenith method=$METHOD
-d.mon stop=wx3
+d.mon stop=wx3 > /dev/null
 d.mon wx3
 d.rast.leg myplane_pyr_topocorr_${METHOD}.myplane_pyr_band
+echo "METHOD=c-factor" | d.text color=black
 
+# cosine
+METHOD=cosine
+i.topo.corr input=myplane_pyr_band output=myplane_pyr_topocorr_${METHOD} basemap=myplane_pyr_illumination zenith=$solarzenith method=$METHOD
+d.mon stop=wx4 > /dev/null
+d.mon wx4
+d.rast.leg myplane_pyr_topocorr_${METHOD}.myplane_pyr_band
+echo "METHOD=cosine" | d.text color=black



More information about the grass-commit mailing list