Recompute shear correlations and tomography from a simulation
Sandbox Physics ·
This guide measures the shear correlation functions ξ± in two redshift bins from 24 restricted simulations and compares them with two predictions. It recovers the Einstein radius of an isothermal halo from 200 noisy catalogs without measurable bias, then breaks the analysis on purpose: shapes rotated by 45∘ flip the sign of ξ−, and moving 20 percent of far galaxies into the near bin raises the near-bin signal by 42 percent. Every number comes from one script that runs in under ten seconds. Nothing here is survey data.
The script writes outputs/computed-outputs.json, compares every number with expected-outputs.json at a relative tolerance of 10−6 and prints PASS or the mismatches. We ran it with Python 3.9.6, numpy 2.0.2 and scipy 1.13.1. Another numpy version may draw different random numbers; then python3 reproduce.py --write-expected saves your own outputs, and the statistics below should stay close.
What the simulation contains
Table 5.1 Units and settings shared by every script.
Quantity
Setting
Angles
arcminutes; multipoles ℓ per radian
Distances
comoving, in units of c/H0, flat universe with Ωm=0.3
Grid
512×512 pixels of 0.5′, periodic, so a 256′ square
Lens planes
z=0.25, 0.5, 0.8, independent Gaussian fields
Plane spectrum
P(ℓ)=6×10−10(ℓ/1000)−1.2e−(ℓ/6000)2
Shear
γ^=e2iβκ^ on the grid, mean set to zero
Shapes
ϵ=ϵs+γ, with σϵ=0.26 per component
Source bins
zs=0.6 and 1.2, 10 galaxies per square arcminute each
This is a restricted simulation. It has no N-body structure, no nonlinear clustering, no correlation between planes, no masks, no point-spread function, no intrinsic alignments and a single redshift per bin. The shapes use the weak-shear limit, which drops terms of order κγ.
The estimator
Each galaxy is assigned to a pixel. Summing ellipticities per pixel and correlating the sums with fast Fourier transforms gives, for every lag Δ on the periodic grid,
summed over lags in each angular bin from 1′ to 40′. Zero lag, which holds every galaxy paired with itself and therefore the shape noise, is excluded. This is the pair estimator of the review with unit weights. Cosmology with cosmic shear observations: a review, Eq. 33
Two predictions
The grid expectation is the exact mean the estimator must return on this periodic grid. It sums the input power spectrum over the grid's own wave vectors, with the same pair weights per lag. The continuous prediction is the flat-sky Hankel transform ξ±=(2π)−1∫dℓℓJ0,4(ℓθ)P(ℓ), computed with adaptive quadrature. Cosmology with cosmic shear observations: a review, Eq. 35 Both are multiplied by the tomographic weight of each bin pair.
Table 5.2 Tomographic weights from the plane weights Wip.
Correlation
∑pWipWjp
Near bin, zs=0.6
0.319
Far bin, zs=1.2
2.277
Near with far
0.606
Table 5.3 Measured against the grid expectation: diagonal χ2 over 8 angular bins, using the standard error of the 24-field mean.
Correlation
χ2 for ξ+
χ2 for ξ−
Near bin
6.0
7.1
Far bin
12.3
4.1
Near with far
15.6
4.9
Neighbouring angular bins share structures, so the eight terms are correlated. These χ2 values ignore that and are a guide, not a goodness-of-fit test. 15.6 for 8 independent bins would have p≈0.05; we did not estimate the covariance needed to decide whether the cross-correlation ξ+ is in mild tension or simply correlated.
The two predictions disagree at large separations for ξ+, and they should. At 33′ the far-bin grid expectation is 2.10×10−5 and the Hankel value is 4.51×10−5; the measurement is (2.74±0.50)×10−5. The 256′ box contains no wave vector below ℓ=2π/256′≈84, and J0 gives those long waves a large weight at large θ. J4 suppresses them, so for ξ− the predictions agree to 2 percent at 33′. A finite field measures the finite-field expectation.
Failure cases kept on purpose
Shapes rotated by 45 degrees. Replacing every far-bin ellipticity by iϵ leaves ξ+ identical to the last digit and flips the sign of ξ−: at 5.2′ it goes from +9.77×10−5 to −9.77×10−5. A sign or angle error in a shape catalog shows up as a negative ξ− and, in a map, as mass in the B mode.
Redshift outliers. Moving a random 20 percent of far-bin galaxies into the near bin raises the near-bin weight from 0.319 to 0.453. The contaminated ξ+ gives χ2=469.5 against the nominal prediction and 8.2 against the mixture prediction, both over 8 bins. A wrong redshift distribution does not add noise. It moves the signal.
Recovering an isothermal halo
The second test is independent of the Lab code. A singular isothermal sphere with θE=0.5′ sits at the centre of a 40′ field. Each of 200 trials draws 20 galaxies per square arcminute at random positions and Gaussian intrinsic shapes with σϵ=0.26. It applies the exact transformation ϵ=(ϵs+g)/(1+g∗ϵs) with g=γ/(1−κ), drops galaxies inside θE so that ∣g∣<1, bins the tangential ellipticity in annuli from 1′ to 16′ and fits θE by least squares. Weak Gravitational Lensing, Eqs. 3.17-3.18
Table 5.4 Halo recovery over 200 trials.
Quantity
Value
True θE
0.5′
Mean fitted θE
0.4997′±0.0018′
Scatter of the fits
0.0253′
Median quoted uncertainty
0.0224′
Standard deviation of the pulls
1.14
Cross-shear significance, mean and spread
0.07 and 0.99
The fit is unbiased. The quoted uncertainties are about 12 percent too small; we have not traced why. The cross shear behaves like pure noise, as it should for a lens.
The first version of the fit placed each annulus at its arithmetic-mean radius and came out 1.2 percent high. The shear falls as 1/θ, so the average shear in an annulus matches the model at the harmonic-mean radius. Switching to that radius removed the bias.
Testing the map inversion
A noise-free isothermal halo on a 256×256 grid, inverted with Kaiser-Squires, checks what the map can recover. In the inner half of the field, excluding the centre, the true convergence has an rms of 0.042. The reconstruction differs from it by a nearly constant offset of 0.0225; the true mean convergence of the field is 0.0220. After removing the offset the residual rms is 0.0036, and the B mode has an rms of 0.0007. The lost mode is the field mean, as the mass-sheet argument predicts.
What this does not show
Nothing here reproduces a survey measurement. The simulation tests the estimator, the tomographic bookkeeping and two failure modes on Gaussian fields with known answers. Real cosmic shear needs nonlinear structure, realistic redshift distributions, masks, weights and calibration of the shape measurement. The guide to the DES Year 3 analysis shows how one survey handles them.