lenspack.image.inversion module

lenspack.image.inversion.ks93(g1, g2)[source]

Direct inversion of weak-lensing shear to convergence.

This function is an implementation of the Kaiser & Squires (1993) mass mapping algorithm. Due to the mass sheet degeneracy, the convergence is recovered only up to an overall additive constant. It is chosen here to produce output maps of mean zero. The inversion is performed in Fourier space for speed.

Parameters
  • g1 (array_like) – 2D input arrays corresponding to the first and second (i.e., real and imaginary) components of shear, binned spatially to a regular grid.

  • g2 (array_like) – 2D input arrays corresponding to the first and second (i.e., real and imaginary) components of shear, binned spatially to a regular grid.

Returns

kE, kB – E-mode and B-mode maps of convergence.

Return type

tuple of numpy arrays

Raises

AssertionError – For input arrays of different sizes.

See also

bin2d

For binning a galaxy shear catalog.

Examples

>>> # (g1, g2) should in practice be measurements from a real galaxy survey
>>> g1, g2 = 0.1 * np.random.randn(2, 32, 32) + 0.1 * np.ones((2, 32, 32))
>>> kE, kB = ks93(g1, g2)
>>> kE.shape
(32, 32)
>>> kE.mean()
1.0842021724855044e-18
lenspack.image.inversion.ks93inv(kE, kB)[source]

Direct inversion of weak-lensing convergence to shear.

This function provides the inverse of the Kaiser & Squires (1993) mass mapping algorithm, namely the shear is recovered from input E-mode and B-mode convergence maps.

Parameters
  • kE (array_like) – 2D input arrays corresponding to the E-mode and B-mode (i.e., real and imaginary) components of convergence.

  • kB (array_like) – 2D input arrays corresponding to the E-mode and B-mode (i.e., real and imaginary) components of convergence.

Returns

g1, g2 – Maps of the two components of shear.

Return type

tuple of numpy arrays

Raises

AssertionError – For input arrays of different sizes.

See also

ks93

For the forward operation (shear to convergence).