comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Reading individual bits of MODIS BRDF quality files
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Reading individual bits of MODIS BRDF quality files [message #68072] Mon, 21 September 2009 01:38 Go to previous message
wita is currently offline  wita
Messages: 43
Registered: January 2005
Member
>
> Is there a function in IDL that can read individual bits, or any other
> clever way to produce an array of 1s and 0s from a 32-bit integer?

Hi Edward,

Compile the function below and run it trough ENVI Band math and it
will return an 0/1 map of the bit position that you specify. So for
retrieving
bit position 7 (integer value 128) use:

cgi_map_bitwise_flag(b1, 7)

with best regards,

Allard


FUNCTION cgi_map_bitwise_flag, statusmap, bitposition
return, BYTE((statusmap AND (2UL^bitposition))/(2UL^bitposition))
END
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: HDF: accessing VData in VGroup
Next Topic: idl on mac

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 09:31:56 PDT 2025

Total time taken to generate the page: 0.47459 seconds