autolens.potential_correction.FitDpsiSrcImaging#

class FitDpsiSrcImaging[source]#

Bases: object

A joint linear inversion of an image for the pixelized source and the pixelized corrections dpsi to the lensing potential, fully accounting for their covariance: the mapping matrix is the horizontal block [F_src | -B D_s D_psi] and the regularization the block diagonal of the source and dpsi regularization matrices, with the Bayesian evidence used to set both regularization strengths.

Parameters:
  • masked_imaging – The masked al.Imaging dataset.

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

  • source_start (SrcFactory) – The source factory evaluated for the source gradients (from the smooth-model fit’s source).

  • dpsi_pixelization (DpsiPixelization) – The dpsi mesh + regularization model.

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

  • anchor_points (Optional[ndarray]) – The [3, 2] (y, x) anchor positions of the dpsi rescaling scheme.

  • adapt_image – The adapt image of the source pixelization’s image mesh.

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

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

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

Methods

do_source_inversion

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

draw_random_solutions

Draws source/dpsi solutions consistent with the data at the level permitted by the noise and regularizations; when return_dkappa the dpsi block is transformed to convergence corrections via the dpsi mesh's Laplacian operator.

solve_src_dpsi

Attributes

best_fit_dpsi

best_fit_source

curvature_matrix

curvature_regularization_matrix

data_vector

dpsi_gradient_matrix

dpsi_linear_obj

dpsi_mapping_matrix

dpsi_points

dpsi_regularization_matrix

inverse_noise_covariance_matrix

log_evidence

noise normalization, the log-determinants of the curvature+regularization matrix and of the source and dpsi regularization matrices, the joint regularization penalty of the solution and the chi-squared of the image fit.

mapping_matrix

pair_dpsi_data_obj

psf_matrix

regularization_matrix

rescaled_dpsi

The dpsi solution rescaled by the plane zeroing it at the three anchor points (Suyu et al.'s scheme), plus the (a_y, a_x, c) coefficients.

source_gradient_matrix

source_plane_data_grid

source_plane_source_gradient

src_mapping_matrix

src_regularization_matrix

do_source_inversion()[source]#

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

property inverse_noise_covariance_matrix#
property psf_matrix#
property source_plane_data_grid#
property source_plane_source_gradient#
property source_gradient_matrix#
property pair_dpsi_data_obj#
property dpsi_gradient_matrix#
property dpsi_points#
property dpsi_linear_obj#
property dpsi_regularization_matrix#
property dpsi_mapping_matrix#
property src_regularization_matrix#
property src_mapping_matrix#
property mapping_matrix#
property regularization_matrix#
property data_vector#
property curvature_matrix#
property curvature_regularization_matrix#
solve_src_dpsi(return_error=False)[source]#
property log_evidence#

noise normalization, the log-determinants of the curvature+regularization matrix and of the source and dpsi regularization matrices, the joint regularization penalty of the solution and the chi-squared of the image fit.

Type:

The Bayesian evidence of the joint source+dpsi inversion

draw_random_solutions(n_solutions=300, return_dkappa=True)[source]#

Draws source/dpsi solutions consistent with the data at the level permitted by the noise and regularizations; when return_dkappa the dpsi block is transformed to convergence corrections via the dpsi mesh’s Laplacian operator.

property best_fit_source#
property best_fit_dpsi#
property rescaled_dpsi#

The dpsi solution rescaled by the plane zeroing it at the three anchor points (Suyu et al.’s scheme), plus the (a_y, a_x, c) coefficients. Falls back to the unrescaled solution when no valid anchor points are set.