---
title: "Turning a shear field into a mass map"
description: "Invert shear to convergence in Fourier space, use the B mode as a null test, estimate map noise and see why a uniform mass sheet stays hidden."
canonical_url: "https://sandboxphysics.com/stories/weak-lensing/from-shear-to-a-mass-map/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/weak-lensing/from-shear-to-a-mass-map/"
last_modified: "2026-11-14"
---

[Weak gravitational lensing and mass maps](https://sandboxphysics.com/stories/weak-lensing/)

# Turning a shear field into a mass map

Sandbox Physics · 2026-11-14

Convergence and shear are second derivatives of the same potential, so in Fourier space the shear is just the convergence rotated by twice the angle of the wave vector. Rotating back turns a measured shear field into a convergence map. The rotation also yields a second, imaginary map that lensing leaves empty, a built-in null test. Two things are lost on the way: the mean of the map, because a uniform mass sheet changes no shape, and sharpness, because the map must be smoothed to keep its noise finite.

Read [convergence, shear and what a galaxy shape measures](https://sandboxphysics.com/stories/weak-lensing/convergence-shear-and-galaxy-shapes/) first. This chapter uses two-dimensional Fourier transforms and complex exponentials.

## Shear and convergence in Fourier space

Write the potential as a sum of plane waves, $\psi(\boldsymbol\theta)=\int\frac{\mathrm d^2\ell}{(2\pi)^2}\,\hat\psi(\boldsymbol\ell)\,e^{i\boldsymbol\ell\cdot\boldsymbol\theta}$. Each derivative $\partial_j$ becomes a factor $i\ell_j$, so $\psi_{,jk}\to-\ell_j\ell_k\hat\psi$. From the definitions in the previous chapter,

$$
\hat\kappa=-\tfrac12\left(\ell_1^2+\ell_2^2\right)\hat\psi,\qquad \hat\gamma_1=-\tfrac12\left(\ell_1^2-\ell_2^2\right)\hat\psi,\qquad \hat\gamma_2=-\ell_1\ell_2\,\hat\psi .
$$

Combine the shear into $\hat\gamma=\hat\gamma_1+i\hat\gamma_2=-\tfrac12(\ell_1+i\ell_2)^2\hat\psi$ and divide by $\hat\kappa$. With $\ell_1+i\ell_2=\ell e^{i\beta}$,

$$
\hat\gamma(\boldsymbol\ell)=\frac{(\ell_1+i\ell_2)^2}{\ell^2}\,\hat\kappa(\boldsymbol\ell)=e^{2i\beta}\,\hat\kappa(\boldsymbol\ell).
$$

[Cosmology with cosmic shear observations: a review, Eq. 30](https://arxiv.org/abs/1411.0115v2)

The factor $e^{2i\beta}$ has modulus one. Shear and convergence therefore have the same power at every scale; only the phase differs.

## Inverting: the Kaiser-Squires map

Multiply by $e^{-2i\beta}$ to undo the rotation:

$$
\hat\kappa_E+i\hat\kappa_B=\frac{(\ell_1^2-\ell_2^2)-2i\,\ell_1\ell_2}{\ell^2}\,\hat\gamma(\boldsymbol\ell),\qquad \boldsymbol\ell\ne0 .
$$

Kaiser and Squires wrote the same result in real space, as a convolution of the shear with a kernel that falls off as $1/\theta^2$. [Weak Gravitational Lensing, Eqs. 5.3-5.4](https://arxiv.org/abs/astro-ph/9912508v1) In practice one bins galaxy ellipticities on a grid, takes a fast Fourier transform, multiplies by the kernel above and transforms back.

For a shear field that really comes from a real convergence, the imaginary part $\kappa_B$ is zero. Measured shapes also carry noise, imperfect corrections for the telescope's blurring and, in principle, alignments that galaxies acquire on their own. These need not be curl-free, so they can fill $\kappa_B$. The B map is a null test: it should look like pure noise. [Discriminating weak lensing from intrinsic spin correlations using the curl-gradient decomposition](https://arxiv.org/abs/astro-ph/0012336v1)

**Worked example.** Take a single convergence wave along $x$, $\kappa=A\cos\ell x$. Its wave vector has $\beta=0$, so $e^{2i\beta}=1$ and $\gamma_1=A\cos\ell x$, $\gamma_2=0$. Where $\kappa$ is positive, images stretch along $x$, across the crest; where it is negative, along $y$. A ridge of mass acts like a cylindrical lens and magnifies only across itself. Turn the wave to run along $y$. Now $\beta=90^\circ$ and $e^{2i\beta}=-1$, so $\gamma_1=-A\cos\ell y$: the stretch turns with the wave and again runs across the crests.

## The mode that cannot be recovered

At $\boldsymbol\ell=0$ the kernel is undefined. That mode is the mean convergence of the field, and it is lost because a uniform sheet makes no shear. More precisely, shapes measure $g=\gamma/(1-\kappa)$, and the transformation

$$
\kappa\to\kappa'=\lambda\kappa+(1-\lambda),\qquad \gamma\to\gamma'=\lambda\gamma
$$

keeps $g$ fixed for any $\lambda\ne0$: $\gamma'/(1-\kappa')=\lambda\gamma/[\lambda(1-\kappa)]=g$. This is the mass-sheet degeneracy. Shapes alone cannot tell the original mass from a weakened copy plus a uniform sheet. The magnification changes, $\mu'=\mu/\lambda^2$, so galaxy sizes or number counts can break it. [Weak Gravitational Lensing, Eqs. 5.9-5.10](https://arxiv.org/abs/astro-ph/9912508v1)

A small-field Kaiser-Squires map simply sets the mean of the field to zero. Our [reproducible tutorial](https://sandboxphysics.com/stories/weak-lensing/recompute-shear-correlations/) checks this on a noise-free isothermal halo in a $40'$ field. Away from the edges, the reconstruction differs from the truth by an almost constant offset of $0.0225$. The true mean convergence of the field is $0.0220$. After removing the offset, the residual is a tenth of the signal.

## Noise and smoothing

With galaxies at random positions, the Kaiser-Squires estimate has infinite noise unless it is smoothed. Model each shear component as white noise. Galaxies with scatter $\sigma_\epsilon$ per component and density $n$ give a noise power of $\sigma_\epsilon^2/n$ in each component. The inversion kernel has modulus one, so $\kappa_E$ and $\kappa_B$ each inherit noise power $\sigma_\epsilon^2/n$. Smooth with a Gaussian of width $\theta_{\rm s}$, whose Fourier window is $e^{-\ell^2\theta_{\rm s}^2/2}$. The noise variance of the map is

$$
\sigma_\kappa^2=\int\frac{\mathrm d^2\ell}{(2\pi)^2}\,\frac{\sigma_\epsilon^2}{n}\,e^{-\ell^2\theta_{\rm s}^2}=\frac{\sigma_\epsilon^2}{4\pi\,\theta_{\rm s}^2\,n} .
$$

**Worked example.** With $\sigma_\epsilon=0.26$, $n=20\ \mathrm{arcmin^{-2}}$ and $\theta_{\rm s}=1'$, $\sigma_\kappa=0.26/\sqrt{4\pi\times20}=0.016$. A simulation of pure Gaussian noise on a fine grid gives $0.0164$ in the E map and $0.0162$ in the B map. A cluster with $\theta_{\rm E}=20''$ has $\kappa=0.17$ at $1'$, but only the parts of it wider than about $1'$ survive the smoothing. Halving $\theta_{\rm s}$ doubles the noise.

Smoothing trades resolution for noise. Edges cost more. Shear outside the field is unknown and usually set to zero, so structure just beyond the edge leaks into the map. Masks inside the field do the same. Each map pixel near an edge is less certain than the formula says.

## Lab tasks

1. In [the weak-lensing mass map Lab](https://sandboxphysics.com/labs/weak-lensing-mass-map/), compare the E-mode and B-mode maps for the default field. Does the B map show either halo?
2. Load Too few galaxies. Predict from the noise formula how much worse the map should be at 4 galaxies per square arcminute than at 20, then compare the peak-over-noise readout.
3. Load A hidden mass sheet. The shapes are the same as before. Which readouts stay fixed and which move? Look at the galaxy sizes too.
4. Open the advanced settings and change the smoothing scale from 0.5 to 2 arcminutes. Describe what happens to the two halos and to the noise.

## Exercises

1. Derive $\hat\gamma=e^{2i\beta}\hat\kappa$ from the potential, and show that $|\hat\gamma|^2=|\hat\kappa|^2$.
2. Show that under $\kappa\to\lambda\kappa+(1-\lambda)$, $\gamma\to\lambda\gamma$, the magnification becomes $\mu/\lambda^2$.
3. A convergence wave runs at $45^\circ$: $\kappa=A\cos[\ell(x+y)/\sqrt2]$. Find $\gamma_1$ and $\gamma_2$.
4. What smoothing scale gives $\sigma_\kappa=0.01$ with $\sigma_\epsilon=0.26$ and $n=20\ \mathrm{arcmin^{-2}}$?
5. Rotate every measured ellipticity by $45^\circ$, $\epsilon\to i\epsilon$. What happens to the E and B maps?

Answers

1. With $\psi_{,jk}\to-\ell_j\ell_k\hat\psi$: $\hat\gamma_1+i\hat\gamma_2=-\tfrac12(\ell_1^2-\ell_2^2+2i\ell_1\ell_2)\hat\psi=-\tfrac12(\ell_1+i\ell_2)^2\hat\psi$ and $\hat\kappa=-\tfrac12\ell^2\hat\psi$. The ratio is $(\ell_1+i\ell_2)^2/\ell^2=e^{2i\beta}$, of modulus one.
2. $\mu'^{-1}=(1-\kappa')^2-|\gamma'|^2=\lambda^2(1-\kappa)^2-\lambda^2|\gamma|^2=\lambda^2\mu^{-1}$.
3. $\beta=45^\circ$, so $e^{2i\beta}=i$: $\gamma_1=0$ and $\gamma_2=A\cos[\ell(x+y)/\sqrt2]$.
4. $\theta_{\rm s}=0.26/(0.01\sqrt{4\pi\times20})=1.64'$.
5. $\kappa_E+i\kappa_B$ is linear in $\gamma$, so it is multiplied by $i$: the new E map is $-\kappa_B$ and the new B map is $\kappa_E$. A $45^\circ$ error in the shape convention moves all the mass into the null map, which is why the B map catches it.

Next: [shear correlation functions and redshift tomography](https://sandboxphysics.com/stories/weak-lensing/shear-correlations-and-tomography/).

## Try it in the Lab

[Weak-lensing mass map](https://sandboxphysics.com/labs/weak-lensing-mass-map/): Load the hidden mass sheet and check which readouts move and which stay put.

## Sources

1. [Cosmology with cosmic shear observations: a review, Eq. 30](https://arxiv.org/abs/1411.0115v2)
2. [Weak Gravitational Lensing, Eqs. 5.3-5.4](https://arxiv.org/abs/astro-ph/9912508v1)
3. [Discriminating weak lensing from intrinsic spin correlations using the curl-gradient decomposition](https://arxiv.org/abs/astro-ph/0012336v1)

## Keep reading

Weak gravitational lensing and mass maps · Reading path

### From galaxy shapes to a map of mass

1. [Article **How can galaxies that are barely stretched map dark matter?**](https://sandboxphysics.com/stories/weak-lensing/galaxy-shapes-weigh-dark-matter/)
2. [Article **Convergence, shear and what a galaxy shape measures**](https://sandboxphysics.com/stories/weak-lensing/convergence-shear-and-galaxy-shapes/)
3. [You are here **Turning a shear field into a mass map**](https://sandboxphysics.com/stories/weak-lensing/from-shear-to-a-mass-map/)
4. [Article **Shear correlation functions and redshift tomography**](https://sandboxphysics.com/stories/weak-lensing/shear-correlations-and-tomography/)
5. [Article **Recompute shear correlations and tomography from a simulation**](https://sandboxphysics.com/stories/weak-lensing/recompute-shear-correlations/)
6. [Article **How to read the DES Year 3 lensing and clustering analysis**](https://sandboxphysics.com/stories/weak-lensing/reading-des-y3-lensing-and-clustering/)
