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  to create a cloud mask 
based on some of the bit codes.

for example identify " band 1 quality = missing input" would have the 
following 

 * * * * 1 0 1 1 * * * * * * * * * - where * represents placeholder

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 "11" to get the subset. 

I am unsure how I choose the "11" and how do i change the syntax to pull 
out the different masks i may be interested in.

0 0 * * * * * * * * * * * * * *   ideal quality all bands
0 1 * * * * * * * * * * * * * * less than ideal quality
* * 0 0 * * * * * * * * * * * * clear
* * 0 1 * * * * * * * * * * * * cloudy
* * 1 0 * * * * * * * * * * * * mixed
* * * * 0 0 0 0* * * * * * * * highest quality band 1
* * * * * * * * * 0 0 0 0* * * highest quality band 2
etc...

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.

best regards

Andrew








Glynn Clements <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
05/28/2007 09:14 AM

To
Hamish <[EMAIL PROTECTED]>
cc
grassuser@grass.itc.it
Subject
Re: [GRASS-user] help to use r.mapcalc with decimal/binary (modis data)







Hamish wrote:

> > Oops; I could have sworn that r.mapcalc understood hex. Sorry; you'll
> > need to use decimal values, e.g.
> > 
> > r.mapcalc MASK="if(sur_refl_qc_250 & 240 == 176 , 1, null())"
> 
> so r.mapcalc can do bitwise & |? (nothing about that in the help pages)

Damn, no, that neither.

Third attempt:

                 r.mapcalc MASK="if((sur_refl_qc_250 / 16) % 16 == 11 , 1, 
null())"

I'll look at adding the missing functionality to r.mapcalc.

-- 
Glynn Clements <[EMAIL PROTECTED]>

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser



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. 
Thank you.
_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

Reply via email to