Thank you for the links that helped to understand more how the things are working within GRASS. <br><br>For the moment I decided to use <br>r.mapcalc QA_field1=&quot;(QA&gt;&gt;bit_position_field1)% bit_length_field1&quot;<br>
for the different fields and then combining the files obtained into a mask.<br><br>Thanks<br><br>Laura<br><br><div class="gmail_quote">2009/6/15 Hamish <span dir="ltr">&lt;<a href="mailto:hamish_b@yahoo.com">hamish_b@yahoo.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br>
Laura Poggio wrote:<br>
&gt; I am trying to use the QA information of MODIS products. I<br>
&gt; found that this analysis can be done in GRASS with<br>
&gt; r.bitpattern (from Neteler, 2005 with some examples)<br>
&gt; or with r.mapcalc .<br>
&gt;<br>
&gt; From what I understood, the use of r.mapcal seems to be<br>
&gt; more flexible. I am just wondering if there are some code<br>
&gt; examples using the bitwise operators of mapcalc.<br>
<br>
</div>this doesn&#39;t answer your question directly, but maybe it is of<br>
interest:<br>
  <a href="http://grass.osgeo.org/wiki/MODIS" target="_blank">http://grass.osgeo.org/wiki/MODIS</a><br>
<br>
and quality layer application method here<br>
  <a href="http://grass.osgeo.org/wiki/AVHRR" target="_blank">http://grass.osgeo.org/wiki/AVHRR</a><br>
<font color="#888888"><br>
<br>
<br>
Hamish<br>
<br>
</font>&gt; From what I understood, the use of r.mapcal seems to be more flexible.<br>
&gt; I am just wondering if there are some code examples using the bitwise<br>
&gt; operators of mapcalc. I found the following code:<br>
&gt; &quot;lst_filt = (lstmap ~ [XX XX XX 00]) || (lstmap ~ [XX XX 0X 01])&quot;<br>
&gt; but to me it is not really clear how this works, especially compared<br>
&gt; to the code provided (and explained) by Glynn Clements:<br>
&gt; r.mapcalc MASK=&quot;if((sur_refl_qc_250 / 16) % 16 == 11 , 1, null())&quot;<br>
&gt;<br>
&gt; Thank you very much for any help.<br>
&gt;<br>
&gt; Laura<br><font color="#888888">
<br>
<br>
</font>2009/6/15 Nikos Alexandris <span dir="ltr">&lt;<a href="mailto:nikos.alexandris@felis.uni-freiburg.de">nikos.alexandris@felis.uni-freiburg.de</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div id=":zk" class="ii gt">Hi Laura!<br>
<br>
I am sending you some notes of mine off-list. Also, check...<br>
<br>
&quot;In the upcoming release of GRASS (version 7) there is an extra module<br>
to derive such quality layers called i.modis.qc&quot; ;<br>
<br>
Yann Chemin, International Rice Research Institute, The Philippines,<br>
<a href="http://svn.osgeo.org/grass/grass/trunk/imagery/i.modis.qc/i.modis.qc.html" target="_blank">http://svn.osgeo.org/grass/grass/trunk/imagery/i.modis.qc/i.modis.qc.html</a><br>
<br>
Regards, Nikos</div></blockquote><br></blockquote></div><br>