[GRASS-user] r.series g.mlist unhappy together

Richard Chirgwin rchirgwin at ozemail.com.au
Wed May 20 18:10:29 EDT 2009


> Message: 1
> Date: Tue, 19 May 2009 16:15:57 -0600
> From: saewan koh <saewan at gmail.com>
> Subject: [GRASS-user] r.series g.mlist unhappy together
> To: grass-user at lists.osgeo.org
> Message-ID: <12A3B1D9-B843-4ED8-BD26-8D0754F7A8AA at gmail.com>
> Content-Type: text/plain; charset="us-ascii"
> 
> Hi,
> 
> I am trying to use g.mlist to gather files to use with r.series.
> 
> r.series input="`g.mlist pat='*1987*pdds' sep=,`" output=test1987dd0  
> method=sum
> 
> When i run this i get:
> r.series input="`g.mlist pat='*1987*pdds' sep=,`" output=test1987dd0  
> method=sum
> Sorry, <pat> is not a valid parameter
> Sorry, <sep> is not a valid parameter
> 
> When i run g.mlist alone i get the list of files that i expect.
> I have successfully run r.series alone by manually selecting the files  
> I want to sum.
> If only I could get r.series and g.mlist to be happy!
> I am using GRASS6.4.ORC4 on Mac OS X V.10.5.6
> 
> If anyone has an idea why this is happening I would greatly appreciate  
> it!

Saewan,

I am chiming in late, I realise, but you could structure it this way:

for i in `g.mlist rast pattern="*1987*ppds`; do
r.series input=$i output=test1987dd0 method=sum --overwrite;
done

Note that the g.mlist command is surrounded by "tick marks", not single quotes.

This structure works fine for me in either OSX or Linux terminals for other
activities. The downside is that instead of running all the input maps at once,
it will do the processing accumulatively, which would be slow if you have lots
of input rasters.

RC


More information about the grass-user mailing list