CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
3pt_multipoles.cpp

This example shows how to measure the three-point correlation function legendre coefficients

// ============================================================================
// Example code: how to measure the three-point correlation function multipoles
// ============================================================================
#include "GlobalFunc.h"
int main () {
try {
// --------------------------------------------------------------
// ---------------- set the cosmological parameters ------------
// --------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------------
// ---------------- read the input catalogue (with observed coordinates: R.A., Dec, redshift) ----------------
// -----------------------------------------------------------------------------------------------------------
std::string file_catalogue = "../input/cat.dat";
// --------------------------------------------------------------------------------------
// ---------------- construct the random catalogue (with cubic geometry) ----------------
// --------------------------------------------------------------------------------------
const double N_R = 2.; // random/data ratio
// -------------------------------------------------------------------------------
// ---------------- measure the three-point correlation functions ----------------
// -------------------------------------------------------------------------------
// binning parameters
const double rMin = 5.;
const double rMax = 10.;
const double binSize = 2;
const int nOrders = 11;
// output data
const std::string dir_output = "../output/";
const std::string dir_triplets = "../output/triplets/";
const std::string file_output = "zeta_multipoles.dat";
// measure the connected three-point correlation functions legendre coefficients and write the output
const auto ThreeP = cbl::measure::threept::ThreePointCorrelation::Create(catalogue, random_catalogue, rMin, rMax, binSize, nOrders);
ThreeP->measure(cbl::measure::ErrorType::_None_, dir_triplets, {}, 0, true, false, 0.1);
ThreeP->write(dir_output, file_output);
}
catch(cbl::glob::Exception &exc) { std::cerr << exc.what() << std::endl; exit(1); }
return 0;
}
Generic functions that use one or more classes of the CosmoBolognaLib.
int main()
main function to create the logo of the CosmoBolognaLib
Definition: Logo.cpp:41
The class ThreePointCorrelation_comoving_multipoles.
The class Catalogue.
Definition: Catalogue.h:654
The class Cosmology.
Definition: Cosmology.h:277
The class Exception.
Definition: Exception.h:111
const char * what() const noexcept override
the error description
Definition: Exception.h:203
static std::shared_ptr< ThreePointCorrelation > Create(const ThreePType type, const catalogue::Catalogue data, const catalogue::Catalogue random, const triplets::TripletType tripletType, const double side_s, const double side_u, const double perc_increase, const int nbins)
static factory used to construct three-point correlation functions of any type
@ _createRandom_box_
random catalogue with cubic geometry (or parallelepiped) in comoving coordinates
@ _Planck15_
Planck collaboration 2015, paper XIII: Table 4, TT,TE,EE+lowP+lensing.
@ _None_
No error computed.
@ _observed_
observed coordinates (R.A., Dec, redshift)