Keywords: imager

Next: Basic use Up: Self Calibration Previous: Self-Calibration Principle Contents Index

## Self-Calibration Implementation

The typical procedure for self-calibration consists in an iterative process based on the following steps:

1. magenta`UV_MAP /SELF` + magenta`CLEAN` + magenta`UV_RESTORE /SELF`:
   from the classically calibrated (and preliminarily flagged) data, define an initial source model through a conservative (not too deep) first deconvolution : the model consists of a reasonably modest number of CLEAN components.
2. magenta`SOLVE`: determine an estimate of the antenna gains (best fit to the observed visibilities)
3. magenta`APPLY`: apply the derived gains to correct the observed data
4. magenta`STATISTIC`: compare to the initial Image, and estimate the improvement through an adequate quality assessment (e.g., improvement of the dynamic range)
5. If necessary, re-build a new model from these corrected data, and iterate until the solution is satisfactory.

Phase-only self-calibration is less stringent on the signal-to-noise ratio (SNR) threshold than amplitude self-calibration, and it should therefore be attempted first. For phase self-calibration to work, the SNR values in the initial data should be at least of `SNR>3` per antenna (in a solution interval shorter than the time for significant phase variations for all baselines to a single antenna). The SNR threshold in the initial image depends on the number of antennas and on the adopted time averaging. Depending on the complexity of the source (and the contribution from extended emission), all available baselines may not be considered in the process, and specific preliminary flagging could be necessary. Amplitude errors tend to be negligible for dynamic ranges below about 500. Amplitude self-calibration will thus be eventually attempted in a subsequent step.

Self Calibration is available in [rgb]1,0,0IMAGER through the command magenta`SELFCAL`, which uses an iterative scheme driven by a script violet`(gag_pro:p_selfcal.ima)`. From the above principle, the script controls
a) the number of iterations
b) the number of selected clean components at each iteration
c) the time scale of the solution, i.e. the integration time over which the gains are assumed to be constant

The parameters of the command magenta`SELFCAL` are available as blue`SELF_Names` red SIC variables. The script uses the commands magenta`UV_MAP`, magenta`CLEAN`, and magenta`SOLVE` and magenta`APPLY` from the blue`CALIBRATE\` language. By default, a solution is searched for the phase calibration only (blue`SELF_MODE=PHASE`), and the number of iterations is 3 (blue`SELF_LOOP`). For each iteration:

- All components found by magenta`CLEAN` are kept by default (blue`SELF_NITER=0`), but for simple source structures, 10 components only may be enough (the maximum number blue`NITER` of CLEAN components to subtract is automatically guessed by the program in the default process, see blue`CLEAN_NITER` and other usual clean convergence control variables),
- the minimum flux density per pixel to be considered by CLEAN can be defined (blue`SELF_MINFLUX=0`)
- The ''integration'' times (gain averaging) are fixed to a default value blue`SELF_TIMES=45`s (minimum value for NOEMA, while it is only `6`s for ALMA). This can be adapted for each loop (in general, one should start with larger solution times, depending on the SNR values and try to decrease it in order to better sample the atmospheric fluctuations).

The number of iterations can be changed by resizing the blue`SELF_TIMES`, blue`SELF_NITER`, or blue`SELF_MINFLUX` arrays (the number of loops blue`SELF_LOOP` is then automatically recomputed). You should make sure that these 3 arrays have the same dimension. If any of the blue`SELF_NITER` and/or blue`SELF_MINFLUX` array are constant then their dimension is accordingly changed by magenta`SELFCAL` each time one of these arrays is resized. For instance, the following command allows to define 5 loops with an integration time for solution of 45sec:

`let Self_times 45 45 45 45 45 /resize`

blue`SELF_NITER` and blue`SELF_MINFLUX` are automatically enlarged to the same size if, and only if, they were already constant. By default, all channels are averaged to compute a ''continuum'' image, but the range of adequate channels can be specified through blue`SELF_CHANNEL`.

magenta`SELFCAL PHASE` will compute a phase calibration, but will not apply it. One needs to call magenta`SELFCAL` once more with the argument magenta`APPLY` in order to apply the solution. The script really applies the solution if and only if the previously found solution can be considered as a good one (see blue`SELF_STATUS` argument value).

magenta`SELFCAL APPLY` automatically saves the parameters and results in the selfcal.last file. By default, data are flagged if no sufficiently good solution is found. magenta`SELFCAL APPLY` keep tracks of whether the solution has already been applied through blue`SELF_APPLIED`. magenta`SELFCAL APPLY` will refuse to apply ``bad'' solutions: solutions are declared ``bad'' if the improvement in dynamic range and noise level is insufficient (i.e. below a precision level controlled by blue`SELF_PRECISION`). In this case, the blue`SELF_STATUS` variable is negative. In this case, the user can still decide to apply the solution directly using command magenta`APPLY`, but the blue`SELF_APPLIED` variable will not be updated.

The merit criteria for the quality assessment of the computed solution are the final dynamic range, and the Clean map noise at each iteration. These quantities are stored in the blue`SELF_DYNAMIC` and blue`SELF_RMSCLEAN` variables (at each iteration). The dynamic is defined as the ratio of the peak flux density value to the noise in the clean map (automatically estimated with the command magenta`STATISTIC`). The minimum signal to noise ratio value (for an antenna) for a valid solution is blue`SELF_SNR=6` by default.

magenta`SELFCAL` can be controlled through a widget, using command magenta`SELFCAL /WIDGET` (see Figure )

Figure: The Self-Calibration widget

It is possible to visualize the computed corrections with the command magenta`SELFCAL SHOW`. The solution computed with the magenta`SOLVE` command is written in a 'self_sname'.tab file. By default, the difference between the last two iterations is displayed. For `PHASE`, the phase difference should be close to zero if the solution converged, and for `AMPLI` the amplitude values close to 1. It is also possible to show the difference between two specified iterations. In addition, the command magenta`SELFCAL SUMMARY` will display the results of the process in terms of resulting noise and improved dynamic range. If the solution is satisfactory, the command magenta`SELFCAL SAVE` can be used to save both the results and the parameters in the selfcal.last file. (magenta`SELFCAL APPLY` performs an implicit magenta`SELFCAL SAVE`.)

Next: Basic use Up: Self Calibration Previous: Self-Calibration Principle Contents Index