Stacking Multiple Spectral Lines at Same Position
This guide presents a method in CASA for averaging together multiple transitions of the same line. This process increases the signal to noise of the line observations. It may not be suitable for all science cases though.
The observations in this guide were of 8 hydrogen radio recombination lines in the center of galaxy. The lines are all emitted from the same region. Therefore, the strategy is to use clean to put each spectral line cube on the same velocity scale. Then the cubes are smoothed to the same resolution as the cube with the coarsest resolution using imsmooth. Finally, the spectral line cubes are averaged together using immath.
This script assumes that you have already continuum subtracted the data using uvcontsub. If you need to continuum subtract in the image domain using imcontsub, it should be done after the clean, not after the spectral line cubes are averaged together. Be careful with your continuum subtraction -- small errors in continuum subtraction can lead to spurious lines.