[GRASS-user] Python calling landsat_toar function

Pierric de Laborie pierric.delaborie at gmail.com
Mon Jan 19 10:07:40 PST 2015


Hi,
I am using Grass 7 beta 4 on Windows.

After importing Landsat raster bands, I use the following command that
works fine.

i.landsat.toar --overwrite --verbose input=LC81900362014284LGN00_B
output=ator
metfile=C:\Users\Administrator\Downloads\LC81900362014284LGN00\LC81900362014284LGN00\LC81900362014284LGN00_MTL.txt

But when I try to do the same in the Python console (same software), I get
the following error (please see below after code) complaining for the input
prefix parameter. Note that I get the same error in my Python script on
Linux using Grass7, so I supposed it is not related to the os. I guess it
is caused by an error in the calling syntax (?)

import grass.script as grass   -> OK

from grass.pygrass.modules.shortcuts import imagery as i   -> OK

i.landsat_toar(input_prefix="LC81900362014284LGN00_B",
output_prefix=outpref,metfile="LC81900362014284LGN00_MTL.txt",
overwrite="True", quiet="False")

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Program Files (x86)\GRASS GIS
7.0.0beta4\etc\python\grass\pygrass\modules\interface\module.py", line 602,
in __call__
    raise ParameterError('%s is not a valid parameter.' % key)
ParameterError: input_prefix is not a valid parameter.


Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20150119/3b0123c5/attachment.html>


More information about the grass-user mailing list