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

Home » Public Forums » archive » Re: Array resize with arbitrary arithmetic
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: Array resize with arbitrary arithmetic [message #52942] Mon, 12 March 2007 15:15 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

>> image=read_bmp('9 March 2007\775u.bmp') ; 640x240 array
>> temp = Rebin(image, 2, 320, 240)
>> temp = Total(Temporary(temp), 1)
>
> Whoops, that REBIN command should be REFORM. :-)

Let this be a lesson to those of you who think you
can answer IDL questions at the same time you are
working on something else. Sheesh!

I *think* the answer to the original question, which
looks to me like we want to multiply the first pixel
by 256 and add the second, adjacent pixel to it (does
that seem weird to you!?) is this:

image=read_bmp('9 March 2007\775u.bmp') ; 640x240 array
temp = Rebin(image, 2, 320, 240) ; Adjacent pixels in cols
temp[0,*,*] = temp[0,*,*] * 256 ; Multiply 1st col by 256.
temp = Total(temp,1) ; Add columns together.

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.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Sky Falling, etc. : Array substitution + addition with plus-equal (+=)
Next Topic: contours property sheet

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

Current Time: Fri Oct 10 07:41:29 PDT 2025

Total time taken to generate the page: 1.59983 seconds