Class FieldStats#

Class Documentation#

class FieldStats#

Field (pseudo-two-point) statistics.

This provides the computation of both binned and unbinned (pseudo) two-point statistiscs that aid the computation of full two- and three-point statistics.

Public Functions

FieldStats(trv::ParameterSet &params)#

Construct pseudo two-point statistics.

Parameters

params – Parameter set.

~FieldStats()#

Destruct two-point statistics.

void reset_stats()#

Reset two-point statistics.

void compute_ylm_wgtd_2pt_stats_in_fourier(MeshField &field_a, MeshField &field_b, std::complex<double> shotnoise_amp, int ell, int m, trv::Binning &kbinning)#

Compute binned two-point statistics in Fourier space.

For a pair of Fourier-space fields \( f_{a,b} \), this computes

\[ \int \frac{\mathrm{d}^2\,\hat{\vec{k}}}{4\pi} y_{LM}(\hat{\vec{k}}) W(\vec{k})^{-2} [ f_a(\vec{k}) f_b(\vec{k}) - P_\mathrm{shot} C_1(\vec{k}) ] \,, \]
where \( W(\vec{k}) \) is the mesh assignment window in Fourier space, \( P_\mathrm{shot} \) is the shot noise amplitude, and \( C_1 \) is the mode-dependent aliasing function.

See also

Eq. (20) in Jing (2004) [astro-ph/0409240].

Note

field_a and field_b are Fourier-space fields and their entries are arranged in the FFTW convention (i.e. shifted).

Parameters
  • field_a – First field.

  • field_b – Second field.

  • shotnoise_amp – Shot-noise amplitude.

  • ell – Degree of the spherical harmonic.

  • m – Order of the spherical harmonic.

  • kbinning – Wavenumber binning.

Throws

trv::sys::InvalidDataError – When field_a and field_b have incompatible physical properties.

void compute_ylm_wgtd_2pt_stats_in_config(MeshField &field_a, MeshField &field_b, std::complex<double> shotnoise_amp, int ell, int m, trv::Binning &rbinning)#

Compute binned two-point statistics in configuration space.

This involves an inverse Fourier transform added to the algorithm in trv::FieldStats::compute_ylm_wgtd_2pt_stats_in_fourier before binning.

Note

field_a and field_b are Fourier-space fields and their entries are arranged in the FFTW convention (i.e. shifted).

Parameters
  • field_a – First field.

  • field_b – Second field.

  • shotnoise_amp – Shot-noise amplitude.

  • ell – Degree of the spherical harmonic.

  • m – Order of the spherical harmonic.

  • rbinning – Separation binning.

void compute_uncoupled_shotnoise_for_3pcf(MeshField &field_a, MeshField &field_b, std::vector<std::complex<double>> &ylm_a, std::vector<std::complex<double>> &ylm_b, std::complex<double> shotnoise_amp, trv::Binning &rbinning)#

Compute binned uncoupled three-point correlation function shot noise.

This computes the quantity

\[ \frac{(-1)^{\ell_a + \ell_b}}{N_\mathrm{mode}(r) V_\mathrm{cell}} \int \frac{\mathrm{d}^2\,\hat{\vec{r}}}{4\pi} y^*_{\ell_a m_a}(\hat{\vec{r}}) y^*_{\ell_b m_b}(\hat{\vec{r}}) \int \frac{\mathrm{d}^3\,\vec{k}}{(2\pi)^3} \mathrm{e}^{\mathrm{i} \vec{k} \cdot \vec{r}} W(\vec{k})^{-2} [f_a(\vec{k}) f_b(\vec{k}) - S C_1(\vec{k})] \,, \]
where \( S \) is the shot noise amplitude (see trv::FieldStats::compute_ylm_wgtd_2pt_stats_in_fourier for other notations).

This method involves additional reduced spherical-harmonic weights after the inverse Fourier transform as in trv::FieldStats::compute_ylm_wgtd_2pt_stats_in_config before binning and additional normalisation.

See also

Eq. (51) in Sugiyama et al. (2019) [1803.02132].

Parameters
  • field_a – First field.

  • field_b – Second field.

  • ylm_a – Reduced spherical harmonics over the first field mesh.

  • ylm_b – Reduced spherical harmonics over the second field mesh.

  • shotnoise_amp – Shot-noise amplitude.

  • rbinning – Separation binning.

std::complex<double> compute_uncoupled_shotnoise_for_bispec_per_bin(MeshField &field_a, MeshField &field_b, std::vector<std::complex<double>> &ylm_a, std::vector<std::complex<double>> &ylm_b, trvm::SphericalBesselCalculator &sj_a, trvm::SphericalBesselCalculator &sj_b, std::complex<double> shotnoise_amp, double k_a, double k_b)#

Compute unbinned uncoupled bispectrum shot noise on the FFT mesh grid.

This computes the quantity

\[ \int \mathrm{d}^3\,\vec{r} j_{\ell_a}(k_a r) j_{\ell_b}(k_b r) y^*_{\ell_a m_a}(\hat{\vec{x}}) y^*_{\ell_b m_b}(\hat{\vec{x}}) \int \frac{\mathrm{d}^3\,\vec{k}}{(2\pi)^3} \mathrm{e}^{\mathrm{i} \vec{k} \cdot \vec{r}} W(\vec{k})^{-2} [f_a(\vec{k}) f_b(\vec{k}) - S C_1(\vec{k})] \]
(see trv::FieldStats::compute_ylm_wgtd_2pt_stats_in_fourier for other notations).

This method involves additional reduced spherical-harmonic weights after the inverse Fourier transform as in trv::FieldStats::compute_ylm_wgtd_2pt_stats_in_config before binning and additional normalisation.

See also

Eq. (45) in Sugiyama et al. (2019) [1803.02132].

Parameters
  • field_a – First field.

  • field_b – Second field.

  • ylm_a – Reduced spherical harmonics over the first field mesh.

  • ylm_b – Reduced spherical harmonics over the second field mesh.

  • sj_a – First spherical Bessel function.

  • sj_b – Second spherical Bessel function.

  • shotnoise_amp – Shot-noise amplitude.

  • k_a, k_b – Wavenumbers at which the shot noise is evaluated.

Returns

Unbinned uncoupled bispectrum shot noise.

trv::BinnedVectors record_binned_vectors(trv::Binning &binning, const std::string &save_file)#

Record binned vectors given a binning scheme.

Parameters
  • binningBinning.

  • save_file – Saved filename if non-empty.

Public Members

std::vector<int> nmodes#

number of wavevector modes in bins

std::vector<int> npairs#

number of separation pairs in bins

std::vector<double> k#

average wavenumber in bins

std::vector<double> r#

average separation in bins

std::vector<std::complex<double>> sn#

shot-noise power in bins

std::vector<std::complex<double>> pk#

pseudo power spectrum in bins

std::vector<std::complex<double>> xi#

pseudo two-point correlation function in bins