[GRASS-SVN] r71018 - grass-addons/grass7/raster/r.modis/r.modis.import

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 3 23:57:46 PDT 2017


Author: neteler
Date: 2017-05-03 23:57:45 -0700 (Wed, 03 May 2017)
New Revision: 71018

Modified:
   grass-addons/grass7/raster/r.modis/r.modis.import/r.modis.import.html
   grass-addons/grass7/raster/r.modis/r.modis.import/r.modis.import.py
Log:
r.modis addon manual: added option for output file to use as input in t.register (updated of r71017)

Modified: grass-addons/grass7/raster/r.modis/r.modis.import/r.modis.import.html
===================================================================
--- grass-addons/grass7/raster/r.modis/r.modis.import/r.modis.import.html	2017-05-04 06:40:03 UTC (rev 71017)
+++ grass-addons/grass7/raster/r.modis/r.modis.import/r.modis.import.html	2017-05-04 06:57:45 UTC (rev 71018)
@@ -78,11 +78,11 @@
 
 <p>
 Import of a single subset of layers (i.e.: spectral="( 1 )") from each file from a
-list and write a file to be used in <em>t.register</em> to create a temporal
+list and write an  <em>outfile</em> to be used in <em>t.register</em> to create a temporal
 dataset. This option uses GDAL:
 
 <div class="code"><pre>
-r.modis.import -wq files=/path/to/listfile spectral="( 1 )"
+r.modis.import -wq files=/path/to/listfile spectral="( 1 )" outfile=/path/to/list_for_tregister.csv
 </pre></div>
 
 <h3>Import of global MODIS NDVI data</h3>
@@ -95,12 +95,13 @@
 r.modis.download settings=~/.rmodis product=ndvi_terra_sixteen_5600 \
   startday=2015-01-01 endday=2016-12-31 folder=$USER/data/ndvi_MOD13C1.006
 # import band 1 = NDVI
-r.modis.import files=$USER/data/ndvi_MOD13C1.006/listfileMOD13C1.006.txt spectral="( 1 )" method=bilinear -w
+r.modis.import files=$USER/data/ndvi_MOD13C1.006/listfileMOD13C1.006.txt spectral="( 1 )" \
+  method=bilinear outfile=$USER/data/ndvi_MOD13C1.006/list_for_tregister.csv -w
 # create empty temporal DB
 t.create type=strds temporaltype=absolute output=ndvi_16_5600m title="Global NDVI 16 days MOD13C1" \
   description="MOD13C1 Global NDVI 16 days" semantictype=mean
-# register datasets (tempfile name is provided by r.modis.import -w
-t.register input=ndvi_16_5600m file=$USER/tmp/grass7-user-5370/tmp_rGPcg
+# register datasets (tempfile name is provided by r.modis.import -w with outfile
+t.register input=ndvi_16_5600m file=$USER/data/ndvi_MOD13C1.006/list_for_tregister.csv
 
 # verify and visualize timeline
 t.rast.list ndvi_16_5600m
@@ -136,7 +137,7 @@
  # get name of product and date from filenames
  i=`echo $m | cut -c 1-16`
  # apply qa flags
- r.mapcalc --o expression="${m} = if(${i}_mosaic_QC_Day_mandatory_qa < 2, ${m}, null())"
+ r.mapcalc --o expression="${m} = if(${i}_mosaic_QC_Day_mandatory_qa < 2, ${m}, null())"
 done
 </pre></div>
 
@@ -167,13 +168,13 @@
 # r.modis.download (see above) and get a list of the imported files along with
 # dates to use with t.register in the temporal framework
 r.modis.import -mw files=$HOME/listfileMOD11A1.006.txt \
- spectral="( 1 0 0 0 0 0 0 0 0 0 0 0 )"
+ spectral="( 1 0 0 0 0 0 0 0 0 0 0 0 )" outfile=$HOME/list_for_tregister.csv
 
 # Create time series and register maps
 t.create type=strds temporaltype=absolute output=LST_Day_daily \
  title="Daily LST Day 1km" \
  description="Daily LST Day 1km MOD11A1.006, December 2016"
-t.register input=LST_Day_daily file=$HOME/tmp/grass7-user-5370/tmp_rGPcg
+t.register input=LST_Day_daily file=$HOME/list_for_tregister.csv
 </pre></div>
 
 <h2>SEE ALSO</h2>

Modified: grass-addons/grass7/raster/r.modis/r.modis.import/r.modis.import.py
===================================================================
--- grass-addons/grass7/raster/r.modis/r.modis.import/r.modis.import.py	2017-05-04 06:40:03 UTC (rev 71017)
+++ grass-addons/grass7/raster/r.modis/r.modis.import/r.modis.import.py	2017-05-04 06:57:45 UTC (rev 71018)
@@ -17,7 +17,8 @@
 #############################################################################
 #
 # REQUIREMENTS:
-#   -  MRT tools, https://lpdaac.usgs.gov/lpdaac/tools/modis_reprojection_tool
+#   - either MRT tools, https://lpdaac.usgs.gov/lpdaac/tools/modis_reprojection_tool
+#   - or GDAL
 #
 #############################################################################
 
@@ -41,7 +42,7 @@
 #%end
 #%flag
 #% key: w
-#% description: Create a text file to use into t.register
+#% description: Create a text file to use for import into t.register
 #%end
 #%flag
 #% key: l
@@ -86,7 +87,7 @@
 #%end
 #%option G_OPT_F_OUTPUT
 #% key: outfile
-#% description: Full path to output file to use in t.register
+#% description: Full path to output file to use for import into t.register
 #% required: no
 #%end
 



More information about the grass-commit mailing list