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

Home » Public Forums » archive » Unexpected rebin behavior
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: Unexpected rebin behavior [message #36367 is a reply to message #36271] Wed, 03 September 2003 10:02 Go to previous messageGo to previous message
mchinand is currently offline  mchinand
Messages: 66
Registered: September 1996
Member
In article <3F561762.B0B31F0B@saicmodis.com>,
James Kuyper <kuyper@saicmodis.com> wrote:
> Mike Chinander wrote:
>>
>> Performing rebin on 2-d (or any higher dimension) integer arrays sometimes
>> give results I didn't expect. Here's a trivial example array:
>>
>> IDL> help, b
>> B INT = Array[2, 2]
>>
>> IDL> print, b
>> 8 9
>> 10 13
>>
>> Minifying this to a 1x1 array with rebin gives:
>>
>> IDL> print, rebin(b,1,1)
>> 9
>>
>> But,
>>
>> IDL> print, fix(total(b)/4)
>> 10
>
> What it's doing is total(b/4), rather than total(b)/4. This has the
> advantage of handling large numbers without producing overflow. It has
> the disadvantage of underflowing for very small numbers, and producing
> wierd results when re-binning integer data.

Then why does rebin of the transpose give a different result?

IDL> print, rebin(transpose(b),1,1)
10

If it were just doing total(b/4), b and tranpose(b) should give the same
results.

--Mike Chinander

--
Michael Chinander
m-chinander@uchicago.edu
Department of Radiology
University of Chicago
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Can a CALL_EXTERNAL .dll create a window?
Next Topic: Can a CALL_EXTERNAL .dll create a window?

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

Current Time: Sun Oct 12 09:39:35 PDT 2025

Total time taken to generate the page: 0.96125 seconds