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 #68091 is a reply to message #68072] Fri, 18 September 2009 06:25 Go to previous messageGo to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
On Sep 18, 5:54 am, emitchard <emitch...@googlemail.com> wrote:
[skip]

> 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?

For the record (in case somebody needs that):

IDL> x=2LL^45+2LL^35+2LL^32+2LL^31+2LL^25+2LL^15+2LL^5-1 & print,x
35225207865375

;get only 32 bits
IDL> a=string(ulong(x),format='(B)') & print,a
10000010000000001000000000011111

;get all bits
IDL> a=string(x,format='(B)') & print,a
1000000000100110000010000000001000000000011111

Ciao,
Paolo

>
> Many thanks for your help,
>
> Edward Mitchard
[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: Sun Oct 12 00:39:50 PDT 2025

Total time taken to generate the page: 1.19510 seconds