266 typedef std::function<bool(
const std::shared_ptr<Object> obj)>
mask_function;
287 virtual bool operator() (
const std::shared_ptr<Object> obj)
const {(void) obj;
return true;}
303 {
return {
"X",
"Y",
"Z",
"RA",
"Dec",
"SN",
"Redshift",
"RedshiftMin",
"RedshiftMax",
"Shear1",
"Shear2",
"ODDS",
"LensingWeight",
"LensingCalib",
"Dc",
"Weight",
"Mass",
"Magnitude",
"MagnitudeU",
"MagnitudeG",
"MagnitudeR",
"MagnitudeI",
"SFR",
"sSFR",
"MassProxy",
"MassProxyError",
"Mstar",
"MassInfall",
"IDHOST",
"GalaxyTag",
"Vx",
"Vy",
"Vz",
"Region",
"Radius",
"DensityContrast",
"CentralDensity",
"X_displacement",
"Y_displacement",
"Z_displacement",
"MassGas",
"MassHalo",
"MassDisk",
"MassBulge",
"MassStars",
"MassBndry",
"MassEstimate",
"RadiusEstimate",
"VeldispEstimate",
"XCM",
"YCM",
"ZCM",
"XSpin",
"YSpin",
"ZSpin",
"VelDisp",
"Vmax",
"VmaxRad",
"TotMass",
"Generic"}; }
312 {
return castFromValue<Var>(varIndex); }
321 {
return castFromName<Var>(varName,
VarNames()); }
329 inline std::vector<Var>
VarCast (
const std::vector<int> varIndeces)
330 {
return castFromValues<Var>(varIndeces); }
338 inline std::vector<Var>
VarCast (
const std::vector<std::string> varNames)
339 {
return castFromNames<Var>(varNames,
VarNames()); }
382 {
return {
"createRandom_box",
"createRandom_square",
"createRandom_shuffle",
"createRandom_shuffleTOT",
"createRandom_cone",
"createRandom_MANGLE",
"createRandom_VIPERS",
"createRandom_SDSS_stripes"}; }
391 {
return castFromValue<RandomType>(randomTypeIndex); }
400 {
return castFromName<RandomType>(randomTypeName,
RandomTypeNames()); }
408 inline std::vector<RandomType>
RandomTypeCast (
const std::vector<int> randomTypeIndeces)
409 {
return castFromValues<RandomType>(randomTypeIndeces); }
417 inline std::vector<RandomType>
RandomTypeCast (
const std::vector<std::string> randomTypeNames)
418 {
return castFromNames<RandomType>(randomTypeNames,
RandomTypeNames()); }
446 {
return {
"Zehavi05",
"Zehavi11",
"Moster10"}; }
470 {
return {
"LaZeVo",
"Exact"}; }
493 {
return {
"ascii",
"binary"}; }
519 {
return {
"m200",
"c200",
"t200"}; }
528 {
return castFromValue<EstimateCriterion>(estimateCriterionIndex); }
546 {
return castFromValues<EstimateCriterion>(estimateCriterionIndeces); }
750 std::vector<bool> mask(
m_object.size(),
true);
754 for (
size_t i=0; i<obj.
m_object.size(); ++i) {
769 std::vector<bool> mask(
m_object.size(),
true);
773 for (
size_t i=0; i<obj.m_object.size(); ++i) {
774 m_object.emplace_back(obj.m_object[i]->getShared());
776 obj.m_object[i].reset();
790 std::vector<bool> mask(
m_object.size(),
true);
794 for (
size_t i=0; i<obj.
m_object.size(); ++i)
807 if (
this == &obj)
return *
this;
810 std::vector<bool> mask(
m_object.size(),
true);
814 for (
size_t i=0; i<obj.m_object.size(); ++i) {
816 m_object.emplace_back(obj.m_object[i]->getShared());
817 obj.m_object[i].reset();
882 :
Catalogue(objectType, coordinateType, coord1, coord2, coord3, {}, cosm, inputUnits) {}
935 Catalogue (
const ObjectType objectType,
const CoordinateType coordinateType,
const std::vector<std::string> file,
const int col1=1,
const int col2=2,
const int col3=3,
const int colWeight=-1,
const int colRegion=-1,
const double nSub=1.1,
const double fact=1.,
const cosmology::Cosmology &cosm={},
const CoordinateUnits inputUnits=
CoordinateUnits::_radians_,
const CharEncode charEncode=
CharEncode::_ascii_,
const std::string comment=
"#",
const int seed=3213);
956 :
Catalogue(objectType, coordinateType, file, 1, 2, 3, -1, -1, 1.1, 1., cosm, inputUnits,
CharEncode::
_ascii_) {}
1002 Catalogue (
const ObjectType objectType,
const CoordinateType coordinateType,
const std::vector<Var> attribute,
const std::vector<int> column,
const std::vector<std::string> file,
const int comments=0,
const double nSub=1.1,
const double fact=1,
const cosmology::Cosmology &cosm={},
const CoordinateUnits inputUnits=
CoordinateUnits::_radians_,
const char delimiter=
'\t',
const int seed=3213);
1044 Catalogue (
const ObjectType objectType,
const CoordinateType coordinateType,
const std::vector<std::string> file,
const std::vector<std::string> column_names,
const bool read_weights,
const bool read_regions,
const double nSub,
const double fact,
const cosmology::Cosmology &cosm={},
const CoordinateUnits inputUnits=
CoordinateUnits::_radians_,
const int seed=3213);
1093 for (
size_t i=0; i<
object.size(); i++)
1094 m_object.push_back(move(std::make_shared<T>(T(
object[i]))));
1132 Catalogue (
const ObjectType objectType,
const std::vector<Var> attribute,
const std::vector<int> column,
const std::vector<std::string> file,
const int comments=0,
const double nSub=1.1,
const int seed=3213);
1364 Catalogue (
const RandomType type,
const Catalogue catalogue,
const double N_R,
const int nbin=10,
const cosmology::Cosmology &cosm={},
const bool conv=
false,
const double sigma=0.,
const std::vector<double>
redshift={},
const std::vector<double> RA={},
const std::vector<double> Dec={},
int z_ndigits=10,
const int seed=3213);
1463 Catalogue (
const RandomType type,
const int N_R,
const double z_step,
const Catalogue catalogue,
const cosmology::Cosmology &cosm={},
const std::vector<double> RA={},
const std::vector<double> Dec={},
const double sigma_kernel=0.01,
const int nbins=100,
int z_ndigits=10,
const int times_default = 5,
double times_change = 0.5,
const double tolerance = 0.05,
const std::string out_path_nz=
par::defaultString,
const std::string out_file_nz=
par::defaultString,
const int seed=3213);
1499 Catalogue (
const RandomType type,
const Catalogue catalogue,
const double N_R,
const int nbin,
const double Angle,
const std::vector<double>
redshift,
const cosmology::Cosmology &cosm={},
const bool conv=
false,
const double sigma=0.,
const int seed=3213);
1534 Catalogue (
const RandomType type,
const std::vector<std::string> mangle_mask,
const Catalogue catalogue,
const double N_R,
const int nbin,
const cosmology::Cosmology cosm,
const bool conv=
false,
const double sigma=0.,
const int seed=3213);
1571 Catalogue (
const RandomType type,
const Catalogue catalogue,
const double N_R,
const bool dndz_per_stripe,
const int nbin,
const cosmology::Cosmology cosm,
const bool conv=
false,
const double sigma=0,
const int seed=3213);
1598 Catalogue (
const RandomType type,
Catalogue catalogue,
const double N_R,
const cosmology::Cosmology cosm,
const std::vector<double> RA_range,
const std::vector<double> DEC_range,
const unsigned int nbin,
const int seed);
1602 Catalogue (
const RandomType type,
const std::string WField,
const bool isSpectroscopic,
const Catalogue catalogue,
const Catalogue catalogue_for_nz,
const double N_R,
const cosmology::Cosmology &cosm,
const int step_redshift,
const std::vector<double> lim,
const double redshift_min,
const double redshift_max,
const bool do_convol,
const double sigma,
const bool use_venice,
const bool do_zdistr_with_venice,
const std::string file_random,
const std::string mask,
const std::string pointing_file,
const std::string dir_venice,
const int seed);
1659 Catalogue (
const VoidAlgorithm algorithm,
Catalogue tracer_catalogue,
Catalogue random_catalogue,
const std::string dir_output,
const std::string output,
const double cellsize,
const int n_rec=1,
const double step_size=2.5/3.,
const double threshold=0.,
const std::vector<bool> print={
true,
true});
1712 Catalogue (
const VoidAlgorithm algorithm,
Catalogue tracer_catalogue,
Catalogue random_catalogue,
const std::string dir_output,
const std::string output,
const double cellsize,
const cbl::cosmology::Cosmology cosm,
const std::vector<double> RA_range,
const std::vector<double> DEC_range,
const int n_rec=1,
const double step_size=2.5/3.,
const double threshold=0.);
1750 Catalogue (
const ObjectType objectType,
const std::string file_cn=
par::defaultString,
const bool snapformat=
false,
const bool swap=
false,
const double fact=0.001,
const bool read_catalogue=
true,
const double nSub=1.1,
const std::string component_to_read=
"ALL",
const std::vector<std::vector<double>> edges={{
par::defaultDouble,
par::defaultDouble},{
par::defaultDouble,
par::defaultDouble},{
par::defaultDouble,
par::defaultDouble}});
1787 Catalogue (
const int snap,
const std::string basedir,
const bool swap=
false,
const bool long_ids=
false,
const double scaleFact=1.0,
const double massFact=1.0,
const EstimateCriterion estimate_crit=EstimateCriterion::_m200_,
const bool veldisp=
false,
const bool masstab=
false,
const bool add_satellites=
false,
const bool verbose=
false);
2137 double generic (
const int i)
const {
return m_object[i]->generic(); }
2150 std::vector<long>
region ()
const;
2156 std::vector<std::string>
field ()
const;
2163 std::vector<std::shared_ptr<Object>>
satellites (
const int index)
const {
return m_object[index]->satellites(); }
2170 std::vector<unsigned int>
part (
const int index)
const {
return m_object[index]->part(); }
2177 std::vector<std::vector<unsigned int>>
nearCells (
const int index)
const {
return m_object[index]->nearCells(); }
2185 double var (
const int index,
const Var var_name)
const;
2193 int var_int (
const int index,
const Var var_name)
const;
2200 std::vector<double>
var (
const Var var_name)
const;
2207 std::vector<int>
var_int (
const Var var_name)
const;
2219 bool isSetVar (
const int index,
const Var var_name)
const;
2273 std::vector<size_t> numobjects(nbin);
2274 for (
int i=0; i<(int)nbin; i++) {
2276 numobjects.emplace_back(temp_cat.nObjects());
2308 std::vector<double>
stats_var (
const Var var_name)
const;
2321 std::vector<std::vector<double>>
stats_var (
const std::vector<Var> var_name)
const;
2346 void var_distr (
const Var var_name, std::vector<double> &_var, std::vector<double> &dist, std::vector<double> &err,
const int nbin,
const bool linear=
true,
const std::string file_out=
par::defaultString,
const double Volume=1.,
const bool norm=
false,
const double V1=
par::defaultDouble,
const double V2=
par::defaultDouble,
const std::string bin_type=
"Linear",
const bool convolution=
false,
const double sigma=0.)
const;
2360 double vol = (boxside > 0.) ? pow(boxside, 3.) :
2412 std::vector<double>
z_bins (
const int nbin )
const {
2414 std::vector<double> bins(nbin);
2415 for (
int i=0; i<nbin; i++) bins[i] = (b[i]+b[i+1])/2;
2473 void set_var (
const int index,
const Var var_name,
const double value,
const cosmology::Cosmology cosmology={},
const bool update_coordinates=
true);
2494 void set_var (
const Var var_name,
const std::vector<double>
var,
const cosmology::Cosmology cosmology={},
const bool update_coordinates=
true);
2502 void set_var (
const Var var_name,
const std::vector<int>
var,
const cosmology::Cosmology cosmology={});
2509 void set_satellite (
const int index,
const std::shared_ptr<Object> satellite={})
2511 m_object[index]->set_satellite(satellite);
2607 void compute_centralDensity (
const std::shared_ptr<Catalogue> tracers_catalogue,
chainmesh::ChainMesh3D ChM,
const std::vector<std::vector<double>> data_numdensity,
const std::string method_interpolation,
const double threshold);
2647 template<
typename T>
2663 template<
typename T>
2673 template<
typename T>
2723 void sort (
const Var var_name,
const bool increasing=
false);
2730 void shuffle (
const int seed);
2789 void Order (
const std::vector<int> vv);
2825 void write_data (
const std::string outputFile,
const std::vector<Var> var_name={},
const std::string sep=
" ",
const std::string header=
"")
const;
2835 double distance (
const int i, std::shared_ptr<Object> obj)
const;
2845 double angsep_xyz (
const int i, std::shared_ptr<Object> obj)
const;
2854 for (
auto &&ss :
cc->m_object)
2866 for (
auto &&ss :
cc.m_object)
2960 Catalogue sub_catalogue (
catalogue::Catalogue &data,
const double tile_width_RA,
const double tile_width_Dec,
const bool write_tiles=
false,
const std::string dir_tiles=
"./",
const std::string file_tiles=
"tiles_coordinates.txt");
2999 std::shared_ptr<Catalogue>
smooth (
const double gridsize,
const cosmology::Cosmology cosmology,
const std::vector<Var> vars={},
const int SUB=1);
3011 int nObjects_condition (
const Var var_name,
const double down,
const double up,
const bool excl=
false);
3023 double weightedN_condition (
const Var var_name,
const double down,
const double up,
const bool excl=
false);
3128 void clean_void_catalogue (
const bool initial_radius=
false,
const std::vector<double> delta_r={-1, 1000},
const double threshold=0.205,
const bool rescale=
true,
const std::shared_ptr<Catalogue> tracers_catalogue={}, chainmesh::ChainMesh3D ChM={},
const double ratio=1.5,
const bool checkoverlap=
true,
const Var ol_criterion=
Var::_CentralDensity_);
3172 void clean_void_catalogue (
const std::vector<double> par_numdensity,
const bool initial_radius=
false,
const std::vector<double> delta_r={-1, 1000},
const double threshold=0.205,
const bool rescale=
true,
const std::shared_ptr<Catalogue> tracers_catalogue={}, chainmesh::ChainMesh3D ChM={},
const double ratio=1.5,
const bool checkoverlap=
true,
const Var ol_criterion=
Var::_CentralDensity_);
3221 void clean_void_catalogue (
const std::vector<std::vector<double>> data_numdensity,
const std::string method_interpolation,
const bool initial_radius=
false,
const std::vector<double> delta_r={-1, 1000},
const double threshold=0.205,
const bool rescale=
true,
const std::shared_ptr<Catalogue> tracers_catalogue={}, chainmesh::ChainMesh3D ChM={},
const double ratio=1.5,
const bool checkoverlap=
true,
const Var ol_criterion=
Var::_CentralDensity_);
Implementation of the chain-mesh data structure.
void set_part(const int index, const std::vector< unsigned int > part={})
set the private member ChainMeshCell::m_part
double z_displacement(const int i) const
get the private member Catalogue::m_object[i]->m_z_displacement
Catalogue()=default
default constructor
double weight(const int i) const
get the private member Catalogue::m_object[i]->m_weight
void compute_centralDensity(const std::shared_ptr< Catalogue > tracers_catalogue, chainmesh::ChainMesh3D ChM, const double threshold)
compute the central density of each object in a void catalogue. We define as central density the dens...
void add_object(T object)
add one single object to the catalogue
double lensingWeight(const int i) const
get the private member Catalogue::m_object[i]->m_lensingWeight
size_t nRegions()
get the private member m_nRegions
double magnitudeR(const int i) const
get the private member Catalogue::m_object[i]->m_magnitudeR
double tot_mass(const int i) const
get the private member Catalogue::m_object[ii]->m_tot_mass
void remove_objects()
remove all objects remove all objects of the catalogue
std::vector< std::vector< unsigned int > > nearCells(const int index) const
get the private member Catalogue::m_object[index]->m_nearCells of ChainMeshCell
double yy(const int i) const
get the private member Catalogue::m_object[i]->m_yy
int IDHost(const int i) const
get the private member Catalogue::m_object[i]->m_IDHost
double mass(const int i) const
get the private member Catalogue::m_object[i]->m_mass
std::vector< int > m_index
vector containing the object indexes
Gadget_Header m_swap_header(Gadget_Header header)
swap endianism of the GADGET snapshot header
void add_objects(std::vector< std::shared_ptr< Object > > sample)
add some objects to the catalogue
void restoreComovingCoordinates()
restore comoving coordinates
double Min(const Var var_name) const
get the minimum value of a variable of the catalogue objects
void normalizeComovingCoordinates()
normalize comoving coordinates
Catalogue sub_catalogue(const Var var_name, const double down, const double up, const bool excl=false) const
create a sub-catalogue
double weightedN_condition(const Var var_name, const double down, const double up, const bool excl=false)
return the weighted number of objectes following a condition on the variable VAR
std::vector< std::shared_ptr< Object > > m_object
vector containing the objects of the catalogue
int ID(const int i) const
get the private member Catalogue::m_object[i]->m_ID
Catalogue mangle_cut(const std::string mangle_mask, const bool excl=false) const
create a sub-catalogue
size_t nObjects() const
get the number of objects of the catalogue
void set_region_number(const size_t nRegions)
set the private variable m_nRegion
double lensingCalib(const int i) const
get the private member Catalogue::m_object[i]->m_lensingCalib
double odds(const int i) const
get the private member Catalogue::m_object[i]->m_odds
void set_ra_dec_tile(const std::vector< double > RA_tile, const std::vector< double > Dec_tile, const CoordinateUnits inputUnits=CoordinateUnits::_degrees_)
set the central R.A. and Dec of the tiles
double numdensity(const double boxside=par::defaultDouble) const
compute the catalogue's number density
void set_satellite(const int index, const std::shared_ptr< Object > satellite={})
set the private member HostHalo::m_satellites
void write_comoving_coordinates(const std::string outputFile) const
write the comoving coordinates of the catalogue to an output file
double dec(const int i) const
get the private member Catalogue::m_object[i]->m_dec
double galaxyTag(const int i) const
get the private member Catalogue::m_object[i]->m_galaxyTag
bool isSetVar(const int index, const Var var_name) const
check if the given variable of the i-th object is set
SubFindTab_Header m_read_header(std::ifstream &finh, const bool swap=false)
read the GADGET subfind table header
double xx(const int i) const
get the private member Catalogue::m_object[i]->m_xx
Catalogue(Catalogue &&obj)
move constructor for the Catalogue class
double sn(const int i) const
get the private member Catalogue::m_object[i]->m_sn
std::shared_ptr< Object > operator[](const size_t i) const
access the i-th Catalogue object
double ra_tile(const int i) const
get the private member Catalogue::m_object[i]->m_ra_tile
double magnitude(const int i) const
get the private member Catalogue::m_object[i]->m_magnitude
size_t nFields() const
get the total number of fields where the objects have been observed
double shear1(const int i) const
get the private member Catalogue::m_object[i]->m_shear1
double volume(const double boxside=par::defaultDouble) const
compute the catalogue's comoving volume
void add_objects(std::vector< T > sample)
add some objects to the catalogue
void add_object(std::shared_ptr< Object > object)
add one single object to the catalogue
std::vector< double > coordinate(const int i) const
get the X, Y, Z coordinates of the i-th object of the catalogue
double mstar(const int i) const
get the private member Catalogue::m_object[i]->m_mstar
std::shared_ptr< Object > catalogue_object(const int i) const
get the i-th object of the catalogue
void var_distr(const Var var_name, std::vector< double > &_var, std::vector< double > &dist, std::vector< double > &err, const int nbin, const bool linear=true, const std::string file_out=par::defaultString, const double Volume=1., const bool norm=false, const double V1=par::defaultDouble, const double V2=par::defaultDouble, const std::string bin_type="Linear", const bool convolution=false, const double sigma=0.) const
get the distribution of a variable
std::vector< unsigned int > part(const int index) const
get the private member Catalogue::m_object[index]->m_part of ChainMeshCell
double redshift(const int i) const
get the private member Catalogue::m_object[i]->m_redshift
Catalogue(std::vector< T > object)
constructor, using vectors of generic objects
void set_field(const std::vector< std::string > field)
set a private variable
double shear2(const int i) const
get the private member Catalogue::m_object[i]->m_shear2
Catalogue(const Catalogue &obj)
Copy constructor for the Catalogue class.
double mps_error(const double boxside=par::defaultDouble) const
compute the catalogue's mean particle separation error
void write_obs_coordinates(const std::string outputFile) const
write the polar coordinates of the catalogue to an output file
double y_displacement(const int i) const
get the private member Catalogue::m_object[i]->m_y_displacement
double massinfall(const int i) const
get the private member Catalogue::m_object[i]->m_minfall
double ra(const int i) const
get the private member Catalogue::m_object[i]->m_ra
size_t m_nRegions
number of regions
double var(const int index, const Var var_name) const
get the value of the i-th object variable
void compute_densityContrast(const std::shared_ptr< Catalogue > tracers_catalogue, chainmesh::ChainMesh3D ChM, const double ratio=0.1)
compute density contrast of cosmic voids in catalogue as the ratio between an inner and an outer sphe...
std::vector< std::vector< double > > compute_catalogueProperties_lightCone(cbl::cosmology::Cosmology cosmology, const std::vector< double > RA_range, const std::vector< double > DEC_range, const unsigned int nbin)
compute catalogue volume, number density and mean particle separation in light cones
void sort(const Var var_name, const bool increasing=false)
bubble sort of a catalogue wrt a variable
data::ScalarField3D density_field(const double cell_size, const Catalogue mask_catalogue, const int interpolation_type=0, const double kernel_radius=0., const bool useMass=false) const
return the density field from object position
std::vector< std::shared_ptr< Object > > satellites(const int index) const
get the private member Catalogue::m_object[ii]->m_satellites
double angsep_xyz(const int i, std::shared_ptr< Object > obj) const
get the angular distrance between the i-th object of the catalogue and another object
void computeComovingCoordinates(const cosmology::Cosmology &cosm, const CoordinateUnits inputUnits=CoordinateUnits::_radians_)
compute the comoving coordinates (x, y, z) from the observed coordinates (R.A., Dec,...
void set_nearCells(const int index, const std::vector< std::vector< unsigned int >> nearCells={})
set the private member ChainMeshCell::m_nearCells
~Catalogue()=default
default destructor
int nObjects_condition(const Var var_name, const double down, const double up, const bool excl=false)
return the number of objectes following a condition on the variable VAR
double Max(const Var var_name) const
get the maximum value of a variable of the catalogue objects
double mass_proxy(const int i) const
get the private member Catalogue::m_object[i]->m_mass_proxy
Catalogue(const ObjectType objectType, const CoordinateType coordinateType, const std::vector< std::string > file, const cosmology::Cosmology &cosm, const CoordinateUnits inputUnits=CoordinateUnits::_radians_)
constructor, reading a file with coordinates
void equalize_random_box(cbl::catalogue::Catalogue tracer_catalogue, const int seed)
equalize the number of objects in two Box catalogues
std::string field(const int i) const
get the private member Catalogue::m_object[i]->m_field
double zz(const int i) const
get the private member Catalogue::m_object[i]->m_zz
double x_displacement(const int i) const
get the private member Catalogue::m_object[i]->m_x_displacement
double mps(const double boxside=par::defaultDouble) const
compute the catalogue's mean particle separation
double numdensity_error(const double boxside=par::defaultDouble) const
compute the catalogue's number density error
double weightedN() const
get the total weight of the objects of the catalogue
void replace_objects(std::vector< T > sample)
replace existing objects with new ones
void m_check_it_out(std::ifstream &finr, const bool swap)
Ouput function to check consistency in reading block-headers in binary GADGET snapshots.
double dc(const int i) const
get the private member Catalogue::m_object[i]->m_dc
Catalogue & operator=(Catalogue &&obj) noexcept
move assignment for the Catalogue class
long region(const int i) const
get the private member Catalogue::m_object[i]->m_region
void clean_void_catalogue(const bool initial_radius=false, const std::vector< double > delta_r={-1, 1000}, const double threshold=0.205, const bool rescale=true, const std::shared_ptr< Catalogue > tracers_catalogue={}, chainmesh::ChainMesh3D ChM={}, const double ratio=1.5, const bool checkoverlap=true, const Var ol_criterion=Var::_CentralDensity_)
function that modifies a void catalogue according to a set of user selected criteria....
void computePolarCoordinates(const CoordinateUnits outputUnits=CoordinateUnits::_radians_)
compute the polar coordinates (R.A., Dec, dc) from the comoving coordinates (x, y,...
std::vector< std::string > field_list() const
get the list of fields where the objects have been observed
double distance(const int i, std::shared_ptr< Object > obj) const
get the distrance between the i-th object of the catalogue and another object
void set_region(const std::vector< long > region, const int nRegions=-1)
set a private variable
double centralDensity(const int i) const
get the private member Catalogue::m_object[i]->m_centralDensity
double magnitudeU(const int i) const
get the private member Catalogue::m_object[i]->m_magnitudeU
double radius(const int i) const
get the private member Catalogue::m_object[i]->m_radius
double redshiftMax(const int i) const
get the private member Catalogue::m_object[i]->m_redshiftMax
int m_blockheader
contains the block-header temporary value
double vx(const int i) const
get the private member Catalogue::m_object[i]->m_vx
Catalogue & operator=(const Catalogue &obj)
copy assignment for the Catalogue class
void set_var(const int index, const Var var_name, const double value, const cosmology::Cosmology cosmology={}, const bool update_coordinates=true)
set a private variable
void remove_object(const int index)
remove an existing object
std::vector< double > compute_catalogueProperties_box(const double boxside)
compute catalogue volume, number density and mean particle separation
std::vector< double > z_bins(const int nbin) const
get the catalogue's redshift bins
double mass_proxy_error(const int i) const
get the private member Catalogue::m_object[i]->m_mass_proxy_error
std::vector< std::string > field() const
get the values of the object fields
Catalogue(const ObjectType objectType, const CoordinateType coordinateType, const std::vector< double > coord1, const std::vector< double > coord2, const std::vector< double > coord3, const cosmology::Cosmology &cosm, const CoordinateUnits inputUnits=CoordinateUnits::_radians_)
constructor
void equalize_random_lightCone(cbl::catalogue::Catalogue tracer_catalogue, cbl::cosmology::Cosmology cosm, const std::vector< double > RA_range, const std::vector< double > DEC_range, const int seed)
equalize the number of objects in two Light Cones catalogues
std::vector< double > stats_var(const Var var_name) const
get the mean, the median, the standard deviation, and the difference between the third and first quar...
void write_data(const std::string outputFile, const std::vector< Var > var_name={}, const std::string sep=" ", const std::string header="") const
write both the comoving and polar coordinates, and the regions (if present) of the catalogue to an ou...
std::shared_ptr< Catalogue > smooth(const double gridsize, const cosmology::Cosmology cosmology, const std::vector< Var > vars={}, const int SUB=1)
create a smoothed version of the catalogue averaging quantities on a X, Y, Z grid
void swap_objects(const int ind1, const int ind2)
swap two existing objects
double dec_tile(const int i) const
get the private member Catalogue::m_object[i]->m_dec_tile
void m_check_it_in(std::ifstream &finr, const bool swap)
Input function to check consistency in reading block-headers in binary GADGET snapshots.
int var_int(const int index, const Var var_name) const
get the value of the i-th object integer variable
std::vector< long > region_list() const
get the list of regions in which the catalogue is divided
std::vector< std::shared_ptr< Object > > sample() const
get the private member Catalogue::m_object
double densityContrast(const int i) const
get the private member Catalogue::m_object[i]->m_densityContrast
void Order()
restore the original vector (i.e. the opposite of Order(std::vector<int>))
void shuffle(const int seed)
shuffle objects in the catalogue
std::vector< long > region() const
get the values of the object regions
double redshiftMin(const int i) const
get the private member Catalogue::m_object[i]->m_redshiftMin
data::ScalarField3D counts_in_cell(const double cell_size, const int interpolation_type=0, const bool useMass=false, const double minX=par::defaultDouble, const double maxX=par::defaultDouble, const double minY=par::defaultDouble, const double maxY=par::defaultDouble, const double minZ=par::defaultDouble, const double maxZ=par::defaultDouble) const
return the density field from object positions
std::vector< size_t > nObjects_lightCone(const int nbin) const
get the number of objects of the catalogue for Light Cones
std::vector< std::shared_ptr< Object > > catalogue_object() const
get the object vector
double magnitudeG(const int i) const
get the private member Catalogue::m_object[i]->m_magnitudeG
void replace_objects(std::vector< std::shared_ptr< Object > > sample)
replace existing objects with new ones
Catalogue(std::vector< std::shared_ptr< Object > > sample)
constructor, using vectors of pointers to generic objects
Catalogue operator+=(std::shared_ptr< Catalogue > cc)
overloading of the += operator, to sum two catalogues
double magnitudeI(const int i) const
get the private member Catalogue::m_object[i]->m_magnitudeI
Catalogue diluted_catalogue(const double nSub, const int seed=3213) const
create a diluted catalogue
double vy(const int i) const
get the private member Catalogue::m_object[i]->m_vy
void set_satellites(const int index, const std::vector< std::shared_ptr< Object >> satellites={})
set the private member HostHalo::m_satellites
double vz(const int i) const
get the private member Catalogue::m_object[i]->m_vz
static const std::string defaultString
default std::string value
static const double defaultDouble
default double value
static const double alpha
: the fine-structure constant
static const double cc
: the speed of light in vacuum (the value is exact) [km/sec]
std::function< bool(const std::shared_ptr< Object > obj)> mask_function
Definition of a new type to manage mask function.
Var
the catalogue variables
@ _MassInfall_
Infall mass of substructures.
@ _MassProxyError_
mass proxy error
@ _Y_displacement_
yy displacement
@ _MagnitudeI_
i-band magnitude
@ _Vz_
velocity along the z direction
@ _VmaxRad_
maximum radial velocity
@ _MagnitudeR_
r-band magnitude
@ _IDHOST_
unique identification number of the halo that host galaxy
@ _LensingCalib_
lensing calibration factor
@ _Shear2_
second component of the shear signal
@ _ID_
unique identification number
@ _MagnitudeG_
g-band magnitude
@ _Vy_
velocity along the y direction
@ _XCM_
centre of mass x-coordinate
@ _GalaxyTag_
tag of galaxy "central" or "satellite"
@ _Generic_
generic property
@ _CentralDensity_
centralDensity
@ _Vx_
velocity along the x direction
@ _Nsub_
number of sub-groups
@ _YSpin_
spin y-coordinate
@ _SN_
Signal-to-noise ratio.
@ _ZSpin_
spin z-coordinate
@ _MagnitudeU_
u-band magnitude
@ _RedshiftMax_
maximum redshift
@ _XSpin_
spin x-coordinate
@ _RadiusEstimate_
radius estimate
@ _TileDec_
Central value of the tile Declination.
@ _TotMass_
total halo mass
@ _VeldispEstimate_
velocity dispersion estimate
@ _MassEstimate_
mass estimate
@ _TileRA_
Central value of the tile Right Ascension.
@ _VelDisp_
velocity dispersion
@ _Z_displacement_
zz displacement
@ _sSFR_
specific star formation rate
@ _RedshiftMin_
minimum redshift
@ _ZCM_
centre of mass z-coordinate
@ _X_displacement_
xx displacement
@ _Shear1_
first component of the shear signal
@ _YCM_
centre of mass y-coordinate
@ _LensingWeight_
lensing weight
@ _Parent_
parent unique identification number
@ _DensityContrast_
densityContrast
@ _SFR_
star formation rate
double Average_c_Zehavi_2005(const double x, const double Mmin)
return the average number of central galaies inside an halo of mass x
std::vector< std::string > CharEncodeNames()
return a vector containing the CharEncode names
std::vector< std::string > EstimateCriterionNames()
return a vector containing the EstimateCriterion names
double Average_c_Zehavi_2011(const double x, const double logMmin, const double logsigma_c)
return the average number of central galaies inside an halo of mass x
std::vector< std::string > VoidAlgorithmNames()
return a vector containing the VoidAlgorithm names
RandomType
the type of random catalogue
@ _createRandom_VIPERS_
random catalogue for VIPERS
@ _createRandom_SDSS_stripes_
create random for SDSS, using stripes
@ _createRandom_square_
random catalogue with square geometry in observed coordinates (R.A., Dec)
@ _createRandom_shuffleTOT_
random catalogue obtained with shuffling in observed coordinates (R.A., Dec) and redshift
@ _createRandom_cone_
random catalogue with conic geometry
@ _createRandom_homogeneous_LC_
homogeneous random catalogue in ra and dec with redshift dependent density
@ _createRandom_MANGLE_
random catalogue using mangle
@ _createRandom_box_
random catalogue with cubic geometry (or parallelepiped) in comoving coordinates
@ _createRandom_shuffle_
random catalogue obtained with shuffling in observed coordinates (R.A., Dec)
ObjectType
the object types
RandomType RandomTypeCast(const int randomTypeIndex)
cast an enum of type RandomType from its index
EstimateCriterion EstimateCriterionCast(const int estimateCriterionIndex)
cast an enum of type EstimateCriterion from its index
std::vector< std::string > RandomTypeNames()
return a vector containing the RandomType names
VoidAlgorithm
the algorithm used to look for Voids
@ _LaZeVo_
Lagrangian Zel'dovich approximation Void algorithm used to move particles.
HODType
type of HOD catalogue, which corresponds to the authors of the calibrated HOD model
@ _Zehavi11_
Zehavi et al. (2011)
@ _Zehavi05_
Zehavi et al. (2005)
@ _Moster10_
Moster et al. (2010)
std::vector< std::string > HODTypeNames()
return a vector containing the HODTypes names
EstimateCriterion
method used to estimate mass, radius and velocity of a halo
CharEncode
character encoding of input file
@ _ascii_
Format ASCII file.
@ _binary_
Format binary file.
std::vector< std::string > VarNames()
return a vector containing the Var names
double Average_s_Zehavi_2005(const double x, const double alpha, const double M1)
return the average number of satellite galaies per halo of mass x
double Average_s_Zehavi_2011(const double x, const double M0, const double M1, const double alpha)
return the average number of satellite galaies per halo of mass x
Var VarCast(const int varIndex)
cast an enum of type Var from its index
The global namespace of the CosmoBolognaLib
T Min(const std::vector< T > vect)
minimum element of a std::vector
int N_different_elements(const std::vector< T > vect_input)
get the number of unique elements of a std::vector
std::string conv(const T val, const char *fact)
convert a number to a std::string
CoordinateType
the coordinate type
std::vector< T > different_elements(const std::vector< T > vect_input)
get the unique elements of a std::vector
std::vector< T > linear_bin_vector(const size_t nn, const T min, const T max)
fill a std::vector with linearly spaced values
T Max(const std::vector< T > vect)
maximum element of a std::vector
CoordinateUnits
the coordinate units
@ _radians_
angle in radians
@ _degrees_
angle in degrees
void convolution(const std::vector< double > f1, const std::vector< double > f2, std::vector< double > &res, const double deltaX)
convolution of two functions
object that encapsulate the mask function.
virtual ~MaskObject()
Default destructor.
virtual bool operator()(const std::shared_ptr< Object > obj) const
call function This function can contain one or more checks on object variables, returning a bool