<div dir="ltr"><div><div>Hi Vero<br><br></div>If I got you right, may be this could be a better approach,<br></div><div>#Assuming you are using MOD13Q1 product, and for example maps from MOD13Q1.A2015353.h18v05.006.2016007180711.hdf;<br></div><div><br><span style="font-family:monospace,monospace">map=`g.list rast pat=MOD13*_EVI`<br>for tile in ${map}; do<br> ## Put the common part (In this case - MOD13Q1.A2015353.h18v05) of the map name into a variable.<br> i=`echo $map|cut -c1-23` <br>
r.mapcalc --o expression="${map} = if(${i}_pixel_</span><span style="font-family:monospace,monospace">reliability` == 0, ${map}, null())"<br>
done</span><br></div><div><br><br></div><div>Sajid</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 15, 2016 at 2:58 PM, Veronica Andreo <span dir="ltr"><<a href="mailto:veroandreo@gmail.com" target="_blank">veroandreo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello everybody,<br>
<br>
Is it possible to use r.mapcalc with `g.list` as part of the<br>
expression??? Something like:<br>
<br>
tiles=(h11v11 h12v11 h12v12)<br>
for tile in ${tiles[*]}<br>
do<br>
r.mapcalc --o expression="`g.list rast pat=MOD13*$tile_EVI` =<br>
if(`g.list rast pat=MOD13*$tile_pixel_reliability` == 0, `g.list rast<br>
pat=MOD13*$tile_EVI`, null())"<br>
done<br>
<br>
it worked only once in a test case with one image per tile... when I<br>
tried to run it again for the whole set, i get parse error:<br>
<br>
syntax error, unexpected ';', expecting '('<br>
syntax error, unexpected ';', expecting ')'<br>
Parse error<br>
ERROR: parse error<br>
<br>
Which would be best practice in this case? Is this use even possible?<br>
<br>
I know I can register maps in temporal framework and use<br>
t.rast.mapcalc, but I want to keep year and doy in mapnames and<br>
neither t.rast.mapcalc nor t.rast.algebra have granularity suffix<br>
option yet (only numerical suffix).<br>
<br>
Ah, I use grass trunk (7.3) freshly updated to r68692.<br>
<br>
thanks much in advance!<br>
<br>
Vero<br>
_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a></blockquote></div><br></div>