src package

Core implementation of the SARA, HyperSARA and Faceted HyperSARA imaging algorithms.

API src

src.apply_adjoint_operator(y, G, Lambda)

Apply part of the adjoint measurment operator (before the scaled inverse discrete Fourier transform involved in the non-uniform FFT [Fessler2003]).

Parameters
  • y (complex[:]) – Input data array (data-block).

  • G (sparse array) – Gridding matrix (including noise whitening operator).

  • Lambda (double[:]) – Reduction operator.

Returns

Fx – Gridded visibilities.

Return type

complex[:]

src.apply_direct_operator(Fx, G, Lambda)

Apply part of the direct measurement operator (after the scaled discrete Fourier transform involved in the non-uniform FFT [Fessler2003]).

Parameters
  • Fx (complex[:]) – Scaled discrete Fourier transform of a 2d array \(x\).

  • G (complex[:, :]) – Gridding matrix (including noise whitening operator).

  • Lambda (double[:]) – Reduction operator.

Returns

y – Visibility vector.

Return type

complex[:]

src.apply_scaled_fourier_transform(x, A, No)

Apply scaled Fourier transform to a wideband image cube \(x\).

Parameters
  • x (double[:, :, :]) – Input wideband image cube.

  • A (anonymous function) – anonymous function to compute the scaled Fourier transform of each slice of the image

  • No (int) – Total number of pixels in the oversampled spatial Fourier plane.

Returns

Fx – Matrix whose column contain the scaled Fourier transform of each slice of x.

Return type

double[:, :]

src.compute_residual_images(x, y, A, At, G, W, flag_visibility_gridding, Lambda)

Compute residual images.

Compute the residual image for each spectral channel.

Parameters
  • x (double[:, :, :]) – Wideband image cube [N(1), N(2), L].

  • y (cell) – Blocked visibilities {L}{nblocks}.

  • A (anonymous function) – Measurement operator @[1].

  • At (anonymous function) – Adjoint measurement operator @[1].

  • G (cell) – Blocked gridding matrix {L}{nblocks}.

  • W (cell) – Masking operators (selection of data blocks) {L}{nblocks}.

  • flag_visibility_gridding (bool) – Flag to activate data dimensionality reduction via visibility gridding.

  • Lambda (cell) – Dimensionality reduction weights {L}{nblocks}.

Returns

  • residual_image (double[:, :, :]) – Residual image cube [N(1), N(2), L], normalised by the peak of the PSF following convention in RI.

  • ————————————————————————-%

  • Code (P.-A. Thouvenin, A. Dabbech)

  • Last revised ([01/04/2022])

  • ————————————————————————-%

src.compute_sara_prior(x, Psit, n_wavelet_coefficients)

Compute the l21-norm of the wavelet cofficients associated with the SARA dictionary.

Compute \(\Vert \boldsymbol{\Psi}^\dagger \mathbf{X} \Vert_{2,1}\) for an input wideband image \(\mathbf{X} \in \mathbb{R}^{N\times L}\), with \(\boldsymbol{\Psi}^\dagger\) the SARA dictionary [Carrillo2012].

Parameters
  • x (double[:, :, :]) – Wideband image cube [N(1), N(2), L].

  • Psit (anonymous function) – SARA dictionary @[1].

  • n_wavelet_coefficients (int) – Number of wavelet coefficients (per channel) [1].

Returns

f – Value of \(\Vert \boldsymbol{\Psi}^\dagger \mathbf{X} \Vert_{2,1}\), with \(\boldsymbol{\Psi}^\dagger\) the SARA dictionary [Carrillo2012].

Return type

double

src.nuclear_norm(x)

Compute the nuclear norm of a wideband image.

Compute \(\Vert \mathbf{X} \Vert_*\) for \(\mathbf{X} \in \mathbb{R}^{N \times L}\).

Parameters

x (double[:, :, :]) – Wideband image cube [N(1), N(2), L].

Returns

f – Nuclear norm of the wideband image.

Return type

double

src.proj_l2ball(x, eps, y)

Compute the projection of the input vector \(x\) onto the \(\ell_2\) ball centered in \(y\) with radius \(\varepsilon\).

Parameters
  • x (array) – Input vector.

  • eps (double) – Radius of the \(\ell_2\) ball.

  • y (array) – Center of the \(\ell_2\) ball.

src.sanity_check(epsilon, norm_res)

Update the data fidelity term in the preconditioned primal-dual algorithm.

Update the data fidelity terms owned by each worked involved in the group of data nodes (with preconditioning -> projection onto an ellipsoid).

Parameters
  • epsilon (cell) – Norm of the residual {L}{nblocks}[1].

  • norm_res (cell) – \(\ell_2\)-ball constraints {L}{nblocks}[1].

Returns

  • global_norm_res (double) – Square global norm of the residual.

  • norm_epsilon (double) – Square global norm of epsilon.

src.update_dual_data_fidelity(v2, y, x, Fx_old, proj, A, At, G, W, pU, epsilon, elipse_proj_max_iter, elipse_proj_min_iter, elipse_proj_eps, sigma22, flag_dimensionality_reduction, Lambda)

Update the data fidelity term in the preconditioned primal-dual algorithm.

Update the data fidelity terms owned by each worked involved in the group of data nodes (with preconditioning \(\rightarrow\) projection onto an ellipsoid).

Parameters
  • v2 (cell) – Data fidelity dual variable {L}{nblocks}[M, 1].

  • y (cell) – Blocks of visibilities {L}{nblocks}[M, 1].

  • x (double[:, :, :]) – Primal variable [N(1), N(2), L].

  • Fx_old (complex[:, :, :]) – Scaled Fourier transform of \(x\) from the previous iterations [N(1), N(2), L].

  • proj (cell) – Value of the projection at the previous global iteration, taken as a starting point {L}{nblocks}[M, 1].

  • A (anonymous function) – Measurement operator @[1].

  • At (anonymous function) – Adjoint measurement operator @[1].

  • G (cell) – Blocked interpolation matrix {L}{nblocks}.

  • W (cell) – Blocked masking operator {L}{nblocks}.

  • pU (cell) – Preconditioning matrices {L}{nblocks}.

  • epsilon (cell) – \(\ell_2\)-ball constraints {L}{nblocks}[1].

  • elipse_proj_max_iter (int) – Maximum number of iterations (projection onto the ellipsoid)

  • elipse_proj_min_iter (int) – Minimum number of iterations (projection onto the ellipsoid)

  • elipse_proj_eps (double) – Stopping criterion for the projection.

  • sigma22 (double[:]) – Step-size for the update of the dual variable (tau*sigma2).

  • flag_dimensionality_reduction (bool) – Flag to activate DR functionality.

  • Lambda (cell) – Dimensionality reduction weights {L}{nblocks}.

Returns

  • v2 (cell) – Data fidelity dual variable {L}{nblocks}[M, 1].

  • Ftx (double[:, :]) – Auxiliary variable for the update of the primal variable [N(1), N(2)].

  • Fx_old – Scaled Fourier transform of the updated image [N(1), N(2), L].

  • proj (cell) – Result of the projection step {L}{nblocks}[M, 1].

  • norm_res (cell) – Norm of the residual {L}{nblocks}[1].

  • global_norm_res (double) – Square global norm of the residual.

  • norm_epsilon (double) – Square global norm of epsilon.