Sliding scale interpolation [message #20281] |
Tue, 06 June 2000 00:00  |
Paul van Delst
Messages: 364 Registered: March 1997
|
Senior Member |
|
|
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.
paulv
--
Paul van Delst Ph: (301) 763-8000 x7274
CIMSS @ NOAA/NCEP Fax: (301) 763-8545
Rm.202, 5200 Auth Rd. Email: pvandelst@ncep.noaa.gov
Camp Springs MD 20746
|
|
|
Re: Sliding scale interpolation [message #20357 is a reply to message #20281] |
Thu, 08 June 2000 00:00  |
Randall Smith
Messages: 4 Registered: November 1998
|
Junior Member |
|
|
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/to ms/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
|
|
|