[GRASS-SVN] r67209 - grass-addons/grass7/raster/r.series.filter
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Dec 17 15:19:23 PST 2015
Author: DmitryKolesov
Date: 2015-12-17 15:19:23 -0800 (Thu, 17 Dec 2015)
New Revision: 67209
Modified:
grass-addons/grass7/raster/r.series.filter/r.series.filter.py
Log:
r.series.filter: fix use current mapset for checking if output rasters exist
Modified: grass-addons/grass7/raster/r.series.filter/r.series.filter.py
===================================================================
--- grass-addons/grass7/raster/r.series.filter/r.series.filter.py 2015-12-17 19:27:01 UTC (rev 67208)
+++ grass-addons/grass7/raster/r.series.filter/r.series.filter.py 2015-12-17 23:19:23 UTC (rev 67209)
@@ -132,13 +132,13 @@
FNULL = np.nan # null value for FCELL and DCELL maps
-def init_rasters(names):
+def init_rasters(names, mapset=""):
"""Get list of raster names,
return array of the rasters
"""
rasters = []
for name in names:
- r = raster.RasterSegment(name)
+ r = raster.RasterSegment(name, mapset=mapset)
rasters.append(r)
return rasters
@@ -342,9 +342,13 @@
def filter(method, names, winsize, order, prefix, itercount, fit_up):
+
+ current_mapset = grass.read_command('g.mapset', flags='p')
+ current_mapset = current_mapset.strip()
+
inputs = init_rasters(names)
output_names = [prefix + name for name in names]
- outputs = init_rasters(output_names)
+ outputs = init_rasters(output_names, mapset=current_mapset)
try:
open_rasters(outputs, write=True)
open_rasters(inputs)
More information about the grass-commit
mailing list