[GRASS-SVN] r68685 - grass-addons/grass7/raster/r.series.filter
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jun 14 12:46:43 PDT 2016
Author: neteler
Date: 2016-06-14 12:46:43 -0700 (Tue, 14 Jun 2016)
New Revision: 68685
Modified:
grass-addons/grass7/raster/r.series.filter/r.series.filter.html
grass-addons/grass7/raster/r.series.filter/r.series.filter.py
Log:
r.series.filter addon: clarify minimal version of python-scipy package
Modified: grass-addons/grass7/raster/r.series.filter/r.series.filter.html
===================================================================
--- grass-addons/grass7/raster/r.series.filter/r.series.filter.html 2016-06-14 19:18:26 UTC (rev 68684)
+++ grass-addons/grass7/raster/r.series.filter/r.series.filter.html 2016-06-14 19:46:43 UTC (rev 68685)
@@ -1,13 +1,16 @@
<h2>DESCRIPTION</h2>
+
+<em>r.series.filter</em> is a module to filter raster time series <em>X</em>
+in time domain.
+It requires <em>python-scipy</em> (version 0.14 or later).
+
+<p>
<em>-c</em> Find optimal parameters of used filter. The function to optimize depends on
difference between original and filtered signals and on derivates of the
filtered signal.
-<em>-u</em> Filter usung upper boundary of the signal values.
- (Usefull for vegetation indexes filtering)
+<em>-u</em> Filter using upper boundary of the signal values.
+ (Useful for vegetation indexes filtering)
<p>
-<em>r.series.filter</em> is a module to filter raster time series <em>X</em>
-in time domain.
-<p>
<em>input</em> Raster names of equally spaced time series <em>X</em>.
<p>
<em>result_prefix</em> Prefix for raster names of filterd <em>X</em>.
@@ -104,10 +107,12 @@
<h2>SEE ALSO</h2>
-<em><a href="addons/r.regression.series.html">r.regression.series</a></em>,
-<em><a href="r.series.html">r.series</a></em>,
-<em><a href="r.regression.line.html">r.regression.line</a></em>,
-<em><a href="g.list.html">g.list</a></em>,
+<em>
+<a href="r.regression.series.html">r.regression.series</a>,
+<a href="r.series.html">r.series</a>,
+<a href="r.regression.line.html">r.regression.line</a>,
+<a href="g.list.html">g.list</a>
+</em>
<h2>AUTHOR</h2>
Modified: grass-addons/grass7/raster/r.series.filter/r.series.filter.py
===================================================================
--- grass-addons/grass7/raster/r.series.filter/r.series.filter.py 2016-06-14 19:18:26 UTC (rev 68684)
+++ grass-addons/grass7/raster/r.series.filter/r.series.filter.py 2016-06-14 19:46:43 UTC (rev 68685)
@@ -18,7 +18,7 @@
#############################################################################
#%Module
-#% description: Perform filtering of raster time series X (in time domain)
+#% description: Perform filtering of raster time series X (in time domain).
#% overwrite: yes
#%End
#%flag
@@ -35,7 +35,7 @@
#% key: input
#% type: string
#% gisprompt: list of raster names
-#% description: Raster names of equally spaced time series.
+#% description: Raster names of equally spaced time series
#% required : yes
#% multiple: yes
#%end
@@ -113,11 +113,6 @@
import os
import sys
-import numpy as np
-from scipy.signal import savgol_filter
-from scipy.signal import medfilt
-
-
if "GISBASE" not in os.environ:
sys.stderr.write("You must be in GRASS GIS to run this program.\n")
sys.exit(1)
@@ -128,6 +123,15 @@
from grass.exceptions import OpenError
from grass.pygrass.gis.region import Region
+import numpy as np
+try:
+ from scipy.signal import savgol_filter
+except ImportError:
+ grass.error("Cannot import savgol_filter from scipy. Install python-scipy version 0.14 or later package first")
+ sys.exit(1)
+from scipy.signal import medfilt
+
+
CNULL = -2147483648 # null value for CELL maps
FNULL = np.nan # null value for FCELL and DCELL maps
More information about the grass-commit
mailing list