<br><font size=2 face="sans-serif">Okay - unfortunately i am now totally
confused. I have tried to read up on binary data (to little or no avail!!!).
My understanding is the MODIS suf_refl_qc data that i have import is a
unsigned 16 bit integer number. I would like to select out pixels using
this raster &nbsp;to create a cloud mask based on some of the bit codes.</font><br><br><font size=2 face="sans-serif">for example identify &quot; band 1 quality
= missing input&quot; would have the following </font><br><br><font size=2 face="sans-serif">&nbsp;* * * * 1 0 1 1 * * * * * * *
* * - where * represents placeholder</font><br><br><font size=2 face="sans-serif">If i try and follow Glynn's logic he
is saying divide the number by 16 and then take the modulus 16 and then
equate it to &quot;11&quot; to get the subset. </font><br><br><font size=2 face="sans-serif">I am unsure how I choose the &quot;11&quot;
and how do i change the syntax to pull out the different masks i may be
interested in.</font><br><br><font size=2 face="sans-serif">0 0 * * * * * * * * * * * * * * &nbsp;
ideal quality all bands</font><br><font size=2 face="sans-serif">0 1 * * * * * * * * * * * * * * less
than ideal quality</font><br><font size=2 face="sans-serif">* * 0 0 * * * * * * * * * * * * clear</font><br><font size=2 face="sans-serif">* * 0 1 * * * * * * * * * * * * cloudy</font><br><font size=2 face="sans-serif">* * 1 0 * * * * * * * * * * * * mixed</font><br><font size=2 face="sans-serif">* * * * 0 0 0 0* * * * * * * * highest
quality band 1</font><br><font size=2 face="sans-serif">* * * * * * * * * 0 0 0 0* * * highest
quality band 2</font><br><font size=2 face="sans-serif">etc...</font><br><br><font size=2 face="sans-serif">Any help would be greatly appreciated.
At this stage im plugging in the decimal numbers into binary calculator
and using r.reclass to create a MASK.</font><br><br><font size=2 face="sans-serif">best regards</font><br><br><font size=2 face="sans-serif">Andrew</font><br><font size=2 face="sans-serif"><br></font><br><br><font size=2 face="sans-serif"><br></font><br><br><br><table width=100%><tr valign=top><td width=40%><font size=1 face="sans-serif"><b>Glynn Clements &lt;glynn@gclements.plus.com&gt;</b></font><br><font size=1 face="sans-serif">Sent by: grassuser-bounces@grass.itc.it</font><p><font size=1 face="sans-serif">05/28/2007 09:14 AM</font><td width=59%><table width=100%><tr><td><div align=right><font size=1 face="sans-serif">To</font></div><td valign=top><font size=1 face="sans-serif">Hamish &lt;hamish_nospam@yahoo.com&gt;</font><tr><td><div align=right><font size=1 face="sans-serif">cc</font></div><td valign=top><font size=1 face="sans-serif">grassuser@grass.itc.it</font><tr><td><div align=right><font size=1 face="sans-serif">Subject</font></div><td valign=top><font size=1 face="sans-serif">Re: [GRASS-user] help to
use r.mapcalc with decimal/binary (modis &nbsp; &nbsp; &nbsp; &nbsp;data)</font></table><br><table><tr valign=top><td><td></table><br></table><br><br><br><font size=2><tt><br>Hamish wrote:<br><br>&gt; &gt; Oops; I could have sworn that r.mapcalc understood hex. Sorry;
you'll<br>&gt; &gt; need to use decimal values, e.g.<br>&gt; &gt; <br>&gt; &gt; r.mapcalc MASK=&quot;if(sur_refl_qc_250 &amp; 240 == 176 , 1,
null())&quot;<br>&gt; <br>&gt; so r.mapcalc can do bitwise &amp; |? (nothing about that in the help
pages)<br><br>Damn, no, that neither.<br><br>Third attempt:<br><br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
r.mapcalc MASK=&quot;if((sur_refl_qc_250 / 16) % 16 == 11 , 1, null())&quot;<br><br>I'll look at adding the missing functionality to r.mapcalc.<br><br>-- <br>Glynn Clements &lt;glynn@gclements.plus.com&gt;<br><br>_______________________________________________<br>grassuser mailing list<br>grassuser@grass.itc.it<br>http://grass.itc.it/mailman/listinfo/grassuser<br></tt></font><br><BR>
This email and any files transmitted with it are confidential, may be legally privileged and are intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient, you are hereby notified that any use, distribution, or reproduction of the contents of this email is strictly prohibited and may be unlawful. If you are not the intended recipient, please notify the sender by return email and destroy all copies of the original message including any attachments thereto. <BR>
Thank you.<BR>