Produced by IDL 7.1.1
User Documentation

./guide
resample.pro

Last modification date:
Wed Sep 28 13:27:09 2016

resample

procedure resample, newinterval[, keychan], [buffer=integer], [/nearest], [/linear], [/lsquadratic], [/quadratic], [/spline]

Resample a spectrum data container onto a new frequency axis using one of four possible interpolation methods.

Takes the data values in the data container indicated by the parameter 'buffer' and interpolates them onto a new frequency axis derived from the newinterval and keychan arguments. The reference_frequency is unchanged by this operation. The new frequency_interval is given by the newinterval argument. The new frequency axis is determined by choosing one channel in the original frequency axis and requiring that the frequency at that channel be centered on one of the channels in the interpolated data (the keychan argument). This sets the new reference frequency. When not supplied, keychan defaults to the channel nearest to the original reference channel.

The data container indicated by the 'buffer' parameter is altered by this procedure. The data values will contain the interpolated values and the header will describe the new frequency axis. The number of channels in the resulting interpolated data is just enough to use as much of the original data as possible without trying to interpolate beyond the ends of that data.

Interpolation is accomplished by using the IDL INTERPOL procedure except when 'nearest' is set, in which case it is done by this procedure. Blanked values (NaN) are ignored. See the documentation for INTERPOL for details about the various interpolation methods.

This procedure only works in line mode.

Examples
    ; data container 0 has a spectrum in it
    ; copy it elsewhere
    copy,0,10
    ; do a linear interpolation to 1.5 x the channel spacing
    resample,!g.s[0].frequency_interval*1.5
    ; the next line is exactly equivalent to "dcinvert"
    resample,-!g.s[0].frequency_interval
    ; Use buffer 10, use channel 0 as the keychan and
    ; do a spline interpolation, make sure things are ok
    resample,!g.s[10].frequency_interval*1.5,0,buffer=10,/spline
 
Uses
dcresample show
Version
$Id$

Parameters
newinterval
in, required
real
The new frequency_interval to use in the interpolation. This value must be nonzero. If it has opposite sign from the input frequency interval, invert will be used to first reverse the sense of the frequency axis.
keychan
in, optional
integer
The new frequency axis will have one channel where the frequency value equals the original frequency value at the keychan channel. When keychan is not supplied, it defaults to the channel nearest to the reference_channel.

Keywords
buffer
in, optional
integer (def. 0)
The data container buffer to use. Defaults to 0, the primary data container.
nearest
in, optional
boolean
When set do nearest-neighbor interpolation.
linear
in, optional
boolean
When set (the default), do a linear interpolation.
lsquadratic
in, optional
boolean
When set do a least squares quadratic fit interpolation.
quadratic
in, optional
boolean
When set do a quadratic fit interpolation.
spline
in, optional
boolean
When set do spline interpolation.


Produced by IDLdoc 1.6 on Wed Sep 28 13:27:36 2016