next up previous contents
Next: 10.3 Cross-Correlating Two Spectra Up: 10 MORE WAYS TO Previous: 10.1 Merging Two Spectra

10.2 Resampling Spectra

If you wish to directly compare two spectra, it may be necessary to resample one of them so that both are on the same wavelength scale. There are several resampling routines available:

IUETERP,W2,W1,F1,vb,vc,vd,ve,vf,eps=q,nu=q,header=h 

W2 The wavelength scale to which the other spectrum will be resampled.
W1 The wavelengths of the spectrum to be resampled.
F1 Fluxes for the spectrum to be resampled.
vb,bc,vd,ve,vf You may resample up to five additional vectors at the same time (e.g., sigmas).
eps You may retain the minimum (worst) $\epsilon$ quality flag value for each resampled point if you enter your quality flags via the EPS keyword.
nu You may coalesce (keep all set bits) your $\nu$ quality flags for each resampled point if you enter them via the NU keyword.
header If you enter a FITS header via this keyword, a comment will be added to it describing the resampling done.

IUETERP is a linear interpolation routine. There is also a quadratic procedure:

QUADTERP,W1,F1,W2,F2 

W1,F1 Wavelengths and fluxes to be resampled.
W2 Wavelengths for which resampled flux value will be calculated.
F2 Calculated flux values.

Another available procedure for resampling is SPLINE:

SPLINE,W1,F1,W2,F2,FP,FPP,FINT 

W1 Wavelengths of spectrum to be resampled.
F1 Fluxes of spectrum to be resampled.
W2 Wavelengths for which new flux values will be calculated.
F2 Calculated flux values.
FP First derivative of the spline fit.
FPP Second derivative of the spline fit.
FINT Integral of the spline fit.

Once the spectra have the same wavelength scale, you can subtract one from the other, or divide one by the other, as you wish:

plot,w1,f1-f2

    or

plot,w1,f1/f2


next up previous contents
Next: 10.3 Cross-Correlating Two Spectra Up: 10 MORE WAYS TO Previous: 10.1 Merging Two Spectra

2/9/1998