<br><font size=2 face="sans-serif">Dear All,</font><br><br><font size=2 face="sans-serif">i am having some issues with analysing
&nbsp;MOD09 modis data in grass. &nbsp;I would like to mask out the cloud
pixels using the below quality control band.</font><br><font size=2 face="sans-serif">when i import this band the unsigned
16bit integer is converted in decimal and I am unsure how to &nbsp;use
r.mapcalc to create a mask based on the different bits. </font><br><br><font size=2 face="sans-serif">I am unsure how I should go about this
(see *** section below). I would like to try different selections to see
which would make the best mask but i am unsure how to do this against a
binary field </font><br><br><font size=2 face="sans-serif">eg. r.mapcalc MASK=&quot;if(sur_refl_qc_250
== **** clear state **** , 1, null())&quot;</font><br><br><font size=2 face="sans-serif">how do I select out the different bits
to create the mask?</font><br><br><font size=2 face="sans-serif">At this stage i am thinking of trying
to convert the decimal back to binary (not sure how to do this ) and then
subselect columns (bits) eg 0-1 or 2-3 and the placing an if statement
(eg. if column01 == &quot;00&quot; or if column23 = &quot;00&quot;).</font><br><br><font size=2 face="sans-serif">Any guidance would be much appreciated.</font><br><br><br><font size=2 face="sans-serif">kind regards</font><br><br><font size=2 face="sans-serif">Andrew</font><br><br><br><font size=2 face="Arial"><b>sur_refl_qc_250m:</b> </font><br><font size=2><br></font><table width=100%><tr><td width=4% bgcolor=white><font size=2 face="Arial"><b>Bit</b></font><td width=95% bgcolor=white><font size=2 face="Arial"><b>Description</b></font><tr valign=top><td bgcolor=white><font size=2 face="Arial">0-1</font><td bgcolor=white><font size=2 face="Arial">MODLAND QA bits;<br>00 -- corrected product produced at ideal quality -- all bands<br>01 -- corrected product produced, less than ideal quality -- some or all
bands<br>10 -- corrected product not produced due to cloud effects -- all bands<br>11 -- corrected product not produced for other reasons -- some or all bands,
may be fill value<br>[Note that a value of (11) overrides a value of (01)]</font><tr valign=top><td bgcolor=white><font size=2 face="Arial">2-3</font><td bgcolor=white><font size=2 face="Arial">cloud state;<br>00 -- clear<br>01 -- cloudy<br>10 -- mixed<br>11 -- not set, assumed clear</font><tr valign=top><td bgcolor=white><font size=2 face="Arial">4-7</font><td bgcolor=white><font size=2 face="Arial">band 1 data quality, four bit
range;<br>0000 -- highest quality<br>1000 -- dead detector; data has been copied from adjacent detector<br>1001 -- solar zenith &gt;= 86 degrees<br>1010 -- solar zenith &gt;= 85 and &lt; 86 degrees<br>1011 -- missing input<br>1100 -- internal constant used in place of climatological data for at least
one atmospheric constant<br>1101 -- correction out of bounds, pixel constrained to extreme allowable
value<br>1110 -- L1B data faulty<br>1111 -- not processed due to deep ocean or clouds</font><tr valign=top><td bgcolor=white><font size=2 face="Arial">8-11</font><td bgcolor=white><font size=2 face="Arial">band 2 data quality, four bit
range;<br>(same values as above)</font><tr valign=top><td bgcolor=white><font size=2 face="Arial">12</font><td bgcolor=white><font size=2 face="Arial">atmospheric correction performed;<br>0 -- no<br>1 -- yes</font><tr valign=top><td bgcolor=white><font size=2 face="Arial">13</font><td bgcolor=white><font size=2 face="Arial">adjacency correction performed;<br>0 -- no<br>1 -- yes</font><tr valign=top><td bgcolor=white><font size=2 face="Arial">14</font><td bgcolor=white><font size=2 face="Arial">different orbit from 500m;<br>0 -- no<br>1 -- yes</font><tr valign=top><td bgcolor=white><font size=2 face="Arial">15</font><td bgcolor=white><font size=2 face="Arial">unused (spare)</font></table><br><br><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>