Triumvirate C++ API 0.5.0.post1.dev301+g026f21751
Three-point clustering measurements in large-scale structure analyses.
Loading...
Searching...
No Matches
dataobjs.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
33
34#ifndef TRIUMVIRATE_INCLUDE_DATAOBJS_HPP_INCLUDED_
35#define TRIUMVIRATE_INCLUDE_DATAOBJS_HPP_INCLUDED_
36
37#include <algorithm>
38#include <cmath>
39#include <complex>
40#include <vector>
41
42#include "monitor.hpp"
43#include "parameters.hpp"
44
45namespace trv {
46
47// ***********************************************************************
48// Binning schemes
49// ***********************************************************************
50
58class Binning {
59 public:
60 std::string space;
61 std::string scheme;
62 double bin_min;
63 double bin_max;
65 std::vector<double> bin_edges;
66 std::vector<double> bin_centres;
67 std::vector<double> bin_widths;
68
76 explicit Binning(std::string space, std::string scheme);
77
85 explicit Binning(trv::ParameterSet& params);
86
104 void set_bins(double coord_min, double coord_max, int nbin);
105
114 void set_bins();
115
131 void set_bins(double boxsize_max, int ngrid_min);
132
140 void set_bins(std::vector<double> bin_edges);
141
142 private:
143 // CAVEAT: Discretionary choices.
144 int nbin_pad = 5;
145 double dbin_pad_fourier = 1.e-3;
146 double dbin_pad_config = 10.;
147
154 void compute_binning();
155};
156
157
158// ***********************************************************************
159// Mesh grids
160// ***********************************************************************
161
167 int count = 0;
168 int num_bins = 0;
169 std::vector<int> indices;
170 std::vector<double> lower_edges;
171 std::vector<double> upper_edges;
172 std::vector<double> vecx;
173 std::vector<double> vecy;
174 std::vector<double> vecz;
175};
176
177
178// ***********************************************************************
179// Line of sight
180// ***********************************************************************
181
187 double pos[3];
188};
189
190// ***********************************************************************
191// Clustering statistics
192// ***********************************************************************
193
194// -----------------------------------------------------------------------
195// Two-point statistics
196// -----------------------------------------------------------------------
197
203 int dim = 0;
204 std::vector<double> kbin;
205 std::vector<double> keff;
206 std::vector<int> nmodes;
208 std::vector< std::complex<double> > pk_raw;
210 std::vector< std::complex<double> > pk_shot;
211};
212
218 int dim = 0;
219 std::vector<double> rbin;
220 std::vector<double> reff;
221 std::vector<int> npairs;
223 std::vector< std::complex<double> > xi;
224};
225
231 int dim = 0;
232 std::vector<double> rbin;
233 std::vector<double> reff;
234 std::vector<int> npairs;
237 std::vector< std::complex<double> > xi;
238};
239
240
241// -----------------------------------------------------------------------
242// Three-point statistics
243// -----------------------------------------------------------------------
244
250 int dim = 0;
251 std::vector<double> k1_bin;
252 std::vector<double> k2_bin;
253 std::vector<double> k1_eff;
254 std::vector<double> k2_eff;
255 std::vector<int> nmodes_1;
256 std::vector<int> nmodes_2;
258 std::vector< std::complex<double> > bk_raw;
260 std::vector< std::complex<double> > bk_shot;
261};
262
268 int dim = 0;
269 std::vector<double> r1_bin;
270 std::vector<double> r2_bin;
271 std::vector<double> r1_eff;
272 std::vector<double> r2_eff;
274 std::vector<int> npairs_1;
276 std::vector<int> npairs_2;
279 std::vector< std::complex<double> > zeta_raw;
281 std::vector< std::complex<double> > zeta_shot;
282};
283
289 int dim = 0;
290 std::vector<double> r1_bin;
291 std::vector<double> r2_bin;
292 std::vector<double> r1_eff;
293 std::vector<double> r2_eff;
295 std::vector<int> npairs_1;
297 std::vector<int> npairs_2;
300 std::vector< std::complex<double> > zeta_raw;
302 std::vector< std::complex<double> > zeta_shot;
303};
304
305} // namespace trv
306
307#endif // !TRIUMVIRATE_INCLUDE_DATAOBJS_HPP_INCLUDED_
std::vector< double > bin_widths
bin widths
Definition dataobjs.hpp:67
std::vector< double > bin_edges
bin edges
Definition dataobjs.hpp:65
Binning(std::string space, std::string scheme)
Construct binnng from bin specification.
Definition dataobjs.cpp:39
std::vector< double > bin_centres
bin centres
Definition dataobjs.hpp:66
std::string scheme
binning scheme
Definition dataobjs.hpp:61
double bin_min
lowest bin edge
Definition dataobjs.hpp:62
std::string space
coordinate space
Definition dataobjs.hpp:60
double bin_max
highest bin edge
Definition dataobjs.hpp:63
void set_bins()
Set bins.
Definition dataobjs.cpp:77
int num_bins
number of bins
Definition dataobjs.hpp:64
Parameter set.
Provide tracking of program resources and exceptions.
Program parameter configuration.
Binned vectors.
Definition dataobjs.hpp:166
std::vector< double > vecy
y-components
Definition dataobjs.hpp:173
std::vector< double > vecz
z-components
Definition dataobjs.hpp:174
int count
number of vectors
Definition dataobjs.hpp:167
int num_bins
number of bins
Definition dataobjs.hpp:168
std::vector< double > upper_edges
upper bin edges
Definition dataobjs.hpp:171
std::vector< double > lower_edges
lower bin edges
Definition dataobjs.hpp:170
std::vector< double > vecx
x-components
Definition dataobjs.hpp:172
std::vector< int > indices
bin indices
Definition dataobjs.hpp:169
Bispectrum measurements.
Definition dataobjs.hpp:249
std::vector< std::complex< double > > bk_raw
bispectrum raw measurements (with normalisation and shot noise)
Definition dataobjs.hpp:258
std::vector< double > k2_eff
second effective wavenumber in bins
Definition dataobjs.hpp:254
std::vector< int > nmodes_2
Definition dataobjs.hpp:256
std::vector< std::complex< double > > bk_shot
bispectrum shot noise
Definition dataobjs.hpp:260
std::vector< double > k1_bin
first central wavenumber in bins
Definition dataobjs.hpp:251
std::vector< double > k1_eff
first effective wavenumber in bins
Definition dataobjs.hpp:253
std::vector< double > k2_bin
second central wavenumber in bins
Definition dataobjs.hpp:252
int dim
dimension of data vector
Definition dataobjs.hpp:250
std::vector< int > nmodes_1
number of first wavevectors in bins
Definition dataobjs.hpp:255
Line-of-sight vector.
Definition dataobjs.hpp:186
double pos[3]
3-d position vector
Definition dataobjs.hpp:187
Power spectrum measurements.
Definition dataobjs.hpp:202
int dim
dimension of data vector
Definition dataobjs.hpp:203
std::vector< double > kbin
central wavenumber in bins
Definition dataobjs.hpp:204
std::vector< int > nmodes
Definition dataobjs.hpp:206
std::vector< std::complex< double > > pk_shot
power spectrum shot noise
Definition dataobjs.hpp:210
std::vector< double > keff
effective wavenumber in bins
Definition dataobjs.hpp:205
std::vector< std::complex< double > > pk_raw
power spectrum raw measurements (with normalisation and shot noise)
Definition dataobjs.hpp:208
Three-point correlation function measurements.
Definition dataobjs.hpp:267
std::vector< double > r2_bin
second central separation in bins
Definition dataobjs.hpp:270
std::vector< int > npairs_1
number of first separation vectors in bins
Definition dataobjs.hpp:274
std::vector< double > r1_bin
first central separation in bins
Definition dataobjs.hpp:269
std::vector< std::complex< double > > zeta_shot
three-point correlation function shot noise
Definition dataobjs.hpp:281
std::vector< double > r2_eff
Definition dataobjs.hpp:272
std::vector< std::complex< double > > zeta_raw
Definition dataobjs.hpp:279
std::vector< double > r1_eff
first effective separation in bins
Definition dataobjs.hpp:271
std::vector< int > npairs_2
number of second separation vectors in bins
Definition dataobjs.hpp:276
int dim
dimension of data vector
Definition dataobjs.hpp:268
Three-point correlation function window measurements.
Definition dataobjs.hpp:288
std::vector< std::complex< double > > zeta_shot
three-point correlation function window shot noise
Definition dataobjs.hpp:302
std::vector< int > npairs_2
number of second separation vectors in bins
Definition dataobjs.hpp:297
std::vector< int > npairs_1
number of first separation vectors in bins
Definition dataobjs.hpp:295
std::vector< double > r1_eff
first effective separation in bins
Definition dataobjs.hpp:292
std::vector< double > r2_eff
Definition dataobjs.hpp:293
int dim
dimension of data vector
Definition dataobjs.hpp:289
std::vector< double > r2_bin
second central separation in bins
Definition dataobjs.hpp:291
std::vector< double > r1_bin
first central separation in bins
Definition dataobjs.hpp:290
std::vector< std::complex< double > > zeta_raw
Definition dataobjs.hpp:300
Two-point correlation function measurements.
Definition dataobjs.hpp:217
std::vector< double > rbin
central separation in bins
Definition dataobjs.hpp:219
std::vector< int > npairs
Definition dataobjs.hpp:221
int dim
dimension of data vector
Definition dataobjs.hpp:218
std::vector< std::complex< double > > xi
two-point correlation function measurements (with normalisation)
Definition dataobjs.hpp:223
std::vector< double > reff
effective separation in bins
Definition dataobjs.hpp:220
Two-point correlation function window measurements.
Definition dataobjs.hpp:230
std::vector< std::complex< double > > xi
Definition dataobjs.hpp:237
int dim
dimension of data vector
Definition dataobjs.hpp:231
std::vector< double > reff
effective separation in bins
Definition dataobjs.hpp:233
std::vector< double > rbin
central separation in bins
Definition dataobjs.hpp:232
std::vector< int > npairs
Definition dataobjs.hpp:234