Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
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.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
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. Listen and type the numbers you hear
 
Brigitte  
View profile  
 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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Coyote  
View profile  
 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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
wlandsman  
View profile  
 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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brigitte  
View profile  
 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

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »