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

Home » Public Forums » archive » What is like CONGRID, but averages on reduction?
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: What is like CONGRID, but averages on reduction? [message #5174 is a reply to message #5108] Mon, 16 October 1995 00:00 Go to previous messageGo to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
grunes@news.nrl.navy.mil (Mitchell R Grunes) writes:

> In article <45gk07$ahc@post.gsfc.nasa.gov> thompson@orpheus.nascom.nasa.gov (William Thompson) writes:
>> ...I think this should do what you want...

> No. Your procedure truncates the edges. E.G., try
> a=intarr(9,9)
> a(8,8)=10
> print,reduce(a,2,2)

> You will get all 0's.

You are correct. However, the following counterexample will not produce all
zeros.

IDL> A=intarr(8,8)
IDL> A(7,7)=10
IDL> print,reduce(A,2)
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 2

(If A had been a floating point array, instead of an integer one, the nonzero
pixel would have been 2.5 instead of 2.)

The routine works by trimming off just enough of the edge so that the array
dimensions are then multiples of the reduction factor. For example, if one
wants to reduce a 1000x1000 array by three, then the first step is to trim off
the edge to make it a 999x999 array. I've always found this acceptable for
what I wanted to do, but I can understand if you do not.

Bill Thompson
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Using _extra for all routines?
Next Topic: Re: HELP: IDL Function/Variable Problem

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

Current Time: Sat Oct 11 15:41:21 PDT 2025

Total time taken to generate the page: 1.28208 seconds