calculate_shear_power

randomfield.lensing.calculate_shear_power(DC, DA, weights, variances, mode='shear-shear-auto')[source] [edit on github]

Calculate the shear power spectrum as a function of source position.

The result is given as (X = E,g):

\[\Delta^2_{EX}(\ell) = \frac{\ell^2}{2\pi} C_{EX}(\ell)\]

and calculated as a convolution of the input weight functions \(\omega_E(D, D_{src})\) and 3D variances \(V(\ell, D_A)\). There are three possible calculations, depending on the mode parameter. Shear-shear auto power is calculated as:

\[\Delta^2_{EE}(D_{src}, \ell) = \int_{D_{min}}^{D_{src}} \omega_E(D, D_{src})^2 D_A(D)^3 V(\ell, D_A(D)) dD\]

Shear-shear cross power is calculated as:

\[\Delta^2_{EE}(D_1, D_2, \ell) = \int_{D_{min}}^{\min(D_1,D_2)} \omega_E(D, D_1) \omega_E(D, D_2) D_A(D)^3 V(\ell, D_A(D)) dD\]

Shear-galaxy cross power is calculated as:

\[\Delta^2_{Eg}(D_{src}, D_g, \ell) = \omega_E(D_g, D_{src}) D_A(D_g)^3 V(\ell, D_A(D_g))\]

Note that no bias factor is included in the shear-galaxy calculation, so results should be interpreted as \(\Delta^2_{Eg} / b_g\).

The convolution integrals above are estimated using Simpson's rule and finer grids will generally yield more accurate results.

Note that the integrals above are truncated at \(D_{min} > 0\) equal to DC[0], in order to set a finite upper bound on the 3D wavenumber \(k = \ell/D_A\). This truncation procedure effectively ignores any lensing by mass inhomogeneities closer than DC[0]. Reducing \(D_{min}\) will increase the accuracy of the calculation but also requires either increasing the range of 3D wavenumbers \(k\) or decreasing the range of 2D wavenumbers \(\ell\) used to calculate \(V(\ell, D_A(D))\).

It is the caller’s responsibility to ensure that the inputs are all calculated on consistent grids and with consistent units (Mpc or Mpc/h).

Parameters:

DC : numpy.ndarray

1D array of comoving distances along the line of sight corresponding to each redshift. Units can be either Mpc or Mpc/h, but must be consistent with how the weights and variances were calculated.

DA : numpy.ndarray

1D array of comoving transverse distances corresponding to each redshift. Units can be in either Mpc/h or Mpc, but must be consistent with DC and with how the weights and variances were calculated.

weights : numpy.ndarray

2D array of geometric lensing weights \(\omega_E(D, D_{src})\), normally obtained by calling calculate_lensing_weights(). Units (Mpc or Mpc/h) must be consistent with those used for DC and variances. The shape must be (nDC, nDC) where nDC = len(DC).

variances : numpy.ndarray

2D array of 3D matter power contributions \(V(\ell, D_A)\) to the shear variance, normally obtained by calling tabulate_3D_variances(). Must be tabulated using units that are consistent with those used for DC and weights. The shape must be (nell, nDC) where nDC = len(DC).

mode : str, optional

Must be one of ‘shear-shear-auto’, ‘shear-shear-cross’, or ‘shear-galaxy-cross’. Specifies the type of power spectrum that is calculated and determines the shape of the result.

Returns:

numpy.ndarray

For ‘shear-shear-auto’, the result is a 2D array of lensing power spectra with shape (nDC, nell) where nDC = len(DC) and nell = weights.shape[0]. The value out[i,n] gives \(\Delta^2_{EE}\) as a function of ell[n] for a lensed source at distance DC[i] (where ell is the array of 2D wavenumbers used to tabulate the input variances).

For ‘shear-shear-cross’, the result is a 3D array of lensing power cross spectra with shape (nDC, nDC, nell). The value out[i,j,n] gives \(\Delta^2_{EE}\) as a function of ell[n] for lensed sources at distances DC[i] and DC[j]. The result is symmetric in i and j, and the diagonal i = j equals the ‘shear-shear-auto’ result.

For ‘shear-galaxy-cross’, the result is a 3D array of galaxy-lensing cross spectra with shape (nDC, nDC, nell). The value out[i,j,n] gives \(\Delta^2_{Eg}\) as a function of ell[n] for a lensed source at distance DC[i] and a galaxy at distance DC[j].