This example shows how to construct a Halo Occupation Distribution (HOD) galaxy catalogue
try {
const std::string input_path = "../input/";
const std::string output_path = "../output/";
const std::string input_file = "haloCat.dat";
cbl::catalogue::Catalogue haloCat {
cbl::catalogue::ObjectType::_HostHalo_,
cbl::CoordinateType::_comoving_, {
cbl::catalogue::Var::_X_,
cbl::catalogue::Var::_Y_,
cbl::catalogue::Var::_Z_,
cbl::catalogue::Var::_Mass_ }, {1, 2, 3, 4}, {input_path+input_file}, 0, 1., 1., cosmology };
std::cout << "Total number of galaxies: " << HOD.nObjects() << " - " << "Total number of halos: " << haloCat.nObjects() << std::endl;
std::cout << "The mean: " << stats[0] << std::endl;
std::cout << "The median: " << stats[1] << std::endl;
std::cout << "The standard deviation: " << stats[2] << std::endl;
std::cout << "Difference between the third and first quartiles: " << stats[3] << std::endl << std::endl;
std::string HodCatalogueFileName = "Galaxies_1e8_Moster_test.dat";
const std::string sep = "\t";
const std::string HODFileHeader = "(1)galaxyTag" + sep + "(2)X [Mpc/h]" + sep + "(3)Y [Mpc/h]" + sep + "(4)Z [Mpc/h]" + sep + "(5)M_vir (M_sub)[M_sun/h]" + sep + "(6)M_infall [M_sun/h]" + sep + "(7)M_star [M_sun/h]";
if (system(("mkdir -p "+output_path).c_str())) {}
HOD.write_data(output_path+HodCatalogueFileName, varsToPrint, sep, HODFileHeader);
}
return 0;
}
int main()
main function to create the logo of the CosmoBolognaLib
const char * what() const noexcept override
the error description
static const std::string col_green
green colour (used when printing something on the screen)
static const std::string col_default
default colour (used when printing something on the screen)
@ _MassInfall_
Infall mass of substructures.
@ _GalaxyTag_
tag of galaxy "central" or "satellite"
@ _Moster10_
Moster et al. (2010)
@ _Planck15_
Planck collaboration 2015, paper XIII: Table 4, TT,TE,EE+lowP+lensing.
@ _comoving_
comoving coordinates (x, y, z)