Triumvirate C++ API 0.5.0
Three-point clustering measurements in large-scale structure analyses.
Loading...
Searching...
No Matches
parameters.hpp
Go to the documentation of this file.
1// Copyright (C) [GPLv3 Licence]
2//
3// This file is part of the Triumvirate program. See the COPYRIGHT
4// and LICENCE files at the top-level directory of this distribution
5// for details of copyright and licensing.
6//
7// This program is free software: you can redistribute it and/or modify it
8// under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15// See the GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program. If not, see <https://www.gnu.org/licenses/>.
19
30#ifndef TRIUMVIRATE_INCLUDE_PARAMETERS_HPP_INCLUDED_
31#define TRIUMVIRATE_INCLUDE_PARAMETERS_HPP_INCLUDED_
32
33#include <sys/stat.h>
34
35#include <fftw3.h>
36
37#include <algorithm>
38#include <cmath>
39#include <cstdio>
40#include <cstring>
41#include <fstream>
42#include <string>
43
44#include "monitor.hpp"
45
46namespace trv {
47
56 public:
57 // ---------------------------------------------------------------------
58 // I/O
59 // ---------------------------------------------------------------------
60
62 std::string catalogue_dir;
64 std::string measurement_dir;
70 std::string catalogue_columns;
72 std::string output_tag;
73
74 // ---------------------------------------------------------------------
75 // Mesh sampling
76 // ---------------------------------------------------------------------
77
78 // Mesh properties.
80 double boxsize[3] = {0., 0., 0.};
82 int ngrid[3] = {0, 0, 0};
83
84 // Mesh alignment.
86 std::string alignment = "centre";
88 std::string padscale = "box";
90 double padfactor = 0.;
91
92 // Mesh assignment.
94 std::string assignment = "tsc";
96 std::string interlace = "false";
97
98 // Derived mesh quantities.
99 double volume = 0.;
100 long long nmesh;
101
103
104 // ---------------------------------------------------------------------
105 // Measurement
106 // ---------------------------------------------------------------------
107
108 // Measurement type.
110 std::string catalogue_type;
113 std::string statistic_type;
114
115 // Derived measurement type.
116 std::string npoint;
117 std::string space;
118
119 // Measurement indexing.
121 int ell1 = 0;
123 int ell2 = 0;
125 int ELL = 0;
126
127 int i_wa = 0;
128 int j_wa = 0;
129
130 // Measurement choices.
134 std::string form = "diag";
135
138 std::string norm_convention = "particle";
139
140 // Derived measurement choices.
143 std::string shape = "diag";
144
145 // Measurement parameters.
148 std::string binning = "lin";
149
150 double bin_min = 0.;
151 double bin_max = 0.;
152
154 int num_bins = 0;
156 int idx_bin = 0;
157
158 // ---------------------------------------------------------------------
159 // Misc
160 // ---------------------------------------------------------------------
161
163 std::string fftw_scheme = "measure";
164
166 unsigned fftw_planner_flag = FFTW_MEASURE;
167
169 std::string use_fftw_wisdom = "false";
170
172 std::string fftw_wisdom_file_f;
173 std::string fftw_wisdom_file_b;
174
178 std::string save_binned_vectors = "false";
179
182 int verbose = 20;
183
187 ParameterSet() = default;
188
193 ~ParameterSet() = default;
194
200 ParameterSet(const ParameterSet& other);
201
208 int read_from_file(char* parameter_filepath);
209
219 int validate();
220
228 int print_to_file(char* out_parameter_filepath);
229
238 int print_to_file();
239};
240
241} // namespace trv
242
243#endif // !TRIUMVIRATE_INCLUDE_PARAMETERS_HPP_INCLUDED_
Parameter set.
int validate()
Validate parameters.
std::string alignment
box alignment: {"centre" (default), "pad"}
std::string shape
std::string catalogue_columns
catalogue data columns (comma-separated without space)
long long nmesh
number of mesh grid cells
double bin_min
measurement range minimum (in Mpc/h or h/Mpc)
std::string output_tag
output tag
std::string assignment
mesh assignment scheme: {"ngp", "cic", "tsc" (default), "pcs"}
std::string save_binned_vectors
int ELL
spherical degree associated with the line of sight
unsigned fftw_planner_flag
derived FFTW planner flag
int i_wa
first order of the wide-angle correction term
int print_to_file()
Print out extracted parameters to the default file path in the output measurement directory.
std::string catalogue_dir
catalogue directory
double padfactor
padding factor
ParameterSet()=default
Construct a parameter set.
std::string fftw_scheme
FFTW scheme: {"estimate", "measure" (default), "patient"}.
double volume
box volume (in Mpc^3/h^3)
~ParameterSet()=default
Destroy the parameter set.
int read_from_file(char *parameter_filepath)
Read parameters from a file.
std::string norm_convention
std::string statistic_type
std::string measurement_dir
measurement/output directory
std::string space
coordinate space: {"fourier", "config"}
std::string catalogue_type
catalogue type: {"survey", "random", "sim", "none"}
int ell1
spherical degree associated with the first wavevector
std::string fftw_wisdom_file_b
backward-transform wisdom file path
int num_bins
number of measurement bins
std::string padscale
padding scale (if alignment is "pad"): {"box" (default), "grid"}
std::string interlace
interlacing switch: {"true"/"on", "false"/"off" (default)}
int assignment_order
order of the assignment scheme
std::string binning
std::string fftw_wisdom_file_f
derived FFTW wisdom file paths
int ell2
spherical degree associated with the second wavevector
int ngrid[3]
grid number in each dimension
std::string data_catalogue_file
data catalogue file
std::string npoint
N-point case: {"2pt", "3pt", "none"}
std::string rand_catalogue_file
random catalogue file
int idx_bin
fixed bin index in "off-fiag"/"row" form three-point measurements
int j_wa
second order of the wide-angle correction term
double boxsize[3]
box size (in Mpc/h) in each dimension
std::string use_fftw_wisdom
use FFTW wisdom: {"false" (default), <path-to-dir>}
double bin_max
measurement range maximum (in Mpc/h or h/Mpc)
Provide tracking of program resources and exceptions.