  With the advent of modern multi-detector heterodyne instruments that can
result in observations generating thousands of spectra per minute it is no
longer feasible to reduce these data as individual spectra. We describe the
automated data reduction procedure used to generate baselined data cubes from
heterodyne data obtained at the James Clerk Maxwell Telescope. The system can
automatically detect baseline regions in spectra and automatically determine
regridding parameters, all without input from a user. Additionally it can
detect and remove spectra suffering from transient interference effects or
anomalous baselines. The pipeline is written as a set of recipes using the
ORAC-DR pipeline environment with the algorithmic code using Starlink software
packages and infrastructure. The algorithms presented here can be applied to
other heterodyne array instruments and have been applied to data from
historical JCMT heterodyne instrumentation.
