[GRASS-user] use of g.list inside r.mapcalc expression

Veronica Andreo veroandreo at gmail.com
Wed Jun 15 05:58:03 PDT 2016


Hello everybody,

Is it possible to use r.mapcalc with `g.list` as part of the
expression??? Something like:

tiles=(h11v11 h12v11 h12v12)
for tile in ${tiles[*]}
do
r.mapcalc --o expression="`g.list rast pat=MOD13*$tile_EVI` =
if(`g.list rast pat=MOD13*$tile_pixel_reliability` == 0, `g.list rast
pat=MOD13*$tile_EVI`, null())"
done

it worked only once in a test case with one image per tile... when I
tried to run it again for the whole set, i get parse error:

syntax error, unexpected ';', expecting '('
syntax error, unexpected ';', expecting ')'
Parse error
ERROR: parse error

Which would be best practice in this case? Is this use even possible?

I know I can register maps in temporal framework and use
t.rast.mapcalc, but I want to keep year and doy in mapnames and
neither t.rast.mapcalc nor t.rast.algebra have granularity suffix
option yet (only numerical suffix).

Ah, I use grass trunk (7.3) freshly updated to r68692.

thanks much in advance!

Vero


More information about the grass-user mailing list