#### Stopping criteria

Several criteria may be used to stop the iterative search of this “matching pursuit”:

1. When the maximum of the absolute value of the residual map is lower than a fraction of the noise. This stopping criterion is adapted to noise limited situations, i.e. when empirical measures of the noise in the cleaned image give a value similar to the noise value estimated from the system temperatures.
2. When the maximum of the absolute value of the residual map is lower than a fraction of the maximum intensity of the original dirty map. This stopping criterion is adapted to dynamic range limited situations, i.e. when some part of the source is so intense that the associated side lobes are larger than the thermal noise. In this case, any empirical measure of the noise in the cleaned image will give a value larger than the noise value estimated from the system temperatures.
3. The total number of clean components. This is a sanity criterium in case the other ones would be badly tuned.
4. When the total flux remains stable.

Choosing the good stopping criterion is important because the deconvolution must go deep enough to recover weak extended flux but CLEAN algorithms start to diverge when the noise is cleaned too deep. Criterium 4 is thus in general preferable, but may lead to insufficient cleaning when the dirty beam is poor (by lack of uv coverage and/or because of phase noise). If (# 4) fails, a good compromise is to clean down to or slightly below (typically ) the noise level.