[GRASS-user] problem with r.series / python

Hello,

I try to use r.series in a pyhton script as follows:

#%Module
#% description: test-r.series
#% keywords: r.series test
#%End
#%Option
#% key: input
#% type: string
#% required: yes
#% multiple: yes
#% key_desc: name
#% description: Name of input raster map(s)
#% gisprompt: old,cell,raster
#%End

import sys
import os

import grass.script as grass
import grass.script.setup as gsetup

def main():
    grass.run_command("$r.series", input=options['input'], output="out_Test", method="median")

if __name__ == "__main__":
    options, flags = grass.parser()
    sys.exit(main())

but somehow it isn't working. I get following error while running the script:
(Wed May 11 11:13:00 2011)
test2.py input=density_final_run1@Treene,density_final_run2@Treene
Traceback (most recent call last):
  File "/Library/GRASS/6.5/Modules/bin/test2.py", line 41,
in <module>
    sys.exit(main())
  File "/Library/GRASS/6.5/Modules/bin/test2.py", line 36,
in main
    grass.run_command("$r.series", input=options['input'],
output="out_Test", method="median")
  File "/Applications/GRASS-6.5.app/Contents/MacOS/etc/pytho
n/grass/script/core.py", line 186, in run_command
    ps = start_command(*args, **kwargs)
  File "/Applications/GRASS-6.5.app/Contents/MacOS/etc/pytho
n/grass/script/core.py", line 174, in start_command
    return Popen(args, **popts)
  File "/Applications/GRASS-6.5.app/Contents/MacOS/etc/pytho
n/grass/script/core.py", line 56, in __init__
    startupinfo, creationflags)
  File "/Library/Frameworks/Python.framework/Versions/2.6/li
b/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/Library/Frameworks/Python.framework/Versions/2.6/li
b/python2.6/subprocess.py", line 1141, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

is that a problem of r.series or I is there something wrong with my script/options etc.? I use GRASS 6.5 (source from last week or so) on Mac OSX

hopefully someone can help me soon.

/Johannes

--
NEU: FreePhone - kostenlos mobil telefonieren und surfen!
Jetzt informieren: http://www.gmx.net/de/go/freephone

On 11/05/11 11:18, Johannes Radinger wrote:

Hello,

I try to use r.series in a pyhton script as follows:

[...]

def main():
     grass.run_command("$r.series", input=options['input'], output="out_Test", method="median")

There shouldn't be a $ in front of r.series here.

Moritz