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

Home » Public Forums » archive » REBIN Question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
REBIN Question [message #11091] Sat, 14 March 1998 00:00 Go to previous message
pford is currently offline  pford
Messages: 33
Registered: September 1996
Member
REBIN question


Either I have uncovered a bug in REBIN in the Mac version of IDL V 5.0.3
or I don�t fully understand how REBIN works. I want to take a 2-D byte
array at_target that is 64X64 in size and make it into a 1-D byte array
with the same number of elements and vis versa. The results are not what
I am expecting so I used the code below to test it. The displayed images
are not even close to each other.

Would someone be kind enough to explain why and how I can do this other
than using the code below(test2) the offending section.

Thanks.


pro test
window,5,xsize= 128, ysize = 128
window,6,xsize= 128, ysize = 128

at_target= bytarr(64,64)
at_target(0:63,0:63) = 255B
at_target(10:20,10:20) = 200B;

wset,5
tvscl, at_target
wset,6
tvscl, rebin(rebin(at_target, 64*64),64,64)
stop
end

pro test2

window,5,xsize= 128, ysize = 128
window,6,xsize= 128, ysize = 128

at_target = bytarr(64,64)
at_target2 = bytarr(64,64)
at_target(0:63,0:63) = 255B
at_target(10:20,10:20) = 200B;

d1target = btarr(64*64)
n=0
for x=0,63 do begin
for y=0,63 do begin
d1target[n] = at_target[x,y]
at_target2 [x,y] = d1target[n]
n = n + 1
endfor; for y=0,63 do begin
endfor; for x=0,63 do begin

wset,5
tvscl, at_target
wset,6
tvscl, at_target2
stop
end

--
Patrick Ford
pford@bcm.tmc.edu
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: A little handy date function
Next Topic: Want to get Array(48) instead of Array(1,48)

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

Current Time: Wed Oct 08 14:52:44 PDT 2025

Total time taken to generate the page: 0.00413 seconds