autolens.potential_correction.FitDpsiSrcInterferometer#

class FitDpsiSrcInterferometer[source]#

Bases: object

A joint linear inversion of interferometer visibilities for the pixelized source and the pixelized corrections dpsi to the lensing potential, fully accounting for their covariance.

The real-space responses are the source mapper’s mapping matrix f and the correction response G = D_s D_psi (source-gradient matrix times dpsi-gradient operator — no PSF: the measurement operator here is the non-uniform Fourier transform, applied by the route machinery). The joint curvature is [f | G]^T (T^H C^-1 T) [f | G] and the data vector [f | G]^T T^H C^-1 d, with the Bayesian evidence setting both regularization strengths.

Parameters:
  • dataset – The al.Interferometer dataset. For the sparse-operator route (the default, which scales to large visibility counts) it must carry a sparse operator — call dataset.apply_sparse_operator() first.

  • lens_start (Galaxy) – The smooth lens galaxy of the starting model the corrections perturb.

  • source_start (SrcFactory) – The source factory evaluated for the source gradients.

  • dpsi_pixelization (DpsiPixelization) – The dpsi mesh + regularization model, built on the dataset’s real-space mask.

  • src_pixelization (Pixelization) – The source pixelization of the joint inversion.

  • src_image_mesh – An image mesh whose image-plane mesh grid is preloaded into the source inversion.

  • dpsi_mask – An optional 2D bool mask restricting the dpsi mesh to a sub-region of the real-space mask (typically an arc-tracing mask from al.pc.util.arc_mask_from): the corrections are only constrained where the lensed arcs are, and restricting the mesh there stabilises the inversion. Defaults to the full real-space mask.

  • settings_inversion (Optional[Settings]) – The inversion settings; defaults to the positive-only solver with the border relocator.

  • use_sparse_operator (bool) – Whether the curvature/data-vector are built through the sparse w-tilde operator (default) or the dense transformed mapping matrix (small visibility counts only; the parity reference).

  • preloads (Optional[dict]) – Precomputed attributes set directly onto the fit.

Methods

do_source_inversion

Runs the standard autolens interferometer source inversion at the starting lens model, caching its mapper and regularization matrix as the source blocks of the joint inversion.

solve_src_dpsi

Attributes

best_fit_dpsi

best_fit_source

curvature_matrix

curvature_regularization_matrix

data_vector

dpsi_gradient_matrix

dpsi_points

dpsi_regularization_matrix

dpsi_response_matrix

The sparse real-space correction response G = -D_s D_psi of shape [n_real_space_pixels, n_dpsi]: the change of the (unconvolved, untransformed) real-space image per unit dpsi.

log_evidence

the complex-noise normalization, the log-determinants of the curvature+regularization and regularization matrices, the joint regularization penalty and the visibility chi-squared (real and imaginary parts).

mapper

model_visibilities

The model visibilities of the solved joint system, via one forward transform of the reconstructed real-space image (cost: a single NUFFT, independent of the route).

operated_mapping_matrix

The dense visibility-space joint response, real and imaginary parts stacked row-wise: T([f | G]) of shape [2 n_vis, n_src + n_dpsi].

pair_dpsi_data_obj

real_space_mapping_matrix

The dense real-space joint response [f | G] on the slim mask pixels, used for the data vector and to materialize model images.

regularization_matrix

source_gradient_matrix

source_plane_data_grid

src_regularization_matrix

do_source_inversion()[source]#

Runs the standard autolens interferometer source inversion at the starting lens model, caching its mapper and regularization matrix as the source blocks of the joint inversion.

property src_regularization_matrix#
property mapper#
property pair_dpsi_data_obj#
property source_plane_data_grid#
property source_gradient_matrix#
property dpsi_gradient_matrix#
property dpsi_response_matrix#

The sparse real-space correction response G = -D_s D_psi of shape [n_real_space_pixels, n_dpsi]: the change of the (unconvolved, untransformed) real-space image per unit dpsi.

property dpsi_points#
property dpsi_regularization_matrix#
property regularization_matrix#
property real_space_mapping_matrix#

The dense real-space joint response [f | G] on the slim mask pixels, used for the data vector and to materialize model images.

property curvature_matrix#
property data_vector#
property operated_mapping_matrix#

The dense visibility-space joint response, real and imaginary parts stacked row-wise: T([f | G]) of shape [2 n_vis, n_src + n_dpsi]. Small visibility counts only — the parity reference for the sparse route.

property curvature_regularization_matrix#
solve_src_dpsi(return_error=False)[source]#
property model_visibilities#

The model visibilities of the solved joint system, via one forward transform of the reconstructed real-space image (cost: a single NUFFT, independent of the route).

property log_evidence#

the complex-noise normalization, the log-determinants of the curvature+regularization and regularization matrices, the joint regularization penalty and the visibility chi-squared (real and imaginary parts).

Type:

The Bayesian evidence of the joint visibility-space inversion

property best_fit_source#
property best_fit_dpsi#