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

Home » Public Forums » archive » Re: extracting bits from bytes
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: extracting bits from bytes [message #1527] Tue, 30 November 1993 14:16 Go to previous message
ryba is currently offline  ryba
Messages: 33
Registered: October 1992
Member
|> mask = bytarr(8)
|> for i=0,7 do mask(i)=2^i

Getting closer....try

tmp = lindgen(32) ; For Bill's routine handling up to 4 bytes
mask = 2L^tmp
out = (in and mask) ne 0

For arrays of inputs, you can use rebin:
ninbytes = n_elements(in)
tmp = rebin(lindgen(32),32,ninbytes)

etc....

--
Dr. Marty Ryba | Generation X:
MIT Lincoln Laboratory | Too young to be cynical,
ryba@ll.mit.edu | too old to be optimistic.
Of course nothing I say here is official policy, and Laboratory affiliation is
for identification purposes only, blah, blah, blah....
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Colorado Demo PV-Wave
Next Topic: IDL3.5.0: contour is still broken :-((((

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

Current Time: Sun Oct 12 07:16:11 PDT 2025

Total time taken to generate the page: 1.04346 seconds