### Implementation

In MAPPING, the variants of the CLEAN algorithms discussed above are coded as the following commands: HOGBOM, CLARK, MX, SDI, MULTI and MRC. All those commands work on two internal buffers containing the dirty beam and dirty image. Both buffers are created directly from table through the UV_MAP command, or they can be loaded from files through the READ BEAM and READ DIRTY commands. The behavior of those commands is controlled through the following common sic variables:

Iterative search
  POSITIVE
    Number of positive clean components to be found before enabling the search for negative components. Default is 0.
  GAIN
    Loop gain. Default is 0.2, good compromise between stability and speed.
Stopping criteria
  NITER
    Maximum number of clean components. Default is 500.
  FRES
    Maximum amplitude of the absolute value of the residual image. This maximum is expressed as a fraction of the peak intensity of the dirty image. Default is 0.
  ARES
    Maximum amplitude of the absolute value of the residual image. This maximum is expressed in the image units (Jy/Beam). Default is 0.
Support
  BLC and TRC
    Bottom Left Corner and Top Right Corner of a square support in pixel units. Default is 0, meaning do not use such a square support.
  SUPPORT
    A command to interactively define the support where to search for clean components. This definition can be stored in a file through the WRITE SUPPORT command and read back in memory from the file with the SUPPORT command. The support definition is stored in the POLY sic structure. A side effect is that any definition of a polygon (e.g. through the GO FLUX command) will imply the definition of a support...
Clean beam parameters
  MAJOR, MINOR and ANGLE
    FWHM size of the major and minor axes (in arcsec) and position angle (in degree) of the Gaussian used to restore the clean image from the clean component list. Default is all parameters at 0, meaning use the fit of the main lobe of the dirty image. Changing the default value of those parameter is dangerous.

Other variables control specific aspects of a subclass of the CLEAN algorithms:

NMAJOR
  Maximum number of major cycles in all algorithms using this notion (CLARK, MX, SDI). Default is 50.
BEAM_PATCH
  Size (in pixel units) of the dirty beam used to deconvolve the residual image in minor cycles. It is used in all algorithms using the minor cycle notion. Default is 0, meaning *** ? JP ***
SMOOTH
  *** ? JP ***