Two-point functions¶
Spectra and correlation functions¶
- angst.cl2corr(cl, closed=False)¶
transform angular power spectrum to correlation function
Takes an angular power spectrum with \(\mathtt{n} = \mathtt{lmax}+1\) coefficients and returns the corresponding angular correlation function in \(\mathtt{n}\) points.
The correlation function values can be computed either over the closed interval \([0, \pi]\), in which case \(\theta_0 = 0\) and \(\theta_{n-1} = \pi\), or over the open interval \((0, \pi)\).
- Parameters:
- cl(n,) array_like
Angular power spectrum from \(0\) to \(\mathtt{lmax}\).
- closedbool
Compute correlation function over open (
closed=False) or closed (closed=True) interval.
- Returns:
- corr(n,) array_like
Angular correlation function.
- angst.corr2cl(corr, closed=False)¶
transform angular correlation function to power spectrum
Takes an angular function in \(\mathtt{n}\) points and returns the corresponding angular power spectrum from \(0\) to \(\mathtt{lmax} = \mathtt{n}-1\).
The correlation function must be given at the angles returned by
transformcl.theta(). These can be distributed either over the closed interval \([0, \pi]\), in which case \(\theta_0 = 0\) and \(\theta_{n-1} = \pi\), or over the open interval \((0, \pi)\).- Parameters:
- corr(n,) array_like
Angular correlation function.
- closedbool
Compute correlation function over open (
closed=False) or closed (closed=True) interval.
- Returns:
- cl(n,) array_like
Angular power spectrum from \(0\) to \(\mathtt{lmax}\).
- angst.cl2var(cl)¶
Compute the variance of the spherical random field in a point from the given angular power spectrum. The input can be multidimensional, with the last axis representing the modes.
Shot noise bias¶
Compute the value of the shot noise bias contribution to angular power spectra. For reference, see [arXiv:2408.16903] and [arXiv:2507.03749].
- angst.shotnoise(*, values=None, weights=None, area=None, nside=None)¶
Compute the shot noise bias from values and weights.
The returned value can be normalised by the effective pixel area.
If area is given, it is assumed that the spectra are computed with a convolution kernel of this area.
If nside is given, it is assumed that the spectra are computed from HEALPix maps of this resolution, which implicitly sets area.
This function computes the “raw” shot noise bias of a random field. The returned value should be divided by two to obtain the shot noise bias for E/B-mode power spectra.
Sets of two-point functions¶
- angst.indices2(n)¶
Return an iterator over indices in standard order for a set of two-point functions for n fields. Each item is a tuple of indices i, j.
>>> list(indices2(3)) [(0, 0), (1, 1), (1, 0), (2, 2), (2, 1), (2, 0)]
- angst.enumerate2(entries)¶
Iterate over a set of two-point functions in standard order, returning a tuple of indices and their associated entry from the input.
>>> spectra = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] >>> list(enumerate2(spectra)) [(0, 0, [1, 2, 3]), (1, 1, [4, 5, 6]), (1, 0, [7, 8, 9])]
Standard order¶
All functions that process sets of two-point functions expect them as a sequence using the following “Christmas tree” ordering:
In other words, the sequence begins as such:
Index 0 describes the auto-correlation of field 0,
index 1 describes the auto-correlation of field 1,
index 2 describes the cross-correlation of field 1 and field 0,
index 3 describes the auto-correlation of field 2,
index 4 describes the cross-correlation of field 2 and field 1,
index 5 describes the cross-correlation of field 2 and field 0,
etc.
In particular, two-point functions for the first \(n\) fields are contained in the first \(T_n = n \, (n + 1) / 2\) entries of the sequence.
To easily generate or iterate over sequences of two-point functions in standard
order, see the enumerate2() and indices2() functions.