In practice, the spectra produced by an instrument are not aligned precisely parallel to the pixels in the detector used to record them. There are many reasons for this, not least that the effect of atmospheric refraction at the blue and red ends of the spectrum is different. As the position of the centre of the spectrum is subject to shifts in the spatial direction, we need to find the centre of the spatial profile of the spectrum at points along the dispersion direction, and fit a curve to these points. This process is known as tracing the spectrum. The figure below shows the curve fitted to a trace overlaid on the image of the spectrum.
When summing the signal from each sample in the dispersion direction, the positions of the object and background channels are re-centered relative to the trace. This ensures that the `software slit' used for the extraction correctly samples the spectrum.
For a bright spectrum with a continuum, tracing is done easily; however, if the spectrum has strong absorption features or is very faint, it can be difficult to find the trace centre along the whole length of the spectrum. There is no perfect way to overcome this problem. The strategy you adopt in these cases will depend upon which frames you have available; it may be adequate to use a flat-field with the dekker stopped down; it may be adequate to use a bright reference star image. As long as you have one frame which you can trace you can use this as a template for the extraction. The template trace may have to be shifted to register with the science frames. You can determine if this is needed by over-plotting the trace on the science frame and inspecting the fit. In the worst case of no frame proving suitable for tracing, the trace path may be defined manually; try to avoid this if at all possible.
Simple Spectroscopy Reductions