<div dir="ltr"><div><div>Not sure that will give you a solution, but an r.mapcalc expression in grass 7.1 should look like:<br><br>r.mapcalc --overwrite expression="bla = NDVI_1_h11v11 - NDWI_1_h11v11"<br><br></div>In other words 1) the --o flag in grass 6.4 was changed to --overwrite in grass 7 and higher, and 2) there should be a space before the
first <em>=</em> sign. </div><div><br>Check out: <a href="http://grass.osgeo.org/grass71/manuals/r.mapcalc.html">http://grass.osgeo.org/grass71/manuals/r.mapcalc.html</a> <br><br></div><div>Paulo<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 8, 2014 at 10:23 PM, Diana Brito <span dir="ltr"><<a href="mailto:dianisbrito2@gmail.com" target="_blank">dianisbrito2@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi list, <div><br></div><div>first, i'm new with grass </div><div><br></div><div>Im trying to do some math calculations with r.mapcalc, but my result allways is nan. </div><div><br></div><div>When I display the image I can see different values, not only nan.<br></div><div><br></div><div>Thanks</div><div><br></div><div><br></div><div><br></div><div><div>GRASS 7.1.svn (sequia):/opt/grass_trunk/bin.x86_64-unknown-linux-gnu > <a href="http://r.info" target="_blank">r.info</a> NDVI_1_h11v11</div><div><br></div><div> +----------------------------------------------------------------------------+</div><div> | Map: NDVI_1_h11v11 Date: Mon Dec 1 05:12:28 2014 |</div><div> | Mapset: sequia Login of Creator: polzader |</div><div> | Location: sequia |</div><div> | DataBase: /home/polzader/Documentos/grassdata_diana_bpr |</div><div> | Title: ( NDVI_1_h11v11 ) |</div><div> | Timestamp: none |</div><div> |----------------------------------------------------------------------------|</div><div> | |</div><div> | Type of Map: raster Number of Categories: 0 |</div><div> | Data Type: DCELL |</div><div> | Rows: 4409 |</div><div> | Columns: 7499 |</div><div> | Total Cells: 33063091 |</div><div> | Projection: Latitud - Longitud. |</div><div> | N: 19:54:02.16S S: 30:01:58.200271S Res: 0:00:08.273087 |</div><div> | E: 63:35:44.521118W W: 80:49:44.4W Res: 0:00:08.273087 |</div><div> | Range of data: min = -2000 max = 9090 |</div><div> | |</div><div> | Data Description: |</div><div> | generated by r.series |</div><div> | |</div><div> | Comments: |</div><div> | r.series input="MOD13Q1.A2004001.h11v11.005.2007235231758.250m_16_da\ |</div><div> | ys_NDVI,MOD13Q1.A2005001.h11v11.005.2007352072715.250m_16_days_NDVI,\ |</div><div> | MOD13Q1.A2006001.h11v11.005.2008064055525.250m_16_days_NDVI,MOD13Q1.\ |</div><div> | A2007001.h11v11.005.2007021105928.250m_16_days_NDVI,MOD13Q1.A2008001\ |</div><div> | .h11v11.005.2008019102106.250m_16_days_NDVI,MOD13Q1.A2009001.h11v11.\ |</div><div> | 005.2009019230008.250m_16_days_NDVI,MOD13Q1.A2010001.h11v11.005.2010\ |</div><div> | 027061330.250m_16_days_NDVI,MOD13Q1.A2011001.h11v11.005.201102405534\ |</div><div> | 0.250m_16_days_NDVI,MOD13Q1.A2012001.h11v11.005.2012019103715.250m_1\ |</div><div> | 6_days_NDVI,MOD13Q1.A2013001.h11v11.005.2013018034332.250m_16_days_N\ |</div><div> | DVI,MOD13Q1.A2014001.h11v11.005.2014018092301.250m_16_days_NDVI,MOD1\ |</div><div> | 3Q1.A2004017.h11v11.005.2008224113415.250m_16_days_NDVI,MOD13Q1.A200\ |</div><div> | 5017.h11v11.005.2007353093413.250m_16_days_NDVI,MOD13Q1.A2006017.h11\ |</div><div> | v11.005.2008278011906.250m_16_days_NDVI,MOD13Q1.A2007017.h11v11.005.\ |</div><div> | 2007096165508.250m_16_days_NDVI,MOD13Q1.A2008017.h11v11.005.20080370\ |</div><div> | 54317.250m_16_days_NDVI,MOD13Q1.A2009017.h11v11.005.2009035200807.25\ |</div><div> | 0m_16_days_NDVI,MOD13Q1.A2010017.h11v11.005.2010036002816.250m_16_da\ |</div><div> | ys_NDVI,MOD13Q1.A2011017.h11v11.005.2011039201212.250m_16_days_NDVI,\ |</div><div> | MOD13Q1.A2012017.h11v11.005.2012046172118.250m_16_days_NDVI,MOD13Q1.\ |</div><div> | A2013017.h11v11.005.2013039191638.250m_16_days_NDVI,MOD13Q1.A2014017\ |</div><div> | .h11v11.005.2014038143732.250m_16_days_NDVI" output="NDVI_1_h11v11" \ |</div><div> | method="average" |</div><div> | |</div><div> +----------------------------------------------------------------------------+</div><div><br></div><div>GRASS 7.1.svn (sequia):/opt/grass_trunk/bin.x86_64-unknown-linux-gnu > <a href="http://r.info" target="_blank">r.info</a> NDWI_1_h11v11</div><div> +----------------------------------------------------------------------------+</div><div> | Map: NDWI_1_h11v11 Date: Mon Dec 1 05:49:38 2014 |</div><div> | Mapset: sequia Login of Creator: polzader |</div><div> | Location: sequia |</div><div> | DataBase: /home/polzader/Documentos/grassdata_diana_bpr |</div><div> | Title: ( NDWI_1_h11v11 ) |</div><div> | Timestamp: none |</div><div> |----------------------------------------------------------------------------|</div><div> | |</div><div> | Type of Map: raster Number of Categories: 0 |</div><div> | Data Type: DCELL |</div><div> | Rows: 4409 |</div><div> | Columns: 7499 |</div><div> | Total Cells: 33063091 |</div><div> | Projection: Latitud - Longitud. |</div><div> | N: 19:54:02.16S S: 30:01:58.200271S Res: 0:00:08.273087 |</div><div> | E: 63:35:44.521118W W: 80:49:44.4W Res: 0:00:08.273087 |</div><div> | Range of data: min = -9254.65838509317 max = 9247.07852234276 |</div><div> | |</div><div> | Data Description: |</div><div> | generated by r.mapcalc |</div><div> | |</div><div> | Comments: |</div><div> | (NIR_reflectance_1_h11v11 - MIR_reflectance_1_h11v11) / |</div><div> | (NIR_reflectance_1_h11v11 + MIR_reflectance_1_h11v11) * 10000 |</div><div> | |</div><div> +----------------------------------------------------------------------------+</div><div><br></div><div><br></div><div>r.mapcalc --o expression="bla=NDVI_1_h11v11 - NDWI_1_h11v11"</div><div>GRASS 7.1.svn (sequia):/opt/grass_trunk/bin.x86_64-unknown-linux-gnu > <a href="http://r.info" target="_blank">r.info</a> bla</div><div> +----------------------------------------------------------------------------+</div><div> | Map: bla Date: Mon Dec 8 18:04:41 2014 |</div><div> | Mapset: sequia Login of Creator: polzader |</div><div> | Location: sequia |</div><div> | DataBase: /home/polzader/Documentos/grassdata_diana_bpr |</div><div> | Title: ( bla ) |</div><div> | Timestamp: none |</div><div> |----------------------------------------------------------------------------|</div><div> | |</div><div> | Type of Map: raster Number of Categories: 0 |</div><div> | Data Type: DCELL |</div><div> | Rows: 2861 |</div><div> | Columns: 9350 |</div><div> | Total Cells: 26750350 |</div><div> | Projection: Latitud - Longitud. |</div><div> | N: 49:42:30.96S S: 60:04:18.329421S Res: 0:00:13.039975 |</div><div> | E: 46:24:51.430659W W: 80:16:55.2W Res: 0:00:13.039975 |</div><div> | Range of data: min = -nan max = -nan |</div><div> | |</div><div> | Data Description: |</div><div> | generated by r.mapcalc |</div><div> | |</div><div> | Comments: |</div><div> | NDVI_1_h11v11 - NDWI_1_h11v11 </div><div> | |</div><div> +----------------------------------------------------------------------------+</div></div><span class="HOEnZb"><font color="#888888"><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br clear="all"><div><br></div>-- <br><div><div dir="ltr">Diana Marcela Brito Hoyos<div>Biologa</div><div><a href="mailto:d.brito@javeriana.edu.co" target="_blank">d.brito@javeriana.edu.co</a></div><div><br></div><div><br></div></div></div>
</div></font></span></div>
<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" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br></blockquote></div><br></div>