autolens.potential_correction.FitDpsiSrcImaging#
- class FitDpsiSrcImaging[source]#
Bases:
objectA 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.Imagingdataset.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
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.
Draws source/dpsi solutions consistent with the data at the level permitted by the noise and regularizations; when
return_dkappathe dpsi block is transformed to convergence corrections via the dpsi mesh's Laplacian operator.Attributes
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.
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.
- 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#
- 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_dkappathe 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.