Calibration

This module provides basic radio interferometry calibration utilities. Calibration is the process of estimating the \(2\times 2\) Jones matrices which describe transformations of the signal as it propagates from source to observer. Currently, all utilities assume a discretised form of the radio interferometer measurement equation (RIME) as described in Radio Interferometer Measurement Equation.

Calibration is usually divided into three phases viz.

  • First generation calibration (1GC): using an external calibrator to infer the gains during the target observation. Sometimes also refered to as calibrator transfer
  • Second generation calibration (2GC): using a partially incomplete sky model to perform direction independent calibration. Also known as direction independent self-calibration.
  • Third generation calibration (3GC): using a partially incomplete sky model to perform direction dependent calibration. Also known as direction dependent self-calibration.

On top of these three phases, there are usually three possible calibration scenarios. The first is when both the Jones terms and the visibilities are assumed to be diagonal. In this case the two correlations can be calibrated separately and it is refered to as diag-diag calibration. The second case is when the Jones matrices are assumed to be diagonal but the visibility data are full \(2\times 2\) matrices. This is refered to as diag calibration. The final scenario is when both the full \(2\times 2\) Jones matrices and the full \(2\times 2\) visibilities are used for calibration. This is simply refered to as calibration. The specific scenario is determined from the shapes of the input gains and the input data. Numpy ~~~~~

residual_vis(time_bin_indices, …) Computes residual visibilities in place given model visibilities and gains solutions.
correct_vis(time_bin_indices, …) Apply DIE gains to visibilities to generate corrected visibilities.
phase_only_gauss_newton(time_bin_indices, …) Performs phase-only maximum likelihood calibration assuming scalar or diagonal inputs using Gauss-Newton oprimisation.
africanus.calibration.residual_vis(time_bin_indices, time_bin_counts, antenna1, antenna2, jones, vis, flag, model)[source]

Computes residual visibilities in place given model visibilities and gains solutions.

Parameters:

time_bin_indices : numpy.ndarray

The start indices of the time bins of shape (utime)

time_bin_counts : numpy.ndarray

The counts of unique time in each time bin of shape (utime)

antenna1 : numpy.ndarray

First antenna indices of shape (row,).

antenna2 : numpy.ndarray

Second antenna indices of shape (row,)

jones : numpy.ndarray

Gain solutions of shape (time, ant, chan, dir, corr) or (time, ant, chan, dir, corr, corr).

vis : numpy.ndarray

Data values of shape (row, chan, corr). or (row, chan, corr, corr).

flag : numpy.ndarray

Flag data of shape (row, chan, corr) or (row, chan, corr, corr)

model : numpy.ndarray

Model data values of shape (row, chan, dir, corr) or (row, chan, dir, corr, corr).

Returns:

residual : numpy.ndarray

Residual visibilities of shape (time, ant, chan, dir, corr) or (time, ant, chan, dir, corr, corr).

africanus.calibration.correct_vis(time_bin_indices, time_bin_counts, antenna1, antenna2, jones, vis, flag)[source]

Apply DIE gains to visibilities to generate corrected visibilities. For a measurement model of the form

\[V_{pq} = G_{p} X_{pq} G_{q}^H + n_{pq}\]

the corrected visibilities are defined as

\[C_{pq} = G_{p}^{-1} V_{pq} G_{q}^{-H}\]

The corrected visibilities therefore have a non-trivial noise contribution. Note it is only possible to form corrected data from direction independent gains solutions so the dir axis on the jones terms should always be one.

Parameters:

time_bin_indices : numpy.ndarray

The start indices of the time bins of shape (utime).

time_bin_counts : numpy.ndarray

The counts of unique time in each time bin of shape (utime).

antenna1 : numpy.ndarray

Antenna 1 index used to look up the antenna Jones for a particular baseline with shape (row,).

antenna2 : numpy.ndarray

Antenna 2 index used to look up the antenna Jones for a particular baseline with shape (row,).

jones : numpy.ndarray

Gain solutions of shape (time, ant, chan, dir, corr) or (time, ant, chan, dir, corr, corr).

vis : numpy.ndarray

Data values of shape (row, chan, corr) or (row, chan, corr, corr).

flag : numpy.ndarray

Flag data of shape (row, chan, corr) or (row, chan, corr, corr).

Returns:

corrected_vis : numpy.ndarray

True visibilities of shape (row,chan,corr_1,corr_2)

africanus.calibration.phase_only_gauss_newton(time_bin_indices, time_bin_counts, antenna1, antenna2, jones, vis, flag, model, weight, tol=0.0001, maxiter=100)[source]

Performs phase-only maximum likelihood calibration assuming scalar or diagonal inputs using Gauss-Newton oprimisation.

Parameters:

time_bin_indices : numpy.ndarray

The start indices of the time bins of shape (utime)

time_bin_counts : numpy.ndarray

The counts of unique time in each time bin of shape (utime)

antenna1 : numpy.ndarray

First antenna indices of shape (row,).

antenna2 : numpy.ndarray

Second antenna indices of shape (row,).

jones : numpy.ndarray

Gain solutions of shape (time, ant, chan, dir, corr) or (time, ant, chan, dir, corr, corr).

vis : numpy.ndarray

Data values of shape (row, chan, corr) or (row, chan, corr, corr).

flag : numpy.ndarray

Flag data of shape (row, chan, corr) or (row, chan, corr, corr).

model : numpy.ndarray

Model data values of shape (row, chan, dir, corr) or (row, chan, dir, corr, corr).

weight : numpy.ndarray

Weight spectrum of shape (row, chan, corr). If the channel axis is missing weights are duplicated for each channel.

tol : float, optional

The tolerance of the solver. Defaults to 1e-4.

maxiter: int, optional

The maximum number of iterations. Defaults to 100.

Returns:

gains : numpy.ndarray

Gain solutions of shape (time, ant, chan, dir, corr) or shape (time, ant, chan, dir, corr, corr)

jhj : numpy.ndarray

The diagonal of the Hessian of shape (time, ant, chan, dir, corr) or shape (time, ant, chan, dir, corr, corr)

jhr : numpy.ndarray

Residuals projected into gain space of shape (time, ant, chan, dir, corr) or shape (time, ant, chan, dir, corr, corr).

k : int

Number of iterations (will equal maxiter if not converged)