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 #67025 is a reply to message #67024] Thu, 25 June 2009 10:32 Go to previous messageGo to previous message
vikramivatury is currently offline  vikramivatury
Messages: 24
Registered: May 2009
Junior Member
On Jun 25, 1:16 pm, David Fanning <n...@dfanning.com> wrote:
> Vikram writes:
>> 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?
>
> BINARY produces string output. Maybe you want this:
>
> IDL> test = [343,494]
> IDL> print, test, format='(b24)'
>                101010111
>                111101110
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Ok, that makes sense. Is there a way of saving this binary into an
array? Or is the only way just printing it to the screen?

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: Sun Oct 12 02:39:30 PDT 2025

Total time taken to generate the page: 1.36600 seconds