heterodyne: Relocate obtaining the bad receptors.

It was in a location that would be inside a loop at the next change,
so move it earlier and declare relate arrays to be outside the
upcoming loop too.
heterodyne: Improve the estimation of the outlier rejection threshold.

It uses the peak and lower-side width of a smoothed histogram of
values to estimate the mode and noise standard deviation.
heterodyne: Minor typos.
heterodyne: Primitive to locate the emission in a heterodyne spectrum.

It's intended to locate the emission automatically and exclude it from
non-linear baseline checks.

The hard part is to locate the emission in most cases, in the presence
of noise and even a bad baseline.  Not all the various filters are
needed for all data, but have helped with selected cases.  It may well
need more tuning after exposure to many more cases.  It's probably
adequate to exclude emission before detecting non-linear baselines.
heterodyne: New primitive to locate emission in a time-series cube.

It collapses over time and receptor, using the median for that to
reduce the effect of bad baselines, to form a spectrum.  It then calls
the new _LOCATE_SPECTRUM_EMISSION_APPROX_ to determine where the
emission lies and tags a mask of that emission for use later in
detection of non-linear baselines.

It works through each-subband independently for hybrid data.  It may
be better to re-order recipes to merge subbands before non-linear
baseline filtering.  At present you can reject a spectrum in one
subband whilst retaining it in another.  I thought I'd better store
the current state first before the changes become too convoluted,
and then rework it if hybrid merging comes earlier in recipes. The
new emission-detection primitives already have had several iterations.
heterodyne: Document restricted usage and extend to automatic detection.
heterodyne: Add missing label.
heterodyne: Improve reporting for singular subband.
heterodyne: Add auto mode incorporating separate subbands.

It might be better to add a check whether subbands have already been
merged, but as tested the merge step came after bad-baseline filtering.

Renamed the suffix of output file for clarity.
heterodyne: Add auto mode for masking emission.
heterodyne: Add a comment.
heterodyne: Add reporting of automatic emission detection to steering primitives.
heterodyne: Correct if-block structure after adding auto mode.
heterodyne: Necessary to make auto mode the default.

The default for recipe parameter BASELINE_LINEARITY_LINEWIDTH is 'auto',
so this primitive will be run unless the user has supplied velocity
ranges for the emission.
heterodyne: Implement automatic emission finding for non-linear baselines.

Apply to the same changes to  the main three recipes.  In addition
REDUCE_SCIENCE_GRADIENT had a default velocity range that would override
the auto mode.
heterodyne: Add a line about masking to the output commentary.
heterodyne: Resolve conflicting functionality for the AXIS argument.

It looks as if the AXIS argument was either withdrawn given the note
that the spectral axis had to be the first, or not fully implemented.
This change offers a more-flexible approach allowing not just cubes
and the spectral axis to be the first or third (time-series or
spectral cubes).  Further I take Argument AXIS to mean the spectral
axis to retain, not to trim.

Hybrid observations are merged before spectral cubes are formed,
so there is no need to pass the AXIS to the hybrid variant of this
primitive.

This primitive came under the radar because I wanted to apply it to
a representative spectrum of a time-series cube.
heterodyne: Allow to work on images and spactra.

It may well have worked for images and spectra by checking the
undefined bounds, but I would rather have it access only bounds of
existing axes.
heterodyne: Parameterise the boxsize (defensive programming).
heterodyne: Adjust threshold usage.

This was originally intended to commit just the changes to set a higher
threshold to match the normal 0.08 non-linearity limit, but despite
various attempts I couldn't split the hunks to git's satisfaction.
Thus it now also includes the modification to bypass measuring the
histogram peak if too few values are present to form the histogram.
The limits are somewhat arbitrary.  In this case use the original
THRESH numbers and skip over the second thresholding.