Triumvirate C++ API 0.5.0.post1.dev301+g026f21751
Three-point clustering measurements in large-scale structure analyses.
Loading...
Searching...
No Matches
twopt.hpp
Go to the documentation of this file.
1// Triumvirate: Three-Point Clustering Measurements in LSS
2//
3// Copyright (C) 2023 Mike S Wang & Naonori S Sugiyama [GPL-3.0-or-later]
4//
5// This file is part of the Triumvirate program. See the COPYRIGHT
6// and LICENCE files at the top-level directory of this distribution
7// for details of copyright and licensing.
8//
9// This program is free software: you can redistribute it and/or modify it
10// under the terms of the GNU General Public License as published by
11// the Free Software Foundation, either version 3 of the License, or
12// (at your option) any later version.
13//
14// This program is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17// See the GNU General Public License for more details.
18//
19// You should have received a copy of the GNU General Public License
20// along with this program. If not, see <https://www.gnu.org/licenses/>.
21
38
39#ifndef TRIUMVIRATE_INCLUDE_TWOPT_HPP_INCLUDED_
40#define TRIUMVIRATE_INCLUDE_TWOPT_HPP_INCLUDED_
41
42#include <fftw3.h>
43
44#include <algorithm>
45#include <cmath>
46#include <complex>
47#include <cstdio>
48
49#include "monitor.hpp"
50#include "maths.hpp"
51#include "parameters.hpp"
52#include "dataobjs.hpp"
53#include "particles.hpp"
54#include "field.hpp"
55
56namespace trv {
57
58// ***********************************************************************
59// Coupling coefficients
60// ***********************************************************************
61
75double calc_coupling_coeff_2pt(int ell, int ELL, int m, int M);
76
77
78// ***********************************************************************
79// Normalisation
80// ***********************************************************************
81
90 ParticleCatalogue& particles, double alpha = 1.
91);
92
102 trv::ParticleCatalogue& particles,
103 trv::ParameterSet& params, double alpha = 1.
104);
105
123 trv::ParticleCatalogue& particles_data,
124 trv::ParticleCatalogue& particles_rand,
125 trv::ParameterSet& params, double alpha
126);
127
151 trv::ParticleCatalogue& particles_data,
152 trv::ParticleCatalogue& particles_rand,
153 trv::ParameterSet& params, double alpha,
154 double padding, double cellsize, const std::string& assignment
155);
156
157
158// ***********************************************************************
159// Shot noise
160// ***********************************************************************
161
170 ParticleCatalogue& particles, double alpha = 1.
171);
172
202std::complex<double> calc_ylm_wgtd_shotnoise_amp_for_powspec(
203 ParticleCatalogue& particles_data, ParticleCatalogue& particles_rand,
204 LineOfSight* los_data, LineOfSight* los_rand,
205 double alpha, int ell, int m
206);
207
221std::complex<double> calc_ylm_wgtd_shotnoise_amp_for_powspec(
222 ParticleCatalogue& particles, LineOfSight* los,
223 double alpha, int ell, int m
224);
225
226
227// ***********************************************************************
228// Full statistics
229// ***********************************************************************
230
231// STYLE: Standard naming convention is not always followed for
232// intermediary quantities in the functions below.
233
246trv::PowspecMeasurements compute_powspec(
247 ParticleCatalogue& catalogue_data, ParticleCatalogue& catalogue_rand,
248 LineOfSight* los_data, LineOfSight* los_rand,
249 trv::ParameterSet& params, trv::Binning& kbinning,
250 double norm_factor
251);
252
266trv::TwoPCFMeasurements compute_corrfunc(
267 ParticleCatalogue& catalogue_data, ParticleCatalogue& catalogue_rand,
268 LineOfSight* los_data, LineOfSight* los_rand,
269 trv::ParameterSet& params, trv::Binning& rbinning,
270 double norm_factor
271);
272
283trv::PowspecMeasurements compute_powspec_in_gpp_box(
284 ParticleCatalogue& catalogue_data,
285 trv::ParameterSet& params, trv::Binning kbinning,
286 double norm_factor
287);
288
299trv::TwoPCFMeasurements compute_corrfunc_in_gpp_box(
300 ParticleCatalogue& catalogue_data,
301 trv::ParameterSet& params, trv::Binning& rbinning,
302 double norm_factor
303);
304
317trv::TwoPCFWindowMeasurements compute_corrfunc_window(
318 trv::ParticleCatalogue& catalogue_rand, trv::LineOfSight* los_rand,
319 trv::ParameterSet& params, trv::Binning rbinning,
320 double alpha, double norm_factor
321);
322
323} // namespace trv
324
325#endif // !TRIUMVIRATE_INCLUDE_TWOPT_HPP_INCLUDED_
Particle catalogue.
Definition particles.hpp:78
Clustering measurement data objects.
Mesh field (with one-point statistics) and pseudo two-point statistics.
Mathematical calculations.
Provide tracking of program resources and exceptions.
double calc_powspec_shotnoise_from_particles(ParticleCatalogue &particles, double alpha=1.)
Calculate particle-based power spectrum shot noise level.
Definition twopt.cpp:271
trv::TwoPCFWindowMeasurements compute_corrfunc_window(trv::ParticleCatalogue &catalogue_rand, trv::LineOfSight *los_rand, trv::ParameterSet &params, trv::Binning rbinning, double alpha, double norm_factor)
Compute two-point correlation function window from a random catalogue and optionally save the results...
Definition twopt.cpp:795
trv::TwoPCFMeasurements compute_corrfunc(ParticleCatalogue &catalogue_data, ParticleCatalogue &catalogue_rand, LineOfSight *los_data, LineOfSight *los_rand, trv::ParameterSet &params, trv::Binning &rbinning, double norm_factor)
Compute two-point correlation function from paired survey-type catalogues.
Definition twopt.cpp:498
double calc_coupling_coeff_2pt(int ell, int ELL, int m, int M)
Calculate the coupling coefficient for spherical-harmonic components of full two-point statistics.
Definition twopt.cpp:45
std::complex< double > calc_ylm_wgtd_shotnoise_amp_for_powspec(ParticleCatalogue &particles_data, ParticleCatalogue &particles_rand, LineOfSight *los_data, LineOfSight *los_rand, double alpha, int ell, int m)
Calculate power spectrum shot noise weighted by reduced spherical harmonics.
Definition twopt.cpp:298
trv::PowspecMeasurements compute_powspec_in_gpp_box(ParticleCatalogue &catalogue_data, trv::ParameterSet &params, trv::Binning kbinning, double norm_factor)
Compute power spectrum in a periodic box in the global plane-parallel approximation.
Definition twopt.cpp:609
double calc_powspec_normalisation_from_particles(ParticleCatalogue &particles, double alpha=1.)
Calculate particle-based power spectrum normalisation.
Definition twopt.cpp:56
double calc_powspec_normalisation_from_mesh(trv::ParticleCatalogue &particles, trv::ParameterSet &params, double alpha=1.)
Calculate mesh-based power spectrum normalisation.
Definition twopt.cpp:98
trv::PowspecMeasurements compute_powspec(ParticleCatalogue &catalogue_data, ParticleCatalogue &catalogue_rand, LineOfSight *los_data, LineOfSight *los_rand, trv::ParameterSet &params, trv::Binning &kbinning, double norm_factor)
Compute power spectrum from paired survey-type catalogues.
Definition twopt.cpp:388
trv::TwoPCFMeasurements compute_corrfunc_in_gpp_box(ParticleCatalogue &catalogue_data, trv::ParameterSet &params, trv::Binning &rbinning, double norm_factor)
Compute two-point correlation function in a periodic box in the global plane-parallel approximation.
Definition twopt.cpp:703
double calc_powspec_normalisation_from_meshes(trv::ParticleCatalogue &particles_data, trv::ParticleCatalogue &particles_rand, trv::ParameterSet &params, double alpha)
Calculate power spectrum normalisation from mixed meshes.
Definition twopt.cpp:111
Program parameter configuration.
Particle containers with I/O methods and operations.
Line-of-sight vector.
Definition dataobjs.hpp:186