The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Mean preserving interpolation (conservative interpolation)
 There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic. There was an error processing your request. Please try again. Standard view   View as tree
 4 messages

From:
To:
Cc:
Followup To:
Subject:
 Validation: For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon.

More options Oct 16 2012, 12:17 pm
Newsgroups: comp.lang.idl-pvwave
From: Brigitte <mb.brigi...@gmail.com>
Date: Tue, 16 Oct 2012 09:17:39 -0700 (PDT)
Local: Tues, Oct 16 2012 12:17 pm
Subject: Mean preserving interpolation (conservative interpolation)
When I interpolate y=congrid(x,ny,/interp) an array, the mean of the original array (x) is different from the mean of the interpolated array (y). Is there a function or keyword to preserve the mean?

I am new to this user group - hope the question is understandable and there is an answer! Thanks a lot in advance.

To post a message you must first join this group.
You do not have the permission required to post.
More options Oct 16 2012, 12:52 pm
Newsgroups: comp.lang.idl-pvwave
From: Coyote <sageande...@gmail.com>
Date: Tue, 16 Oct 2012 09:52:39 -0700 (PDT)
Local: Tues, Oct 16 2012 12:52 pm
Subject: Re: Mean preserving interpolation (conservative interpolation)

Brigitte writes:
> When I interpolate y=congrid(x,ny,/interp) an array, the mean of the original array (x) is different from the mean of the interpolated array (y). Is there a function or keyword to preserve the mean?

The keyword you are looking for is MINUS_ONE:

IDL> x = (Findgen(100)+1)*4
IDL> print, Mean(x)
202.000
IDL> print, mean(congrid(x, 200, /minus_one))
202.000
IDL> print, mean(congrid(x, 5250, /minus_one))
202.000
IDL> print, mean(congrid(x, 5250, /interp, /minus_one))
202.000
IDL> print, mean(congrid(x, 367, /interp, /minus_one))
202.000

Cheers,

David

To post a message you must first join this group.
You do not have the permission required to post.
More options Oct 16 2012, 1:14 pm
Newsgroups: comp.lang.idl-pvwave
From: wlandsman <wlands...@gmail.com>
Date: Tue, 16 Oct 2012 10:14:24 -0700 (PDT)
Local: Tues, Oct 16 2012 1:14 pm
Subject: Re: Mean preserving interpolation (conservative interpolation)

On Tuesday, October 16, 2012 12:52:39 PM UTC-4, Coyote wrote:

> The keyword you are looking for is MINUS_ONE:

While the /MINUS_ONE keyword works for your particular example, I don't believe it is a general solution.     I'd suggest frebin.pro ( http://idlastro.gsfc.nasa.gov/ftp/pro/image/frebin.pro ) as a flux-conserving alternative to CONGRID.

IDL> x = randomn(seed,100)*10
IDL> y = congrid(x,367,/minus_one,/interp)
IDL> z = frebin(x,367)
IDL> print,mean(x),mean(y),mean(z)
-0.593289    -0.546786    -0.593280

To post a message you must first join this group.
You do not have the permission required to post.
More options Oct 17 2012, 5:35 am
Newsgroups: comp.lang.idl-pvwave
From: Brigitte <mb.brigi...@gmail.com>
Date: Wed, 17 Oct 2012 02:35:55 -0700 (PDT)
Local: Wed, Oct 17 2012 5:35 am
Subject: Re: Mean preserving interpolation (conservative interpolation)
Thank you both for the answer.
frebin does a good job!
Cheers,
Brigitte