function rebin1d

Rebin a one-dimensional vector to new values.

result = rebin1d(spectrum, xstart, xend, xdelta [, xvalues])

spectrum:   A one-dimensional FITS. It should have the correct FITS keywords (CRVAL1, CRPIX1, and CDELT1) or the optional argument xvalues should be given.
xstart:   The first channel in the rebinned data
xend:   The last channel in the rebinned data
xdelta:   The increment step size for the rebinned data
xvalues:   A vector of same length as spectrum with the corresponding x-values.

The returned vector has the data rebinned with the appropritate FITS keywords set.

See also
function interpol