Triumvirate C++ API 0.5.0.post1.dev301+g026f21751
Three-point clustering measurements in large-scale structure analyses.
Loading...
Searching...
No Matches
io.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
29
30#ifndef TRIUMVIRATE_INCLUDE_IO_HPP_INCLUDED_
31#define TRIUMVIRATE_INCLUDE_IO_HPP_INCLUDED_
32
33#include <sys/stat.h>
34#include <filesystem>
35#include <string>
36#include <system_error>
37
38#include "parameters.hpp"
39#include "particles.hpp"
40#include "dataobjs.hpp"
41
42namespace trv {
43
44// ***********************************************************************
45// Paths
46// ***********************************************************************
47
48namespace sys {
49
56bool if_filepath_is_set(const std::string& pathstr);
57
64void make_write_dir(std::string dirstr);
65
66} // namespace trv::sys
67
68
69// ***********************************************************************
70// Files
71// ***********************************************************************
72
73namespace io {
74
76const char comment_delimiter[] = "#";
78
79// -----------------------------------------------------------------------
80// Pre-measurement header
81// -----------------------------------------------------------------------
82
96 std::FILE* fileptr, trv::ParameterSet& params,
97 trv::ParticleCatalogue& catalogue_data,
98 trv::ParticleCatalogue& catalogue_rand,
99 double norm_factor_part, double norm_factor_mesh, double norm_factor_meshes
100);
101
116 std::FILE* fileptr,
117 trv::ParameterSet& params, trv::ParticleCatalogue& catalogue,
118 double norm_factor_part, double norm_factor_mesh, double norm_factor_meshes
119);
120
121
122// -----------------------------------------------------------------------
123// Binning details
124// -----------------------------------------------------------------------
125
134 std::FILE* fileptr, trv::ParameterSet& params,
135 trv::BinnedVectors& binned_vectors
136);
137
138
139// -----------------------------------------------------------------------
140// Two-point measurement data table
141// -----------------------------------------------------------------------
142
151 std::FILE* fileptr,
152 trv::ParameterSet& params, trv::PowspecMeasurements& meas_powspec
153);
154
165 std::FILE* fileptr,
167);
168
179 std::FILE* fileptr,
181);
182
183
184// -----------------------------------------------------------------------
185// Three-point measurement data table
186// -----------------------------------------------------------------------
187
198 std::FILE* fileptr,
199 trv::ParameterSet& params, trv::BispecMeasurements& meas_bispec
200);
201
212 std::FILE* fileptr,
214);
215
227 std::FILE* fileptr,
229);
230
231} // namespace trv::io
232} // namespace trv
233
234#endif // !TRIUMVIRATE_INCLUDE_IO_HPP_INCLUDED_
Parameter set.
Particle catalogue.
Definition particles.hpp:78
Clustering measurement data objects.
Definition io.hpp:73
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:305
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:102
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:360
void make_write_dir(std::string dirstr)
Make write directory.
Definition io.cpp:59
bool if_filepath_is_set(const std::string &pathstr)
Check if a file path is set.
Definition io.cpp:39
Program parameter configuration.
Particle containers with I/O methods and operations.
Binned vectors.
Definition dataobjs.hpp:166
Bispectrum measurements.
Definition dataobjs.hpp:249
Power spectrum measurements.
Definition dataobjs.hpp:202
Three-point correlation function measurements.
Definition dataobjs.hpp:267
Three-point correlation function window measurements.
Definition dataobjs.hpp:288
Two-point correlation function measurements.
Definition dataobjs.hpp:217
Two-point correlation function window measurements.
Definition dataobjs.hpp:230