Quality assessment and data flagging

Validation of the solution
One of the difficulties of self-calibration is to evaluate whether it has improved the image or not. The self-calibration solution is biased towards the assumed model. If used with insufficient signal to noise, it will tend to produce a point source at the initial peak position, and the bias will be of order of the noise. This may be inappropriate. Currently, the validity of the self-calibration solution is based on the estimated signal to noise ratio for the gains at each time step. If that SNR is below a user-controlled threshold (by default, SELF_SNR=6), the corresponding data is flagged (default value: SELF_FLAG=YES) or kept WITHOUT self calibration (if SELF_FLAG=NO).
Flagging or not flagging ?
The decision to flag or not results from a trade-off: Both options may be explored, and it is recommended to check afterwards the final angular resolution with and without flagging.

The following scheme is proposed to check the validity of the self-calibration solution:

From our experience, the number of loops SELF_NLOOP does not impact much the quality of the solution, and 2 to 3 iterations are usually sufficient.

Warning: the comparison with theoretical noise relies on a proper scaling of the weights of the UV data. This is fine for the IRAM array, but data exported from CASA is not always correct in this respect. UV_PREVIEW can warn you about potential issues in this respect. UV_REWEIGHT can also evaluate the scaling factor that should be applied to the weights to recover the apparent noise level. UV_PREVIEW requires a sufficient number of spectral channels for this purpose. By default, UV_REWEIGHT suffers from a similar restriction, and both commands may fail if the bandwidth is clobbered with spectral lines or has strong continuum. However, UV_REWEIGHT as a TIME mode where the noise is estimated from consecutive visibilities, and thus is not affected by this limitation.

The appropriate scaling factor can be specified in SELFCAL by variable SELF_SNOISE.