Both selfcal and gpscal produce antenna gain tables in the same format as the calibration tasks previously described. Consequently, after running these tasks, the gains they derive are applied to the data `on-the-fly'. However, the new gain tables derived by the self-calibration tasks will overwrite any old gain tables. Provided the self-calibration produces an improvement, this is fine. However, if the self-calibration process degrades the quality of the image (possibly because you gave it bad inputs or a poor model, or because you were attempting to calibrate a weak source), then you may have lost your good set of gains. An additional shortcoming is that the self-calibration tasks do not apply bandpass corrections -- they assume bandpass corrections have been previously applied. Finally, if the primary gains have appreciable XY phase (for any antenna for selfcal , but for the reference antenna only for gpscal ), or significant amplitude gain mismatches (for selfcal only) then these corrections should be applied to the data before self-calibration. Consequently, it is usually wise, before starting to perform self-calibration iterations, to form a calibrated dataset (apply bandpass corrections and primary antenna gains). Additionally if you are going to use selfcal , as discussed below, you should convert to Stokes parameters. The task used to apply calibration and convert to Stokes parameters is uvaver .
Thus when using selfcal , use inputs to uvaver such as;
If using gpscal , do not perform Stokes conversion.
Once you have started self-calibrating, however, you probably do not need to form a calibrated dataset after each iteration. Provided you keep your best model of the image, if you do overwrite good gains with bad ones, then they are simple enough to regenerate using self-calibration and the best model.