Flag CH0 in TVFLG on galaxy with calibration applied. This will look for any extremely high points that cover a lot of the line channels.
Copy flag table to the line data (TABED)
WIPER on the line data to look for extremely high points (> 50 Jy). Use CLIP to flag these high points. Flagging in WIPER is inefficient and writes way too many flags.
Once all of the high points are gone, use WIPER to look for bad baselines/times/line channels (amp v. time). If you identify any bad baselines, you can use SPFLG to flag the specific time and baseline. Just remember to set antenna= and baseline=.
TASAV to save the tables before SPLIT.
SPLIT the data off. (doband 1, docalib 1)
POSSM - get the spectrum (aparm(1) = 1, nplots = 0, solint =0, codetype 'real'). The real part should average to 0 in the line-free channels. Write down the channels that have your line. You will need them for continuum subtraction.