[GRASS-SVN] r59556 - in grass/trunk: gui/wxpython/animation imagery/i.landsat.toar imagery/i.topo.corr lib/init lib/vector/Vlib raster/r.sunmask

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 2 06:19:24 PDT 2014


Author: neteler
Date: 2014-04-02 06:19:22 -0700 (Wed, 02 Apr 2014)
New Revision: 59556

Modified:
   grass/trunk/gui/wxpython/animation/frame.py
   grass/trunk/imagery/i.landsat.toar/main.c
   grass/trunk/imagery/i.topo.corr/i.topo.corr.html
   grass/trunk/imagery/i.topo.corr/test_i.topo.corr_synthetic_DEM_NC.sh
   grass/trunk/lib/init/variables.html
   grass/trunk/lib/vector/Vlib/open.c
   grass/trunk/raster/r.sunmask/main.c
Log:
revert accidential commit r59555

Modified: grass/trunk/gui/wxpython/animation/frame.py
===================================================================
--- grass/trunk/gui/wxpython/animation/frame.py	2014-04-02 12:57:13 UTC (rev 59555)
+++ grass/trunk/gui/wxpython/animation/frame.py	2014-04-02 13:19:22 UTC (rev 59556)
@@ -63,14 +63,16 @@
         tgis.init()
 
         global TMP_DIR
-        # create temporal directory and ensure it's deleted after programs ends (stored in MAPSET/.tmp/)
-        TMP_DIR = gcore.tempdir()
+        TMP_DIR = tempfile.mkdtemp()
 
         self.animations = [Animation() for i in range(MAX_COUNT)]
         self.windows = []
         self.animationPanel = AnimationsPanel(self, self.windows, initialCount=MAX_COUNT)
         bitmapPool = BitmapPool()
         mapFilesPool = MapFilesPool()
+        # create temporal directory and ensure it's deleted after programs ends
+#        tempDir = tempfile.mkdtemp()
+#        self.cleanUp = CleanUp(tempDir)
 
         self._progressDlg = None
         self._progressDlgMax = None

Modified: grass/trunk/imagery/i.landsat.toar/main.c
===================================================================
--- grass/trunk/imagery/i.landsat.toar/main.c	2014-04-02 12:57:13 UTC (rev 59555)
+++ grass/trunk/imagery/i.landsat.toar/main.c	2014-04-02 13:19:22 UTC (rev 59556)
@@ -719,7 +719,6 @@
 	    Rast_write_units(band_out, "W/(m^2 sr um)");
 	else
 	    Rast_write_units(band_out, "unitless");
-	/*  set raster timestamp from acq date? (see r.timestamp module)  */
     }
     Rast_set_window(&orig_cellhd);
 

Modified: grass/trunk/imagery/i.topo.corr/i.topo.corr.html
===================================================================
--- grass/trunk/imagery/i.topo.corr/i.topo.corr.html	2014-04-02 12:57:13 UTC (rev 59555)
+++ grass/trunk/imagery/i.topo.corr/i.topo.corr.html	2014-04-02 13:19:22 UTC (rev 59556)
@@ -4,18 +4,9 @@
 from imagery files, e.g. obtained with <em>i.landsat.toar</em>, using a
 sun illumination terrain model. This illumination model represents the
 cosine of the incident angle, i.e. the  angle between the normal to the
-ground and the sun rays.
-
-<!-- why this?? what about -i flag? 
-It can be obtained with <em>r.sun</em>
+ground and the sun rays. It can be obtained with <em>r.sun</em>
 (parameter incidout), and then calculating its cosine with float precision.
--->
 
-If needed, the sun position can be calculated for a given date with
-<em>r.sunmask</em>.
-
-<!-- TODO: figure here -->
-
 <p>
 Using the <b>-i</b> flag and given an elevation basemap (metric),
 <em>i.topo.corr</em> creates a simple illumination model using the formula:
@@ -87,10 +78,7 @@
 <p>
 
 <div class="code"><pre>
-# first pass: create illumination model
 i.topo.corr -i base=SRTM zenith=33.3631 azimuth=59.8897 out=SRTM.illumination
-
-# second pass: apply illumination model
 i.topo.corr base=SRTM.illumination input=toar.5,toar.4,toar.3 out=tcor \ 
   zenith=33.3631 method=c-factor
 </pre></div>
@@ -122,9 +110,9 @@
 <a href="i.landsat.toar.html">i.landsat.toar</a>,
 <a href="r.mapcalc.html">r.mapcalc</a>,
 <a href="r.sun.html">r.sun</a>
-<a href="r.sunmask.html">r.sunmask</a>
 </em>
 
+
 <h2>AUTHOR</h2>
 
 E. Jorge Tizado  (ej.tizado unileon es)<br>

Modified: grass/trunk/imagery/i.topo.corr/test_i.topo.corr_synthetic_DEM_NC.sh
===================================================================
--- grass/trunk/imagery/i.topo.corr/test_i.topo.corr_synthetic_DEM_NC.sh	2014-04-02 12:57:13 UTC (rev 59555)
+++ grass/trunk/imagery/i.topo.corr/test_i.topo.corr_synthetic_DEM_NC.sh	2014-04-02 13:19:22 UTC (rev 59556)
@@ -3,7 +3,7 @@
 # Script to test i.topo.corr with a synthetic map
 #
 # Use North Carolina location to test:
-#   grass71 ~/grassdata/nc_spm_08_grass7/user1
+#   grass64 ~/grassdata/nc_spm_08/user1
 
 if test "$GISBASE" = ""; then
  echo "You must be in GRASS to run this program."
@@ -25,34 +25,36 @@
 TMPTIME=`echo $DATETIME | cut -d' ' -f4 | awk '{printf "%d", $1}'`
 HOUR=`echo $TMPTIME | cut -d':' -f1 | awk '{printf "%d", $1}'`
 MIN=`echo $TMPTIME | cut -d':' -f2 | awk '{printf "%d", $1}'`
+SEC=`echo $TMPTIME | cut -d':' -f3 | awk '{printf "%d", $1}'`
 TIMEZ=`echo $DATETIME | cut -d' ' -f5 | awk '{printf "%d", $1/100}'`
 unset TMPTIME
 
 # create synthetic DEM (kind of roof)
-r.plane myplane0 dip=45 az=0 east=637500 north=221750 elev=1000 type=FCELL
-r.plane myplane90 dip=45 az=90 east=684800 north=221750 elev=1000 type=FCELL
-r.plane myplane180 dip=45 az=180 east=684800 north=260250 elev=1000 type=FCELL
-r.plane myplane270 dip=45 az=270 east=684800 north=221750 elev=1000 type=FCELL
+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.)"
 
 # nviz
 # nviz myplane_pyr
 
 # get sun position
-eval `r.sunmask -s -g elev=myplane_pyr year=$YEAR month=8 day=$DAY hour=$HOUR minute=$MIN timezone=$TIMEZ`
+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 2> /dev/null
-d.mon wx0
-sleep 5 # this is rather annoying
-d.rast myplane_pyr_shaded
+# show raw map as shaded map
+#d.mon wx0
+#sleep 5 # this is rather annoying
+#d.rast myplane_pyr_shaded
+#echo "Original as shaded map" | d.text color=black
 
 # pre-run: illumination map
-i.topo.corr -i input=myplane_pyr output=myplane_pyr_illumination \
+i.topo.corr -i output=myplane_pyr_illumination \
 	    basemap=myplane_pyr zenith=$solarzenith azimuth=$sunazimuth 
 r.colors myplane_pyr_illumination color=gyr
 
@@ -67,47 +69,44 @@
 
 # making the 'band' reflectance file from the shade map
 r.mapcalc "myplane_pyr_band = double((myplane_pyr_shaded - 60.)/18.)"
+echo "Band map statistics: reflectance values:"
+r.univar -g myplane_pyr_band
 r.colors myplane_pyr_band color=gyr
-d.mon stop=wx1 2> /dev/null
-d.mon wx1
-sleep 5 # this is rather annoying
-d.rast myplane_pyr_band
-d.legend myplane_pyr_band
-echo "Band reflectance" | d.text color=black
+#d.mon wx1
+#sleep 5 # this is rather annoying
+#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=wx2 2> /dev/null
-d.mon wx2
-sleep 5 # this is rather annoying
-d.rast.leg myplane_pyr_topocorr_${METHOD}.myplane_pyr_band
-echo "METHOD=percent" | d.text color=black
+#d.mon wx2
+#sleep 5 # this is rather annoying
+#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=wx3 2> /dev/null
-d.mon wx3
-sleep 5 # this is rather annoying
-d.rast.leg myplane_pyr_topocorr_${METHOD}.myplane_pyr_band
-echo "METHOD=minnaert" | d.text color=black
+#d.mon wx3
+#sleep 5 # this is rather annoying
+#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=wx4 2> /dev/null
-d.mon wx4
-sleep 5 # this is rather annoying
-d.rast.leg myplane_pyr_topocorr_${METHOD}.myplane_pyr_band
-echo "METHOD=c-factor" | d.text color=black
+#d.mon wx4
+#sleep 5 # this is rather annoying
+#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=wx5 2> /dev/null
-d.mon wx5
-sleep 5 # this is rather annoying
-d.rast.leg myplane_pyr_topocorr_${METHOD}.myplane_pyr_band
-echo "METHOD=cosine" | d.text color=black
+#d.mon wx5
+#sleep 5 # this is rather annoying
+#d.rast.leg myplane_pyr_topocorr_${METHOD}.myplane_pyr_band
+#echo "METHOD=cosine" | d.text color=black

Modified: grass/trunk/lib/init/variables.html
===================================================================
--- grass/trunk/lib/init/variables.html	2014-04-02 12:57:13 UTC (rev 59555)
+++ grass/trunk/lib/init/variables.html	2014-04-02 13:19:22 UTC (rev 59556)
@@ -307,11 +307,6 @@
     If OpenMP support is enabled this limits the number of threads.
     The default is set to the number of CPUs on the system.
     Setting to '1' effectively disables parallel processing.</dd>
-    
-  <dt>TMPDIR, TEMP, TMP</dt>
-  <dd>[Various GRASS GIS commands and wxGUI]<br>
-  <!-- what about Windows %TEMP% and http://trac.osgeo.org/grass/ticket/560#comment:21 ? -->
-    Use $TMPDIR if it exists, then $TEMP, otherwise /tmp.</dd>
 </dl>
 
 <a name="rendering"></a>

Modified: grass/trunk/lib/vector/Vlib/open.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open.c	2014-04-02 12:57:13 UTC (rev 59555)
+++ grass/trunk/lib/vector/Vlib/open.c	2014-04-02 13:19:22 UTC (rev 59556)
@@ -240,9 +240,7 @@
         }
         else {
             char file_path[GPATH_MAX];
-            /* reduce to current mapset if search path was set */
-            if(strcmp(Map->mapset, "") == 0)
-                Map->mapset = G_store(G_mapset());
+            
             /* temporary map: reduce to current mapset if search path
              * was set */
             if (strcmp(Map->mapset, "") == 0)

Modified: grass/trunk/raster/r.sunmask/main.c
===================================================================
--- grass/trunk/raster/r.sunmask/main.c	2014-04-02 12:57:13 UTC (rev 59555)
+++ grass/trunk/raster/r.sunmask/main.c	2014-04-02 13:19:22 UTC (rev 59556)
@@ -189,7 +189,6 @@
     parm.seconds->required = NO;
     parm.seconds->description = _("Seconds (B)");
     parm.seconds->options = "0-60";
-    parm.seconds->answer = "0";
     parm.seconds->guisection = _("Time");
 
     parm.timezone = G_define_option();



More information about the grass-commit mailing list