Potential Correction#

The gravitational-imaging (potential correction) technique: pixelized corrections to the lensing potential, reconstructed alone from an image residual or jointly with the pixelized source by maximising the Bayesian evidence.

Ported from the potential_correction package of Cao et al. 2025 (https://github.com/caoxiaoyue/lensing_potential_correction). If you use this functionality in your research, please cite Cao et al. 2025; citation materials are provided at https://github.com/caoxiaoyue/potential_correction_paper.

RegularDpsiMesh

The mesh component of a DpsiPixelization model: pixelized potential corrections are defined on a rectangular mesh factor times coarser than the data grid.

PairRegularDpsiMesh

Pairs the dpsi mesh to the data grid: cleans the data mask, bins it onto the coarser dpsi mesh (cleaning again), builds the bilinear dpsi-to-data interpolation matrix and the sparse first/second derivative operators of both grids.

DpsiPixelization

The pixelization of the potential corrections: the dpsi mesh (its coarsening factor) plus the regularization scheme applied to the corrections (aa.reg.CurvatureMask, aa.reg.FourthOrderMask or a kernel regularization such as aa.reg.MaternKernel).

DpsiSrcPixelization

The joint pixelization of a source+dpsi inversion: the dpsi pixelization of the potential corrections and the standard autolens pixelization of the source.

SrcFactory

AnalyticSrcFactory

A source factory evaluating an analytic source galaxy's light profiles directly.

PixSrcFactoryITP

A source factory interpolating a pixelized source reconstruction (Delaunay linear interpolation with nearest-neighbour fallback).

FitDpsiImaging

A linear inversion of an image residual for pixelized corrections dpsi to the lensing potential, at fixed source: the residual is modelled as -B D_s D_psi dpsi (PSF blur matrix B, source-gradient matrix D_s, dpsi-gradient operator D_psi), regularized on the dpsi mesh and solved for the maximum-evidence correction.

FitDpsiSrcImaging

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.

FitDpsiSrcInterferometer

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.

IterFitDpsiSrcInterferometer

Iteratively solves for the pixelized source s and potential corrections dpsi of an interferometer dataset, minimizing the penalized visibility objective with a Levenberg-Marquardt loop on the combined state x = [s | dpsi].

DpsiInvAnalysis

Samples the dpsi pixelization (mesh factor + regularization hyper-parameters) of a dpsi-only inversion of an image residual, with the inversion's Bayesian evidence as the likelihood.

DpsiSrcInvAnalysis

Samples the joint source+dpsi pixelization (source pixelization and dpsi mesh/regularization hyper-parameters) of a joint inversion, with the inversion's Bayesian evidence as the likelihood.

DpsiSrcInvInterferometerAnalysis

Samples the joint source+dpsi pixelization of a visibility-space joint inversion (FitDpsiSrcInterferometer), with the inversion's Bayesian evidence as the likelihood.

IterDpsiSrcInvInterferometerAnalysis

Samples the joint source+dpsi pixelization hyper-parameters of the visibility-space iterative LM solver, with its Laplace evidence as the likelihood.