[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sliding scale interpolation



Paul van Delst <pvandelst@ncep.noaa.gov> writes:

> Hi there,
> 
> I want to do (what I call) "sliding scale" linear interpolation and am
> trolling for hints on how to do it.
> 
> I have some data (complex refractive index of water) which is mostly
> smooth but punctuated with some higher resolution absorption features.
> What I would like to do would be to linearly interpolate the data with a
> relatively large x-spacing in the smooth, low resolution regions but
> increase the data spacing in the high resolution regions. The second
> derivative of the function provides definitions for those regions (e.g.
> for smooth regions d2y/dx2 ~ 0).
> 
> I was wondering if anyone has already done or seen info on something
> like this? I would like to somehow dampen the ability of the
> interpolation spacing change so that it doesn't change *only* in
> response to the second derivative (which is rather noisy in places).
> 
> Any hints, comments, suggestions appreciated.
> 

You may want to check out:

 D.G. Wilson, 1976, ACM Transactions on Mathematical Software,2,388
 http://www.mirror.ac.uk/sites/netlib.bell-labs.com/netlib/toms/510.gz

Basically, this code takes two vectors, x and y, and a tolerance
epsilon, and returns arrays xprime and yprime.  The guarantee is that 
if you then interpolate y based on xprime, yprime, and x the error
will be no larger than epsilon. 

I use it here to handle spectra which have a few lines and some
continuum emission.  It can dramatically reduce the amount of memory 
required to handle everything. 

The code is written in FORTRAN, but I believe somebody around here has
converted it to IDL--could be dug up if desired.

Randall Smith
rsmith@cfa.harvard.edu