[GRASS-dev] module input (multiple type) in pyGRASS

Pietro Zambelli peter.zamb at gmail.com
Fri Jun 21 03:10:54 PDT 2013


Hi Yann,


On Friday 21 Jun 2013 10:48:14 Yann Chemin wrote:
> Hi,
> 
> I am having trouble with multiple input in pyGRASS:
> 
> Example:
> -------------
> b_in=[b1,b2,b3,b4,b5,b7]
> i.albedo(input=b_in, output=b_albedo, flags="lc", overwrite=OVR)
> 
> input has a multiple raster band names requirement (6 here),
> using a list to define b_in does not work.
> 
> What kind of container should I use?


you should use a list as you do...

I don't have your map so I'm not able to reproduce the problem on my 
machine...

I've try with:
{{{
from grass.pygrass.modules.shortcuts import imagery as i

alb = i.albedo
alb(input=['b1', 'b2', 'b3', 'b4', 'b5', 'b7'], 
    output='b_albedo', flags="lc", overwrite=True, run_=False)
alb.get_bash()
}}}

and return 'i.albedo input=b1,b2,b3,b4,b5,b7 output=b_albedo -l -c --o'
that it seems correct to me...

Can you provide some more details about "b_in does not work"? :-)
What kind of error do you have?

Best regards

Pietro

ps: thank you for testing!


More information about the grass-dev mailing list