<div dir="ltr"><div><div>Oh! Thanks! <br>I was using GRASS 7.0.1, which has no t.rast.algebra module.<br>I didn't noticed there where a t.rast.mapcalc and a t.rast.algebra in newer versions...<br></div>I installed grass71 and as you said, 


        
        
        
        


<p style="margin-right:0mm;margin-top:0mm;border:1px solid rgb(255,127,102);padding:1.02mm;line-height:100%" align="left">
<font color="#3e454c"><font face="Courier 10 Pitch"><font style="font-size:10pt" size="2">t.rast.algebra
expression="ndvi_diff = ndvi[0] - ndvi[1]"
basename=ndvi_diff</font></font></font></p>

worked perfect! Much easy than the old mapcalc and for loop version!<br> I'm really enjoying the grass 7 temporal framework!<br></div><div> Thanks for the fast (and accurate) answer!<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-08-27 10:04 GMT-03:00 Veronica Andreo <span dir="ltr"><<a href="mailto:veroandreo@gmail.com" target="_blank">veroandreo@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hola Leo!<div><br></div><div>You should use t.rast.algebra (<a href="https://grass.osgeo.org/grass71/manuals/t.rast.algebra.html" target="_blank">https://grass.osgeo.org/grass71/manuals/t.rast.algebra.html</a>) from GRASS GIS 7.1 for that kind of temporal algebra operation. The command should be like:</div><div><br></div><div>t.rast.algebra expression="ndvi_a = ndvi[1] - ndvi[0]" basename=ndvi_a <br></div><div><br></div><div>For more examples on temporal modules, you can see: </div><div><a href="https://grasswiki.osgeo.org/wiki/Temporal_data_processing" target="_blank">https://grasswiki.osgeo.org/wiki/Temporal_data_processing</a><br></div><div><br></div><div>HTH,</div><div>Vero</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">2015-08-27 9:52 GMT-03:00 Leonardo Hardtke <span dir="ltr"><<a href="mailto:leohardtke@gmail.com" target="_blank">leohardtke@gmail.com</a>></span>:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Dear GRASS users:<br><div>I'm experienced grass user...  I use GRASS since I started my PhD research in landscape ecology back in 2009...<br></div>I'm trying to calculate the difference of NDVI between consecutive dates. I used to do it like:<br><br><div style="margin-left:40px">i=0<br>for map in $(g.list rast pattern=MOD13Q1*_01_*); do <br>    NDVI[i]=$map<br>    echo "Adding: " $map<br>    let i=i+1<br>done<br><br>for id in $(seq 0 $(echo ${#NDVI[@]})); do<br>echo $id<br> r.mapcalc "ndvi_dif2_$id = ${NDVI[$id+1]} - ${NDVI[id]}"<br>done<br></div><br>But
 i thing there must be an easier way using the grass 7 temporal 
framework. So i registred my dataset and tried the following....<br><br><div style="margin-left:40px">t.rast.list input=ndvi@ts<br>MOD13Q1.A2009001.h12v12.005.2009019145228_01_4326|ts|2009-01-01 00:00:00|2009-01-17 00:00:00<br>MOD13Q1.A2009017.h12v12.005.2009035110230_01_4326|ts|2009-01-17 00:00:00|2009-02-02 00:00:00<br>............................................................................................<br>MOD13Q1.A2010337.h12v12.005.2010355100650_01_4326|ts|2010-12-03 00:00:00|2010-12-19 00:00:00<br>MOD13Q1.A2010353.h12v12.005.2011005202724_01_4326|ts|2010-12-19 00:00:00|2011-01-04 00:00:00<br><br><br>t.rast.mapcalc input=ndvi expression="ndvi[1] - ndvi[0]" output=ndvi_a  basename=ndvi_a <br></div><div><br></div><div>But the output is not good (see attached file: left is OK, rigth is wrong)<br></div><div>Am I doing something wrong?<br></div>Thanks!<div><div><img src="https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif"></div></div><div><div dir="ltr">Dr. Leonardo A. Hardtke   <br>Laboratorio de Teledetección y S.I.G.  <br>Centro Nacional Patagónico (CONICET) <br>Bvd. Brown 2825, 9120 <br>Puerto Madryn, Chubut, Argentina </div></div>
</div>
<br></div></div>_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org" target="_blank">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><br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr">Dr. Leonardo A. Hardtke   <br>Laboratorio de Teledetección y S.I.G.  <br>Centro Nacional Patagónico (CONICET) <br>Bvd. Brown 2825, 9120 <br>Puerto Madryn, Chubut, Argentina </div></div>
</div>