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

Home » Public Forums » archive » Re: Mean preserving interpolation (conservative interpolation)
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: Mean preserving interpolation (conservative interpolation) [message #81799 is a reply to message #81798] Tue, 16 October 2012 09:52 Go to previous message
DavidF[1] is currently offline  DavidF[1]
Messages: 94
Registered: April 2012
Member
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
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Axis equal
Next Topic: Re: Axis equal

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

Current Time: Wed Oct 08 17:42:38 PDT 2025

Total time taken to generate the page: 0.00478 seconds