|
User Documentation |
|||||||||
prev file | next file | ||||||||||
SUMMARY: fields | routine DETAILS: routine | ||||||||||
./guide resample.pro
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.
; 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
Parameters | |
newinterval |
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 |
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. |