[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sliding scale interpolation
- Subject: Re: Sliding scale interpolation
- From: Randall Smith <rsmith(at)kracko.harvard.edu>
- Date: 08 Jun 2000 15:01:53 -0400
- Newsgroups: comp.lang.idl-pvwave
- Organization: Harvard University Network Operations Center
- References: <393CF40A.F179A73A@ncep.noaa.gov>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:19909
Paul van Delst <email@example.com> 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
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.