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

Home » Public Forums » archive » Re: Neither CONGRID nor REBIN...?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Neither CONGRID nor REBIN...? [message #48700] Wed, 17 May 2006 10:52
news.verizon.net is currently offline  news.verizon.net
Messages: 47
Registered: August 2003
Member
The /INTERP keyword to CONGRID does use linear interpolation but as the
documentation notes:

REBIN averages multiple points when shrinking an array, while CONGRID
just resamples the array.

For example, if you are shrinking to a size that is an exact multiple
(e.g. from 500 x 500 to 100 x 100) then adding the /INTERP keyword to
CONGRID does absolutely nothing, since each pixel in the output image
can be precisely mapped to a pixel on the input image. If you are
not shrinking to an exact mulitple of the input size (e.g. 500 x 500 to
99 x 99) , then /INTERP provides more precise sampling, but still only
samples every ~5th pixel rather than averaging.

--Wayne
Re: Neither CONGRID nor REBIN...? [message #48704 is a reply to message #48700] Wed, 17 May 2006 08:30 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
greg michael wrote:
> I want to reduce an image by an arbitrary factor and have that it still
> looks ok - i.e. the pixels should be somehow averaged, not just
> sampled. CONGRID can handle the arbitrary part and REBIN the averaging
> part, but neither both. Anyone know a simple solution?
>
> thanks,
> Greg
>

The /INTERP keyword will make CONGRID use linear interpolation.

Mike
--
www.michaelgalloy.com
Re: Neither CONGRID nor REBIN...? [message #48707 is a reply to message #48704] Wed, 17 May 2006 07:05 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
greg michael wrote:
> Thanks Wayne - looks to be just what I need. Must admit, I'm surprised
> CONGRID doesn't do this anyway. As for flux conservation, I think
> that's just a fancy way of saying 'average'!

More accurately, it's a fancy way of doing averaging. When your new
bins are related in the right way to your old bins, calculating the
right average for the new bins is relatively simple. When they aren't,
it can be highly non-trivial, and flux-conserving algorithms cope with
some of the problems that can arise.
Re: Neither CONGRID nor REBIN...? [message #48710 is a reply to message #48707] Wed, 17 May 2006 04:18 Go to previous message
greg michael is currently offline  greg michael
Messages: 163
Registered: January 2006
Senior Member
Thanks Wayne - looks to be just what I need. Must admit, I'm surprised
CONGRID doesn't do this anyway. As for flux conservation, I think
that's just a fancy way of saying 'average'!

regards,
Greg
Re: Neither CONGRID nor REBIN...? [message #48711 is a reply to message #48710] Wed, 17 May 2006 03:29 Go to previous message
Wayne Landsman is currently offline  Wayne Landsman
Messages: 117
Registered: January 1997
Senior Member
"greg michael" <greg.michael@gmail.com> wrote in message
news:1147859650.649956.118330@i40g2000cwc.googlegroups.com.. .
>
> I want to reduce an image by an arbitrary factor and have that it still
> looks ok - i.e. the pixels should be somehow averaged, not just
> sampled. CONGRID can handle the arbitrary part and REBIN the averaging
> part, but neither both. Anyone know a simple solution?

You might try the function frebin.pro in
http://idlastro.gsfc.nasa.gov/ftp/pro/image/frebin.pro
From the documentation

; EXPLANATION:
; FREBIN is an alternative to CONGRID or REBIN. Like CONGRID it
; allows expansion or contraction by an arbitary amount. ( REBIN requires
; integral factors of the original image size.) Like REBIN it conserves
; flux by ensuring that each input pixel is equally represented in the
output
; array. The fact that frebin.pro conserves flux might be overkill
for you since you just want to ensure that the reduced image looks OK. But
image reduction should run pretty quickly.--Wayne Landsman
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: ENVI_OUTPUT_TO_EXTERNAL_FORMAT
Next Topic: Subscription of array (the *-problem)

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

Current Time: Wed Oct 08 09:10:40 PDT 2025

Total time taken to generate the page: 0.00509 seconds