Triumvirate C++ API 0.5.0
Three-point clustering measurements in large-scale structure analyses.
Loading...
Searching...
No Matches
io.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
28#ifndef TRIUMVIRATE_INCLUDE_IO_HPP_INCLUDED_
29#define TRIUMVIRATE_INCLUDE_IO_HPP_INCLUDED_
30
31#include <sys/stat.h>
32#include <filesystem>
33#include <string>
34#include <system_error>
35
36#include "parameters.hpp"
37#include "particles.hpp"
38#include "dataobjs.hpp"
39
40namespace trv {
41
42// ***********************************************************************
43// Paths
44// ***********************************************************************
45
46namespace sys {
47
54bool if_filepath_is_set(const std::string& pathstr);
55
62void make_write_dir(std::string dirstr);
63
64} // namespace trv::sys
65
66
67// ***********************************************************************
68// Files
69// ***********************************************************************
70
71namespace io {
72
74const char comment_delimiter[] = "#";
76
77// -----------------------------------------------------------------------
78// Pre-measurement header
79// -----------------------------------------------------------------------
80
94 std::FILE* fileptr, trv::ParameterSet& params,
95 trv::ParticleCatalogue& catalogue_data,
96 trv::ParticleCatalogue& catalogue_rand,
97 double norm_factor_part, double norm_factor_mesh, double norm_factor_meshes
98);
99
114 std::FILE* fileptr,
115 trv::ParameterSet& params, trv::ParticleCatalogue& catalogue,
116 double norm_factor_part, double norm_factor_mesh, double norm_factor_meshes
117);
118
119
120// -----------------------------------------------------------------------
121// Binning details
122// -----------------------------------------------------------------------
123
132 std::FILE* fileptr, trv::ParameterSet& params,
133 trv::BinnedVectors& binned_vectors
134);
135
136
137// -----------------------------------------------------------------------
138// Two-point measurement data table
139// -----------------------------------------------------------------------
140
149 std::FILE* fileptr,
150 trv::ParameterSet& params, trv::PowspecMeasurements& meas_powspec
151);
152
163 std::FILE* fileptr,
165);
166
177 std::FILE* fileptr,
179);
180
181
182// -----------------------------------------------------------------------
183// Three-point measurement data table
184// -----------------------------------------------------------------------
185
196 std::FILE* fileptr,
197 trv::ParameterSet& params, trv::BispecMeasurements& meas_bispec
198);
199
210 std::FILE* fileptr,
212);
213
225 std::FILE* fileptr,
227);
228
229} // namespace trv::io
230} // namespace trv
231
232#endif // !TRIUMVIRATE_INCLUDE_IO_HPP_INCLUDED_
Parameter set.
Particle catalogue.
Definition particles.hpp:68
Clustering measurement data objects.
void print_binned_vectors_to_file(std::FILE *fileptr, trv::ParameterSet &params, trv::BinnedVectors &binned_vectors)
Print binned vectors to a file.
Definition io.cpp:303
void print_measurement_header_to_file(std::FILE *fileptr, trv::ParameterSet &params, trv::ParticleCatalogue &catalogue_data, trv::ParticleCatalogue &catalogue_rand, double norm_factor_part, double norm_factor_mesh, double norm_factor_meshes)
Print the pre-measurement header to a file including information about the catalogue(s) and mesh grid...
Definition io.cpp:100
void print_measurement_datatab_to_file(std::FILE *fileptr, trv::ParameterSet &params, trv::PowspecMeasurements &meas_powspec)
Print measurements as a data table to a file.
Definition io.cpp:358
void make_write_dir(std::string dirstr)
Make write directory.
Definition io.cpp:57
bool if_filepath_is_set(const std::string &pathstr)
Check if a file path is set.
Definition io.cpp:37
Program parameter configuration.
Particle containers with I/O methods and operations.
Binned vectors.
Definition dataobjs.hpp:164
Bispectrum measurements.
Definition dataobjs.hpp:247
Power spectrum measurements.
Definition dataobjs.hpp:200
Three-point correlation function measurements.
Definition dataobjs.hpp:265
Three-point correlation function window measurements.
Definition dataobjs.hpp:286
Two-point correlation function measurements.
Definition dataobjs.hpp:215
Two-point correlation function window measurements.
Definition dataobjs.hpp:228