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

Home » Public Forums » archive » Re: Integer Array into Binary Array
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: Integer Array into Binary Array [message #67027 is a reply to message #67026] Thu, 25 June 2009 10:02 Go to previous message
vikramivatury is currently offline  vikramivatury
Messages: 24
Registered: May 2009
Junior Member
On Jun 25, 12:59 pm, Vikram <vikramivat...@gmail.com> wrote:
> Hello,
>
> I was wondering if there was a way of converting an integer array into
> binary?
> For example, we have an integer array with the following:
>
> test = [1,2,3]
>
> If we convert this to a binary array, we should get:
>
> 000000000000000100000000000000100000000000000100, etc.
>
> Is this possible in IDL?
>
> Thanks,
> Vikram

I have made use of Dr. Fanning's BINARY.PRO and I have written
something:

img = read_tiff('Resol_Test2C.tiff')

target = lonarr(4,1280,1024)

bin = where(img gt 0.0)
num = n_elements(bin)
target[bin] = img[bin]

num = n_elements(target)

output = lonarr(4,5,5)

test = [343,494]

for x=0, n_elements(test)-1 do begin
output[x] = binary(test[x],/color)
endfor

---------
But if I do a print,output I can only get the binary for the 494, not
both 343 and 494 in the same array. Any ideas?

Thanks,
Vikram
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Integer Array into Binary Array
Next Topic: Saving XYOUTS

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

Current Time: Fri Oct 10 15:33:14 PDT 2025

Total time taken to generate the page: 1.67556 seconds