CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
cbl::catalogue::Catalogue Class Reference

The class Catalogue. More...

#include "Headers/Catalogue.h"

Inherited by cbl::catalogue::CatalogueChainMesh.

Public Member Functions

Constructors/destructors
 Catalogue ()=default
 default constructor
 
 Catalogue (const Catalogue &obj)
 Copy constructor for the Catalogue class. More...
 
 Catalogue (Catalogue &&obj)
 move constructor for the Catalogue class More...
 
Catalogueoperator= (const Catalogue &obj)
 copy assignment for the Catalogue class More...
 
Catalogueoperator= (Catalogue &&obj) noexcept
 move assignment for the Catalogue class More...
 
 Catalogue (const ObjectType objectType, const CoordinateType coordinateType, const std::vector< double > coord1, const std::vector< double > coord2, const std::vector< double > coord3, const std::vector< double > weight={}, const cosmology::Cosmology &cosm={}, const CoordinateUnits inputUnits=CoordinateUnits::_radians_)
 constructor More...
 
 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 More...
 
 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)
 constructor, reading a file with coordinates More...
 
 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 More...
 
 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)
 constructor, reading a file with attributes of the catalogue More...
 
 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)
 constructor, reading a file in FITS format More...
 
 Catalogue (const ObjectType objectType, const CoordinateType coordinateType, const std::vector< std::string > file, const std::vector< std::string > column_names, const std::vector< Var > attribute, const double nSub, const double fact, const cosmology::Cosmology &cosm={}, const CoordinateUnits inputUnits=CoordinateUnits::_radians_, const int seed=3213)
 constructor, reading a file in FITS format More...
 
template<typename T >
 Catalogue (std::vector< T > object)
 constructor, using vectors of generic objects More...
 
 Catalogue (std::vector< std::shared_ptr< Object > > sample)
 constructor, using vectors of pointers to generic objects More...
 
 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)
 constructor, reading a file with attributes of the catalogue More...
 
 Catalogue (const Catalogue input_catalogue, const Catalogue target_catalogue, const Var var_name, const int nbin, const int seed=3213)
 constructor, creating a catalogue by matching the distribution of one quantity from a target catalogue More...
 
 Catalogue (const Catalogue input_catalogue, const Catalogue target_catalogue, const cbl::catalogue::Var var_name1, const int nbin1, const cbl::catalogue::Var var_name2, const int nbin2, const int seed=3213)
 constructor, creating a catalogue by matching the distributions of two quantities from a target catalogue More...
 
 Catalogue (const Catalogue halo_catalogue, const cosmology::Cosmology &cosm, const HODType HOD_Type, const double threshold, const bool substructures=true, std::vector< double > parameter={})
 constructor that creates a catalogue of galaxies using an HOD model to popolate the haloes More...
 
 ~Catalogue ()=default
 default destructor
 
Constructors of random catalogues
 Catalogue (const RandomType type, const cosmology::Cosmology &real_cosm, const cosmology::Cosmology &test_cosm, const std::string dir_in, const double Zguess_min, const double Zguess_max)
 constructor that creates a random catalogue in a cubic box, warped by geometric distortions More...
 
 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)
 constructor that creates a random catalogue with either the square geometry or with 'the shuffle' method More...
 
 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)
 constructor that creates a random catalogue with the 'shuffle' method. More...
 
 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)
 constructor that creates a random catalogue in a cone More...
 
 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)
 constructor that creates a random catalogue using the a mask in the MANGLE format for the angular distribution and taking the redshift distribution from an input catalogue More...
 
 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)
 constructor that creates a random catalogue using the SDSS stripes. More...
 
 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)
 constructor that creates a random catalogue for light cones homogeneous in RA and Dec and with redshift dependent density. More...
 
Constructor of Void catalogues
 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})
 constructor that creates a void catalogue extracting cosmic voids from a catalogue of tracers, for COMOVING coordinates. This void finder is based on dynamical criteria: the density field is reconstructed from the displacement field generated by the back-in-time evolution of the tracers. Voids are therefore classified as regions of negative velocity divergence. More...
 
 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.)
 constructor that creates a void catalogue extracting cosmic voids from a catalogue of tracers for OBSERVED COORDINATES. This void finder is based on dynamical criteria: the density field is reconstructed from the displacement field generated by the back-in-time evolution of the tracers. Voids are therefore classified as regions of negative velocity divergence. More...
 
Constructors used to read catalogues from standard GADGET files
 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}})
 constructor that reads object of selected type from Gadget snapshots More...
 
 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)
 constructor that reads objects of class HostHalo with satellite dependencies from group and subgroup files generated by the gadget implementation of the FoF and SUBFIND algorithms (respectively) More...
 
Member functions used to get the private members and their properties
std::vector< std::shared_ptr< Object > > sample () const
 get the private member Catalogue::m_object More...
 
double xx (const int i) const
 get the private member Catalogue::m_object[i]->m_xx More...
 
double yy (const int i) const
 get the private member Catalogue::m_object[i]->m_yy More...
 
double zz (const int i) const
 get the private member Catalogue::m_object[i]->m_zz More...
 
double vx (const int i) const
 get the private member Catalogue::m_object[i]->m_vx More...
 
double vy (const int i) const
 get the private member Catalogue::m_object[i]->m_vy More...
 
double vz (const int i) const
 get the private member Catalogue::m_object[i]->m_vz More...
 
double dc (const int i) const
 get the private member Catalogue::m_object[i]->m_dc More...
 
double ra (const int i) const
 get the private member Catalogue::m_object[i]->m_ra More...
 
double dec (const int i) const
 get the private member Catalogue::m_object[i]->m_dec More...
 
double ra_tile (const int i) const
 get the private member Catalogue::m_object[i]->m_ra_tile More...
 
double dec_tile (const int i) const
 get the private member Catalogue::m_object[i]->m_dec_tile More...
 
double sn (const int i) const
 get the private member Catalogue::m_object[i]->m_sn More...
 
double redshift (const int i) const
 get the private member Catalogue::m_object[i]->m_redshift More...
 
double redshiftMin (const int i) const
 get the private member Catalogue::m_object[i]->m_redshiftMin More...
 
double redshiftMax (const int i) const
 get the private member Catalogue::m_object[i]->m_redshiftMax More...
 
double shear1 (const int i) const
 get the private member Catalogue::m_object[i]->m_shear1 More...
 
double shear2 (const int i) const
 get the private member Catalogue::m_object[i]->m_shear2 More...
 
double odds (const int i) const
 get the private member Catalogue::m_object[i]->m_odds More...
 
double lensingWeight (const int i) const
 get the private member Catalogue::m_object[i]->m_lensingWeight More...
 
double lensingCalib (const int i) const
 get the private member Catalogue::m_object[i]->m_lensingCalib More...
 
double weight (const int i) const
 get the private member Catalogue::m_object[i]->m_weight More...
 
long region (const int i) const
 get the private member Catalogue::m_object[i]->m_region More...
 
std::string field (const int i) const
 get the private member Catalogue::m_object[i]->m_field More...
 
double x_displacement (const int i) const
 get the private member Catalogue::m_object[i]->m_x_displacement More...
 
double y_displacement (const int i) const
 get the private member Catalogue::m_object[i]->m_y_displacement More...
 
double z_displacement (const int i) const
 get the private member Catalogue::m_object[i]->m_z_displacement More...
 
size_t nRegions ()
 get the private member m_nRegions More...
 
std::vector< long > region_list () const
 get the list of regions in which the catalogue is divided More...
 
std::vector< std::string > field_list () const
 get the list of fields where the objects have been observed More...
 
size_t nFields () const
 get the total number of fields where the objects have been observed More...
 
double mass (const int i) const
 get the private member Catalogue::m_object[i]->m_mass More...
 
double magnitude (const int i) const
 get the private member Catalogue::m_object[i]->m_magnitude More...
 
double magnitudeU (const int i) const
 get the private member Catalogue::m_object[i]->m_magnitudeU More...
 
double magnitudeG (const int i) const
 get the private member Catalogue::m_object[i]->m_magnitudeG More...
 
double magnitudeR (const int i) const
 get the private member Catalogue::m_object[i]->m_magnitudeR More...
 
double magnitudeI (const int i) const
 get the private member Catalogue::m_object[i]->m_magnitudeI More...
 
double radius (const int i) const
 get the private member Catalogue::m_object[i]->m_radius More...
 
double densityContrast (const int i) const
 get the private member Catalogue::m_object[i]->m_densityContrast More...
 
double centralDensity (const int i) const
 get the private member Catalogue::m_object[i]->m_centralDensity More...
 
int ID (const int i) const
 get the private member Catalogue::m_object[i]->m_ID More...
 
double mass_proxy (const int i) const
 get the private member Catalogue::m_object[i]->m_mass_proxy More...
 
double mass_proxy_error (const int i) const
 get the private member Catalogue::m_object[i]->m_mass_proxy_error More...
 
int IDHost (const int i) const
 get the private member Catalogue::m_object[i]->m_IDHost More...
 
double galaxyTag (const int i) const
 get the private member Catalogue::m_object[i]->m_galaxyTag More...
 
double mstar (const int i) const
 get the private member Catalogue::m_object[i]->m_mstar More...
 
double massinfall (const int i) const
 get the private member Catalogue::m_object[i]->m_minfall More...
 
double generic (const int i) const
 get the private member Catalogue::m_object[i]->m_generic More...
 
double tot_mass (const int i) const
 get the private member Catalogue::m_object[ii]->m_tot_mass More...
 
std::vector< long > region () const
 get the values of the object regions
More...
 
std::vector< std::string > field () const
 get the values of the object fields
More...
 
std::vector< std::shared_ptr< Object > > satellites (const int index) const
 get the private member Catalogue::m_object[ii]->m_satellites More...
 
std::vector< unsigned int > part (const int index) const
 get the private member Catalogue::m_object[index]->m_part of ChainMeshCell More...
 
std::vector< std::vector< unsigned int > > nearCells (const int index) const
 get the private member Catalogue::m_object[index]->m_nearCells of ChainMeshCell More...
 
double var (const int index, const Var var_name) const
 get the value of the i-th object variable
More...
 
int var_int (const int index, const Var var_name) const
 get the value of the i-th object integer variable
More...
 
std::vector< double > var (const Var var_name) const
 get the values of the object variables
More...
 
std::vector< int > var_int (const Var var_name) const
 get the values of the object integer variables
More...
 
bool isSetVar (const int index, const Var var_name) const
 check if the given variable of the i-th object is set More...
 
bool isSetVar (const Var var_name) const
 check if the given object variables are set More...
 
std::shared_ptr< Objectcatalogue_object (const int i) const
 get the i-th object of the catalogue More...
 
std::shared_ptr< Objectoperator[] (const size_t i) const
 access the i-th Catalogue object More...
 
std::vector< std::shared_ptr< Object > > catalogue_object () const
 get the object vector More...
 
std::vector< double > coordinate (const int i) const
 get the X, Y, Z coordinates of the i-th object of the catalogue More...
 
size_t nObjects () const
 get the number of objects of the catalogue More...
 
std::vector< size_t > nObjects_lightCone (const int nbin) const
 get the number of objects of the catalogue for Light Cones More...
 
double Min (const Var var_name) const
 get the minimum value of a variable of the catalogue objects More...
 
double Max (const Var var_name) const
 get the maximum value of a variable of the catalogue objects More...
 
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 quartiles of a variable More...
 
std::vector< std::vector< double > > stats_var (const std::vector< Var > var_name) const
 get the mean, the median, the standard deviation, and the difference between the third and first quartiles of a vector of variables More...
 
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 More...
 
double weightedN () const
 get the total weight of the objects of the catalogue More...
 
double volume (const double boxside=par::defaultDouble) const
 compute the catalogue's comoving volume More...
 
double numdensity (const double boxside=par::defaultDouble) const
 compute the catalogue's number density More...
 
double numdensity_error (const double boxside=par::defaultDouble) const
 compute the catalogue's number density error More...
 
double mps (const double boxside=par::defaultDouble) const
 compute the catalogue's mean particle separation More...
 
double mps_error (const double boxside=par::defaultDouble) const
 compute the catalogue's mean particle separation error More...
 
std::vector< double > z_bins (const int nbin) const
 get the catalogue's redshift bins More...
 
Member functions used to set the private members
void set_region (const std::vector< long > region, const int nRegions=-1)
 set a private variable More...
 
void set_region_number (const size_t nRegions)
 set the private variable m_nRegion More...
 
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 More...
 
void set_field (const std::vector< std::string > field)
 set a private variable More...
 
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 More...
 
void set_var (const int index, const Var var_name, const int value, const cosmology::Cosmology cosmology={})
 set a private variable More...
 
void set_var (const Var var_name, const std::vector< double > var, const cosmology::Cosmology cosmology={}, const bool update_coordinates=true)
 set a private variable More...
 
void set_var (const Var var_name, const std::vector< int > var, const cosmology::Cosmology cosmology={})
 set a private variable More...
 
void set_satellite (const int index, const std::shared_ptr< Object > satellite={})
 set the private member HostHalo::m_satellites More...
 
void set_satellites (const int index, const std::vector< std::shared_ptr< Object >> satellites={})
 set the private member HostHalo::m_satellites More...
 
void set_part (const int index, const std::vector< unsigned int > part={})
 set the private member ChainMeshCell::m_part More...
 
void set_nearCells (const int index, const std::vector< std::vector< unsigned int >> nearCells={})
 set the private member ChainMeshCell::m_nearCells More...
 
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 density contrast computed inside a spherical region grown around the void center, with a radius of \(2\) times the mean particle separation of the tracer catalogue More...
 
void compute_centralDensity (const std::shared_ptr< Catalogue > tracers_catalogue, chainmesh::ChainMesh3D ChM, const std::vector< double > par_numdensity, const double threshold)
 compute the central density of each object in a void catalogue. We define as central density the density contrast computed inside a spherical region grown around the void center, with a radius of \(2\) times the mean particle separation of the tracer catalogue More...
 
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)
 compute the central density of each object in a void catalogue. We define as central density the density contrast computed inside a spherical region grown around the void center, with a radius of \(2\) times the mean particle separation of the tracer catalogue More...
 
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 sphere grown around the void centre More...
 
Member functions used to add or remove ojects to the catalogue
void add_object (std::shared_ptr< Object > object)
 add one single object to the catalogue More...
 
template<typename T >
void add_object (T object)
 add one single object to the catalogue More...
 
void add_objects (std::vector< std::shared_ptr< Object > > sample)
 add some objects to the catalogue More...
 
template<typename T >
void add_objects (std::vector< T > sample)
 add some objects to the catalogue More...
 
template<typename T >
void replace_objects (std::vector< T > sample)
 replace existing objects with new ones More...
 
void replace_objects (std::vector< std::shared_ptr< Object > > sample)
 replace existing objects with new ones More...
 
void remove_objects ()
 remove all objects remove all objects of the catalogue
 
void remove_object (const int index)
 remove an existing object More...
 
void remove_objects (const std::vector< bool > index)
 remove a set of existing objects More...
 
void swap_objects (const int ind1, const int ind2)
 swap two existing objects More...
 
void sort (const Var var_name, const bool increasing=false)
 bubble sort of a catalogue wrt a variable More...
 
void shuffle (const int seed)
 shuffle objects in the catalogue More...
 
Member functions used to operate on the ojects to the catalogue
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, redshift) More...
 
void computePolarCoordinates (const CoordinateUnits outputUnits=CoordinateUnits::_radians_)
 compute the polar coordinates (R.A., Dec, dc) from the comoving coordinates (x, y, z) More...
 
void computePolarCoordinates (const cosmology::Cosmology &cosmology, const double z1=0., const double z2=10., const CoordinateUnits outputUnits=CoordinateUnits::_radians_)
 compute the polar coordinates (R.A., Dec, dc, redshift) from the comoving (x, y, z), and assuming a cosmological model More...
 
void normalizeComovingCoordinates ()
 normalize comoving coordinates More...
 
void restoreComovingCoordinates ()
 restore comoving coordinates More...
 
void Order (const std::vector< int > vv)
 order the catalogue according to the input vector More...
 
void Order ()
 restore the original vector (i.e. the opposite of Order(std::vector<int>))
 
void write_comoving_coordinates (const std::string outputFile) const
 write the comoving coordinates of the catalogue to an output file More...
 
void write_obs_coordinates (const std::string outputFile) const
 write the polar coordinates of the catalogue to an output file More...
 
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 output file More...
 
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 More...
 
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 More...
 
Catalogue operator+= (std::shared_ptr< Catalogue > cc)
 overloading of the += operator, to sum two catalogues More...
 
Catalogue operator+= (const Catalogue cc)
 overloading of the += operator, to sum two catalogues More...
 
Catalogue sub_catalogue (const Var var_name, const double down, const double up, const bool excl=false) const
 create a sub-catalogue More...
 
Catalogue sub_catalogue (const mask_function mask, const bool excl=false) const
 create a sub-catalogue More...
 
Catalogue sub_catalogue (const MaskObject &mask, const bool excl=false) const
 create a sub-catalogue More...
 
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")
 find the Catalogue objects falling in the tiles of an input data catalogue, given the R.A.-Dec centres of the tiles. More...
 
Catalogue mangle_cut (const std::string mangle_mask, const bool excl=false) const
 create a sub-catalogue More...
 
Catalogue diluted_catalogue (const double nSub, const int seed=3213) const
 create a diluted catalogue More...
 
std::shared_ptr< Cataloguesmooth (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 More...
 
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 More...
 
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 More...
 
std::vector< double > compute_catalogueProperties_box (const double boxside)
 compute catalogue volume, number density and mean particle separation More...
 
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 More...
 
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 More...
 
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 More...
 
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 More...
 
void equalize_random_box (cbl::catalogue::Catalogue tracer_catalogue, const int seed)
 equalize the number of objects in two Box catalogues More...
 
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. If all the steps are selected the final result is a catalogue of spherical, not-overlapped voids. More...
 
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_)
 function that modifies a void catalogue according to a set of user selected criteria. If all the steps are selected the final result is a catalogue of spherical, not-overlapped voids. More...
 
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_)
 function that modifies a void catalogue according to a set of user selected criteria. If all the steps are selected the final result is a catalogue of spherical, not-overlapped voids. More...
 

Private Attributes

std::vector< std::shared_ptr< Object > > m_object
 vector containing the objects of the catalogue
 
std::vector< int > m_index
 vector containing the object indexes
 
size_t m_nRegions = 0
 number of regions
 

private variables and functions used to read catalogues from standard GADGET files

int m_blockheader
 contains the block-header temporary value
 
SubFindTab_Header m_read_header (std::ifstream &finh, const bool swap=false)
 read the GADGET subfind table header More...
 
Gadget_Header m_swap_header (Gadget_Header header)
 swap endianism of the GADGET snapshot header More...
 
SubFindTab_Header m_swap_header (SubFindTab_Header header)
 swap endianism of the GADGET subfind table header More...
 
void m_check_it_in (std::ifstream &finr, const bool swap)
 Input function to check consistency in reading block-headers in binary GADGET snapshots. More...
 
void m_check_it_out (std::ifstream &finr, const bool swap)
 Ouput function to check consistency in reading block-headers in binary GADGET snapshots. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ Catalogue() [1/26]

cbl::catalogue::Catalogue::Catalogue ( const Catalogue obj)
inline

Copy constructor for the Catalogue class.

Parameters
objcatalogue to be copied

Definition at line 746 of file Catalogue.h.

◆ Catalogue() [2/26]

cbl::catalogue::Catalogue::Catalogue ( Catalogue &&  obj)
inline

move constructor for the Catalogue class

Parameters
objcatalogue to be moved

Definition at line 765 of file Catalogue.h.

◆ Catalogue() [3/26]

cbl::catalogue::Catalogue::Catalogue ( const ObjectType  objectType,
const CoordinateType  coordinateType,
const std::vector< double >  coord1,
const std::vector< double >  coord2,
const std::vector< double >  coord3,
const std::vector< double >  weight = {},
const cosmology::Cosmology cosm = {},
const CoordinateUnits  inputUnits = CoordinateUnits::_radians_ 
)

constructor

Parameters
objectTypethe object type, specified in the cbl::catalogue::ObjectType enumeration
coordinateTypethe coordinate type, specified in the cbl::CoordinateType enumeration
coord1vector containing the first coordinates, that can be either the x comoving coordinates, or the Right Ascensions (depending on coordtype)
coord2vector containing the second coordinates, that can be either the y comoving coordinates, or the Declinations (depending on coordtype)
coord3vector containing the third coordinates, that can be either the z comoving coordinates, or the redshits (depending on coordtype)
weightvector containing the weights
cosmobject of class Cosmology
inputUnitsthe units of the input coordinates

Definition at line 91 of file Catalogue.cpp.

◆ Catalogue() [4/26]

cbl::catalogue::Catalogue::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_ 
)
inline

constructor

Parameters
objectTypethe object type, specified in the cbl::catalogue::ObjectType enumeration
coordinateTypethe coordinate type, specified in the cbl::CoordinateType enumeration
coord1vector containing the first coordinates, that can be either the x comoving coordinates, or the Right Ascensions (depending on coordtype)
coord2vector containing the second coordinates, that can be either the y comoving coordinates, or the Declinations (depending on coordtype)
coord3vector containing the third coordinates, that can be either the z comoving coordinates, or the redshits (depending on coordtype)
cosmobject of class Cosmology
inputUnitsthe units of the input coordinates

Definition at line 881 of file Catalogue.h.

◆ Catalogue() [5/26]

cbl::catalogue::Catalogue::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 
)

constructor, reading a file with coordinates

Parameters
objectTypethe object type, specified in the cbl::catalogue::ObjectType enumeration
coordinateTypethe coordinate type, specified in the cbl::CoordinateType enumeration
filevector containing the files where the input catalogues are stored
col1column of the input file containing the first coordinates, that can be either the x comoving coordinates, or the Right Ascensions (depending on coordtype)
col2column of the input file containing the second coordinates, that can be either the y comoving coordinates, or the Declinations (depending on coordtype)
col3column of the input file containing the third coordinates, that can be either the z comoving coordinates, or the redshits (depending on coordtype)
colWeightcolumn of the input file containing the weights
colRegioncolumn of the input file containing the regions (used for jackknife or bootstrap)
nSubthe fracton of objects that will be randomly selected (nSub=1 \( \rightarrow \) all objects are selected)
facta factor used to multiply the coordinates, i.e. coordinate_i=coordinate_i*fact
cosmobject of class Cosmology
inputUnitsthe units of the input coordinates
charEncodecharacter encoding of input file, ascii or binary
commentthe string used to indicate a comment in the input file; all the data occurring on a line after a comment are discarded
seedthe seed for random number generation

Definition at line 124 of file Catalogue.cpp.

◆ Catalogue() [6/26]

cbl::catalogue::Catalogue::Catalogue ( const ObjectType  objectType,
const CoordinateType  coordinateType,
const std::vector< std::string >  file,
const cosmology::Cosmology cosm,
const CoordinateUnits  inputUnits = CoordinateUnits::_radians_ 
)
inline

constructor, reading a file with coordinates

Parameters
objectTypethe object type, specified in the cbl::catalogue::ObjectType enumeration
coordinateTypethe coordinate type, specified in the cbl::CoordinateType enumeration
filevector containing the files where the input catalogues are stored
cosmobject of class Cosmology
inputUnitsthe units of the input coordinates

Definition at line 955 of file Catalogue.h.

◆ Catalogue() [7/26]

cbl::catalogue::Catalogue::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 
)

constructor, reading a file with attributes of the catalogue

Parameters
objectTypethe object type, specified in the cbl::catalogue::ObjectType enumeration
coordinateTypethe coordinate type, specified in the cbl::CoordinateType enumeration
attributevector containing the list of attributes contained in the file, used to construct the catalogue
columnvector containing the column number which correspond to each element of the vector 'attributes', to be provided in ascending order; the column number corresponding to the first column is 1
filevector containing the files where the input catalogues are stored
commentsnumber of rows to ignore at the beginning of the input file if its character encoding is ascii
nSubthe fracton of objects that will be randomly selected (nSub=1 \( \rightarrow \) all objects are selected)
facta factor used to multiply the coordinates, i.e. coordinate_i=coordinate_i*fact
cosmobject of class Cosmology
inputUnitsthe units of the input coordinates
seedthe seed for random number generation
delimiterthe delimiter between the columns
Warning
The vector column must be sorted in ascending order. The column datas will be read as double types, unless a column corresponds to the variable type ID (in this case the values will be read as int)

Definition at line 245 of file Catalogue.cpp.

◆ Catalogue() [8/26]

cbl::catalogue::Catalogue::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 
)

constructor, reading a file in FITS format

This constructor reads a FITS file that should contain at least the three object coordinates, and possibly also weights and regions

Parameters
objectTypethe object type, specified in the cbl::catalogue::ObjectType enumeration
coordinateTypethe coordinate type, specified in the cbl::CoordinateType enumeration
filevector containing the files where the input catalogues are stored
column_namesvector containing the column names to read, i.e. at least the three coordinates, and possibly the weights and regions, in this order
read_weightsif true, read also the object weights from the FITS file
read_regionsif true, read also the object regions from the FITS file
nSubthe fracton of objects that will be randomly selected (nSub=1 \( \rightarrow \) all objects are selected)
facta factor used to multiply the coordinates, i.e. coordinate_i=coordinate_i*fact
cosmobject of class Cosmology
inputUnitsthe units of the input coordinates
seedthe seed for random number generation

Definition at line 46 of file FITSCatalogue.cpp.

◆ Catalogue() [9/26]

cbl::catalogue::Catalogue::Catalogue ( const ObjectType  objectType,
const CoordinateType  coordinateType,
const std::vector< std::string >  file,
const std::vector< std::string >  column_names,
const std::vector< Var attribute,
const double  nSub,
const double  fact,
const cosmology::Cosmology cosm = {},
const CoordinateUnits  inputUnits = CoordinateUnits::_radians_,
const int  seed = 3213 
)

constructor, reading a file in FITS format

This constructor reads a FITS file and associates each column name to a specific Catalogue variable

Parameters
objectTypethe object type, specified in the cbl::catalogue::ObjectType enumeration
coordinateTypethe coordinate type, specified in the cbl::CoordinateType enumeration
filevector containing the files where the input catalogues are stored
column_namesvector containing the column names to read
attributevector containing the list of attributes contained in the file, which corresponds to each element of the vector 'column_names' (in the same order) and is specified in the cbl::catalogue::Var enumeration
nSubthe fracton of objects that will be randomly selected (nSub=1 \( \rightarrow \) all objects are selected)
facta factor used to multiply the coordinates, i.e. coordinate_i=coordinate_i*fact
cosmobject of class Cosmology
inputUnitsthe units of the input coordinates
seedthe seed for random number generation

Definition at line 94 of file FITSCatalogue.cpp.

◆ Catalogue() [10/26]

template<typename T >
cbl::catalogue::Catalogue::Catalogue ( std::vector< T >  object)
inline

constructor, using vectors of generic objects

Parameters
objectobjects of class T, specified in the cbl::catalogue::ObjectType enumeration

Definition at line 1091 of file Catalogue.h.

◆ Catalogue() [11/26]

cbl::catalogue::Catalogue::Catalogue ( std::vector< std::shared_ptr< Object > >  sample)
inline

constructor, using vectors of pointers to generic objects

Parameters
samplevector of objects of type Object, specified in the cbl::catalogue::ObjectType enumeration

Definition at line 1103 of file Catalogue.h.

◆ Catalogue() [12/26]

cbl::catalogue::Catalogue::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 
)

constructor, reading a file with attributes of the catalogue

Parameters
objectTypethe object type, specified in the cbl::catalogue::ObjectType enumeration
attributevector containing the list of attributes contained in the file, used to construct the catalogue
columnvector containing the column number which correspond to each element of the vector 'attributes'
filevector containing the files where the input catalogues are stored
commentsnumber of rows to ignore at the beginning of the input file if its character encoding is ascii
nSubthe fracton of objects that will be randomly selected (nSub=1 \( \rightarrow \) all objects are selected)
seedthe seed for random number generation

Definition at line 347 of file Catalogue.cpp.

◆ Catalogue() [13/26]

cbl::catalogue::Catalogue::Catalogue ( const Catalogue  input_catalogue,
const Catalogue  target_catalogue,
const Var  var_name,
const int  nbin,
const int  seed = 3213 
)

constructor, creating a catalogue by matching the distribution of one quantity from a target catalogue

Parameters
input_cataloguethe input catalogue
target_cataloguethe target catalogue
var_namethe type of variable, specified cbl::catalogue::Var enumeration
nbinthe binning for the variable
seedthe seed for random number generation

Definition at line 2405 of file Catalogue.cpp.

◆ Catalogue() [14/26]

cbl::catalogue::Catalogue::Catalogue ( const Catalogue  input_catalogue,
const Catalogue  target_catalogue,
const cbl::catalogue::Var  var_name1,
const int  nbin1,
const cbl::catalogue::Var  var_name2,
const int  nbin2,
const int  seed = 3213 
)

constructor, creating a catalogue by matching the distributions of two quantities from a target catalogue

Parameters
input_cataloguethe input catalogue
target_cataloguethe target catalogue
var_name1the type of variable, specified cbl::catalogue::Var enumeration
nbin1the binning for the variable
var_name2the type of variable, specified cbl::catalogue::Var enumeration
nbin2the binning for the variable
seedthe seed for random number generation

Definition at line 2444 of file Catalogue.cpp.

◆ Catalogue() [15/26]

cbl::catalogue::Catalogue::Catalogue ( const Catalogue  halo_catalogue,
const cosmology::Cosmology cosm,
const HODType  HOD_Type,
const double  threshold,
const bool  substructures = true,
std::vector< double >  parameter = {} 
)

constructor that creates a catalogue of galaxies using an HOD model to popolate the haloes

Parameters
halo_cataloguethe halo catalogue
cosmthe cosmology used to convert redshifts into coordinates
HOD_Typethe HOD model used to populate haloes with galaxies
thresholdthe threshold above which the haloes are populated with galaxies. It is espressed in stellar mass if HODType is Moster10, or in magnitude if HODType is Zehavi05 or Zehavi11, the available magnitude threshold are \({-18,-18.5,-19,-19.5,-20,-20.5,-21,-21.5,-22}\) .
substructuresif true the halo catalogue is populated with galaxies and substructures; if false only with galaxies
parametervector of double which contains the parameters for the HOD. An empty vector takes the defaul values of the HOD model considered adopted. When HODType is Moster10 only the first 11 parameters are used, that are referrend to mean occupation numbers and to the conditional stellar mass function. The first five refer to the central galaxies, while the other refer to the satellite galaxies. They are respectively \({k_c,M_{1c}, \beta_c, \gamma_c, k_s, M_{1s}, \beta_s, \gamma_s, \phi_s, \alpha_s}\). The mean occupation numbers are:

\[\bigl \langle N_{c} (>M_{*,min},M)\bigl \rangle = \frac{1}{2}\left[1-erf\left(\frac{\log M_{*,min}/\bar M_{*,c}}{\sqrt{2}\sigma_c}\right)\right] \]

\[ \bigl \langle N_{s} (>M_{*,min},M)\bigl \rangle = \frac{\phi_s^*}{2}\Gamma\left[\frac{\alpha_s}{2} + \frac{1}{2},\left(\frac{M_{*,min}}{\bar M_{*,s}}\right)^2\right]\]

where the subscripts "c" and "s" refer to central and satellite galaxies, respectively, and \(\bar M_{*} \) is the mean stellar mass for galaxies inside an halo of mass \(M\)

\[\bar M_{*} = 2Mk\left[\left(\frac{M}{M_{1}}\right)^{-\beta}+\left(\frac{M}{M_{1}}\right)^{\gamma}\right]^{-1}\]

When HODType is Zehavi05 or Zehavi11 the length of the parameters vector is 14 and 16 respectively. In Zehavi05 the first 3 are referred to the mean occupation numbers, while with Zehavi11 the first five are referred to the mean occupation number. While the other parameters are used to extract the stellar mass of each galaxy. The parameters vector with Zehavi05 is: \({M_{min},M_1,\alpha,k_c, M_{1c}, \beta_c, \gamma_c,k_s,M_{1s},\beta_s,\gamma_s,\phi_s,\alpha_s}\). The mean occupation number for central and satellite galaxies respectively are the follow:

\[\bigl \langle N_c(M) \bigl \rangle = \begin{cases} 0 \ \ \ \text{if $M<M_{min}$} \\ 1 \ \ \ \hfill \text{if $M>M_{min}$} \\ \end{cases}\]

\[\bigl \langle N_s (M)\bigl \rangle =\begin{cases} 0 \ \ \ \text{if $M<M_{min}$} \\ (\frac{M-M_{min}}{M_1})^{\alpha} \ \ \ \text{if $M>M_{min}$} \\ \end{cases}\]

The parameters vector with Zehavi11 is: \({logM_{min},\sigma_{logM},M_0,M_1,\alpha,k_c,M_{1c}, \beta_c,\gamma_c,k_s,M_{1s},\beta_s,\gamma_s,\phi_s,\alpha_s}\) The mean occupation number for central and satellite galaxies respectively are the follow:

\[\bigl \langle N_c (M)\bigl \rangle =\frac{1}{2}\left[1+erf \left(\frac{\log M-\log M_{min}}{\sigma_{logM}}\right)\right] \]

\[\bigl \langle N_s (M)\bigl \rangle= \frac{1}{2}\left[1+\left(\frac{M-M_0}{M'_1}\right)^\alpha\right]\]

The stellar masses for central and satellite galaxies are extracted from the following conditional stellar mass function:

\[\Phi_{c}(M_*|M)=\frac{1}{\sqrt{2\pi}\ln10 M_* \sigma_c}\exp\left[-\frac{\log^2\left(M_* /\bar M_{*,c}\right)}{2\sigma_c^2}\right] \]

\[ \Phi_{s}(M_*|M)=\frac{\phi^*_s}{\bar M_{*,s}}\left(\frac{m_*}{m_{*,s}}\right)^{\alpha_s} \exp\left[-\left(\frac{M_*}{\bar M_{*,s}}\right)^2\right] \]

Definition at line 84 of file HODCatalogue.cpp.

◆ Catalogue() [16/26]

cbl::catalogue::Catalogue::Catalogue ( const RandomType  type,
const cosmology::Cosmology real_cosm,
const cosmology::Cosmology test_cosm,
const std::string  dir_in,
const double  Zguess_min,
const double  Zguess_max 
)

constructor that creates a random catalogue in a cubic box, warped by geometric distortions

this function reads a cubic random catalogue from a file, generated in a given cosmology, and trasforms it into a new one in a different cosmology

Parameters
typethe type of random catalogue, that must be set to _createRandom_box_
real_cosmobject of class Cosmology representing the real (or assumed) cosmology
test_cosmobject of class Cosmology representing the test cosmology
dir_inthe input directory where the original random catalogue is stored
Zguess_minminimum redshift used to search the redshift
Zguess_maxmaximum redshift used to search the redshift
Warning
the input parameter type is used only to make the constructor type explicit

Definition at line 45 of file RandomCatalogue.cpp.

◆ Catalogue() [17/26]

cbl::catalogue::Catalogue::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 
)

constructor that creates a random catalogue with either the square geometry or with 'the shuffle' method

constructor that creates a random catalogue with either the square geometry in observed coordinates (R.A., Dec), or with the 'shuffle' method, i.e. using the R.A. and Dec coordinates of the input catalogue

Parameters
typethe type of random catalogue, that must be set to either _createRandom_box_, _createRandom_square_, _createRandom_shuffle_ or _createRandom_shuffleTOT_
catalogueobject of class Catalogue
N_Rfraction of random objects, i.e. NR=Nrandom/Nobjects
nbinnumber of redshift bins used to compute the redshift distribution
cosmobject of class Cosmology
convtrue → compute the Gaussian convolvolution of the distribution; false → do not convolve
sigmathe standard deviation, σ, of the Gaussian kernel
redshiftvector containg the redshifts used to computed the redshift distribution for the random catalogue; if it is not provided, the redshifts of the input catalogue will be used
RAvector containg the right ascensions of the random objects; if it is not provided, it will be created by the function
Decvector containg the declinations of the random objects; if it is not provided, it will be created by the function
z_ndigitsthe number of digit figures used for the redshifts
seedthe seed for random number generation
Warning
the input parameter type is used only to make the constructor type explicit

Definition at line 88 of file RandomCatalogue.cpp.

◆ Catalogue() [18/26]

cbl::catalogue::Catalogue::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 
)

constructor that creates a random catalogue with the 'shuffle' method.

Only two random types are allowed:

  • cbl::catalogue::RandomType::_createRandom_shuffleTOT_: shuffle in R.A., Dec, redshift;
  • cbl::catalogue::RandomType::_createRandom_shuffle_: shuffle in R.A. and Dec, and random extraction of redshift positions only in the bins filled by the data. Such bins have dimension equal to \(\Delta_z\), which is an input parameter of this constructor. More specifically, the redshift distribution of the data is smoothed with a Gaussian kernel, with rms equal to \(\sigma_{\rm kernel}\). Random extractions are obtained from this smoothed distribution, and only those within the "good" redshift bins are kept.

If R.A., Dec or redshift are provided in input the code won't create them.

In the case of _createRandom_shuffle_, the code will extract (times_default \(\times\) the requested number of random objects) redshift values from the smoothed \(n(z)\). Then only those extractions falling in the good redshift bins are selected. The difference between the number of such good extractions and the requested number of random objects must be lower than the tolerance parameter, and higher than the requested number of random objects. If not, the code re-performs the extraction from \(n(z)\) by multiplying times_default by \((1+times\_change)\) or by \((1-times\_change)\). Then, for example, the new variable \(times = times\_default (1+times\_change)\) is used. The aim is obtaining a number of good extractions which is higher than the requested number of random objects, and then the extracitons in excess are uniformly excluded from the good redshift bins.

Author
Giorgio Lesci (giorg.nosp@m.io.l.nosp@m.esci2.nosp@m.@uni.nosp@m.bo.it)
Parameters
typethe type of random catalogue, that must be set to either _createRandom_shuffle_ or _createRandom_shuffleTOT_
N_Rfraction of random objects, i.e. NR=Nrandom/Nobjects
z_step\(\Delta_z\): step in redshift used to find the redshift intervals where the random objects have to be extracted, in the case of _createRandom_shuffle_
catalogueobject of class Catalogue
cosmobject of class Cosmology
RAvector containg the right ascensions of the random objects; if it is not provided, it will be created by the function
Decvector containg the declinations of the random objects; if it is not provided, it will be created by the function
sigma_kernel\(\sigma_{\rm kernel}\), used only in the case of _createRandom_shuffle_
nbinsnumber of redshift bins used to compute the redshift distribution, used only in the case of _createRandom_shuffle_
z_ndigitsthe number of digit figures used for the redshifts
times_defaultnumber defining the random extractions from the smoothed \(n(z)\), which is multiplied by the number of requested random objects. Used only if _createRandom_shuffle_ is selected
times_changein case the number of extractions from \(n(z)\) is too low or too high, this parameter regulates the change of times_default. Default is 50%
tolerancetolerance for the difference between good random redshifts and requested number of random objects. Default is 5%
out_path_nzused only if _createRandom_shuffle_ is selected. If provided the code writes a file containing, in the 0th column, the bin centres which depend on the input parameter nbins, while in the 1st colum there is the original smoothed redshift distribution (without holes), in the 2nd column the extracted distribution (still without holes), and in the 3rd column the final \(n(z)\)
out_file_nzthe file located at out_path_nz
seedthe seed for random number generation
Warning
the input parameter type is used only to make the constructor type explicit

Definition at line 225 of file RandomCatalogue.cpp.

◆ Catalogue() [19/26]

cbl::catalogue::Catalogue::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 
)

constructor that creates a random catalogue in a cone

Parameters
typethe type of random catalogue, that must be set to _createRandom_cone_
catalogueobject of class Catalogue
N_Rfraction of random objects, i.e. NR=Nrandom/Nobjects
nbinnumber of redshift bins used to compute the redshift distribution
Angleangle of the cone
redshiftvector containing the redshift of the objects in the catalogue
cosmobject of class Cosmology
convtrue → compute the Gaussian convolvolution of the distribution; false → do not convolve
sigmathe standard deviation, σ, of the Gaussian kernel
seedthe seed for random number generation
Warning
the input parameter type is used only to make the constructor type explicit

Definition at line 425 of file RandomCatalogue.cpp.

◆ Catalogue() [20/26]

cbl::catalogue::Catalogue::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 
)

constructor that creates a random catalogue using the a mask in the MANGLE format for the angular distribution and taking the redshift distribution from an input catalogue

Parameters
typethe type of random catalogue, that must be set to _createRandom_MANGLE_
mangle_maskvector containing the input masks in MANGLE format
catalogueobject of class Catalogue
N_Rfraction of random objects, i.e. NR=Nrandom/Nobjects
nbinnumber of redshift bins used to compute the redshift distribution
cosmobject of class Cosmology
convtrue → compute the Gaussian convolvolution of the distribution; false → do not convolve
sigmathe standard deviation, σ, of the Gaussian kernel
seedthe seed for random number generation
Warning
the input parameter type is used only to make the constructor type explicit

Definition at line 481 of file RandomCatalogue.cpp.

◆ Catalogue() [21/26]

cbl::catalogue::Catalogue::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 
)

constructor that creates a random catalogue using the SDSS stripes.

Parameters
typethe type of random catalogue, that must be set to _createRandom_SDSS_stripes_
catalogueobject of class Catalogue
N_Rfraction of random objects, i.e. NR=Nrandom/Nobjects
dndz_per_stripetrue → set the redshift for the random sample shuffling redshift of data catalogue in each stripe; false → set the redshift for the random sample extracting from the total \( dn/dz\).
nbinnumber of redshift bins used to compute the redshift distribution
cosmobject of class Cosmology
convtrue → compute the Gaussian convolvolution of the distribution; false → do not convolve
sigmathe standard deviation, σ, of the Gaussian kernel
seedthe seed for random number generation
Warning
the input parameter type is used only to make the constructor type explicit

Definition at line 546 of file RandomCatalogue.cpp.

◆ Catalogue() [22/26]

cbl::catalogue::Catalogue::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 
)

constructor that creates a random catalogue for light cones homogeneous in RA and Dec and with redshift dependent density.

Parameters
typethe type of random catalogue, that must be set to _createRandom_homogeneous_LC_
catalogueobject of class Catalogue
N_Rfraction of random objects, i.e. NR=Nrandom/Nobjects
cosmobject of class Cosmology
RA_rangerange in RA [RA_min, RA_max]
DEC_rangerange in DEC [DEC_min, DEC_max]
nbinnumber of redshift bins used to compute the redshift distribution
seedthe seed for random number generation

Definition at line 623 of file RandomCatalogue.cpp.

◆ Catalogue() [23/26]

cbl::catalogue::Catalogue::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} 
)

constructor that creates a void catalogue extracting cosmic voids from a catalogue of tracers, for COMOVING coordinates. This void finder is based on dynamical criteria: the density field is reconstructed from the displacement field generated by the back-in-time evolution of the tracers. Voids are therefore classified as regions of negative velocity divergence.

Parameters
algorithmthe type of algorithm on which the reconstruction of the density field is based (LaZeVo or Exact)
tracer_cataloguethe input tracer catalogue
random_catalogueRandom catalogues. Simply declears as empty (={}) if the random catalogue is not available: a new random catalogue will be created with the same objects and geometry of the tracer catalogue
dir_outputpath of the output directory where to store the different reconstructions, the divergence field, the subvoid and void catalogues
outputname of the output files
cellsizeminimum radius used for the chain mesh
n_recnumber of reconstructions of the density field: number of random catalogue used or generated
step_sizedimension of the grid cells used for the identification of subvoids, in units of the mean interparticle separation of the tracer catalogue. It is strongly recommended to keep this value greater than 0.75 (cell sizes too small compared to the resolution of the catalogue)
thresholdnumber of minimum couplings between a certain halo and a certain random particle necessary to couple them in a definitive way
printboolean vector of two elements. If print[0] == true, the displacement field will be saved in a file. If print[1] == true, the divergence field will be saved in a file

Definition at line 56 of file VoidCatalogue.cpp.

◆ Catalogue() [24/26]

cbl::catalogue::Catalogue::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. 
)

constructor that creates a void catalogue extracting cosmic voids from a catalogue of tracers for OBSERVED COORDINATES. This void finder is based on dynamical criteria: the density field is reconstructed from the displacement field generated by the back-in-time evolution of the tracers. Voids are therefore classified as regions of negative velocity divergence.

========================================================================================

Parameters
algorithmthe type of algorithm on which the reconstruction of the density field is based (LaZeVo or Exact)
tracer_cataloguethe input tracer catalogue
random_catalogueRandom catalogue. Simply declears as void (={}) if the random catalogue is not available: a new random catalogue will be created with the same objects and geometry of the tracer catalogue
dir_outputpath of the output directory where to store the different reconstructions, the divergence field, the subvoid and void catalogues
outputname of the output files
cellsizeminimum radius used for the chain mesh
cosmcosmology
RA_rangerange of coordinate RA of the catalogue (from -pi/2 to pi/2)
DEC_rangerange of coordinate Dec of the catalogue (from 0 to 2pi). if the catalog is located across the zero meridian, the minimum must be negative (e.g. [1.5pi, 0.5pi] -> [-0.5pi, 0.5pi]).
n_recnumber of reconstructions of the density field: number of random catalogue used or generated
step_sizedimension of the grid cells used for the identification of subvoids, in units of the mean interparticle separation of the tracer catalogue. It is strongly recommended to keep this value greater than 0.75 (cell sizes too small compared to the resolution of the catalogue)
thresholdnumber of minimum couplings between a certain halo and a certain random particle necessary to couple them in a definitive way

Definition at line 561 of file VoidCatalogue.cpp.

◆ Catalogue() [25/26]

cbl::catalogue::Catalogue::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}} 
)

constructor that reads object of selected type from Gadget snapshots

Parameters
objectTypethe object type, specified in the cbl::catalogue::ObjectType enumeration
file_cnthe the name common to all the files in which the gadget snapshot is divided (path/to/file/common_name)
snapformatfalse -> gadget snapformat 1; true -> gadget snapformat 2; else -> wrong
swaptrue = swap endianism, false = do not swap endianism
facta factor used to multiply the coordinates, i.e. coordinate_i=coordinate_i*fact
read_cataloguetrue = the constructor actually reads the GADGET snapshot false = the constructor only reads the snapshot header and prints it on the screan
nSubthe fraction of objects that will be randomly selected (nSub=1 ⇒ all objects are selected)
component_to_readwhich component to be read from the snapshot. "ALL" = read all the components positions, else select one of the following: "Gas", "Halo", "Disk", "Bulge", "Stars", "Boundary".
edgesedges of the subcatalogue, format: [ [x_min, x_max], [y_min, y_max], [z_min, z_max] ]

Definition at line 126 of file GadgetCatalogue.cpp.

◆ Catalogue() [26/26]

cbl::catalogue::Catalogue::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 
)

constructor that reads objects of class HostHalo with satellite dependencies from group and subgroup files generated by the gadget implementation of the FoF and SUBFIND algorithms (respectively)

Parameters
snapthe snapshot number
basedirthe directory in which all the GADGET outputs are stored
swaptrue = swap endianism, false = do not swap endianism
long_idstrue = IDs are stored in double precision, false = IDs are stored in single precision
scaleFacta factor used to multiply the coordinates, i.e. coordinate_i=coordinate_i*scaleFact
massFacta factor used to multiply the masses, i.e. mass_i=mass_i*scaleFact
estimate_critthe criterion used to estimate mass, radius and velocity dispersion of the group
veldispwhether the average velocity dispersion within the estimated radius has been computed or not in the GADGET run considered
masstabwhether the mass table is present or not
add_satelliteswhether to add the satellites identified by the SUBFIND algorithm to the catalogue
verbosetrue = build the catalogue verbosely, false = keep it quiet..

Definition at line 274 of file GadgetCatalogue.cpp.

Member Function Documentation

◆ add_object() [1/2]

void cbl::catalogue::Catalogue::add_object ( std::shared_ptr< Object object)
inline

add one single object to the catalogue

Parameters
objectpointer to an object of type Object

Definition at line 2641 of file Catalogue.h.

◆ add_object() [2/2]

template<typename T >
void cbl::catalogue::Catalogue::add_object ( object)
inline

add one single object to the catalogue

Parameters
objectobject of type T

Definition at line 2648 of file Catalogue.h.

◆ add_objects() [1/2]

void cbl::catalogue::Catalogue::add_objects ( std::vector< std::shared_ptr< Object > >  sample)
inline

add some objects to the catalogue

Parameters
samplevector of pointers to objects of type Object
Examples
catalogue.cpp.

Definition at line 2654 of file Catalogue.h.

◆ add_objects() [2/2]

template<typename T >
void cbl::catalogue::Catalogue::add_objects ( std::vector< T >  sample)
inline

add some objects to the catalogue

Parameters
samplevector of objects of type T

Definition at line 2664 of file Catalogue.h.

◆ angsep_xyz()

double cbl::catalogue::Catalogue::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

Parameters
ithe object index
objpointer to an object
Returns
distance between the i-th object of the catalogue and the object obj

Definition at line 2114 of file Catalogue.cpp.

◆ catalogue_object() [1/2]

std::vector<std::shared_ptr<Object> > cbl::catalogue::Catalogue::catalogue_object ( ) const
inline

get the object vector

Returns
vector of pointers to objects of the catalogue

Definition at line 2249 of file Catalogue.h.

◆ catalogue_object() [2/2]

std::shared_ptr<Object> cbl::catalogue::Catalogue::catalogue_object ( const int  i) const
inline

get the i-th object of the catalogue

Parameters
ithe object index
Returns
pointer to an object of the catalogue

Definition at line 2236 of file Catalogue.h.

◆ centralDensity()

double cbl::catalogue::Catalogue::centralDensity ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_centralDensity

Parameters
ithe object index
Returns
central density of the i-th object

Definition at line 2079 of file Catalogue.h.

◆ clean_void_catalogue() [1/3]

void cbl::catalogue::Catalogue::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. If all the steps are selected the final result is a catalogue of spherical, not-overlapped voids.

Parameters
initial_radiuserase voids outside a given interval delta_r of initial radius;
delta_rthe interval of accepted radii
thresholdthe density threshold
rescaletrue = for each void finds the larger radius enclosing density = threshold, false = skip the step
tracers_catalogueobject of class Catalogue with the tracers defining the void distribution (necessary if rescale = true)
ChMobject of ChainMesh3D class
ratiodistance from the void centre at which the density contrast is evaluated in units of the void radius. Ex: ratio = 0.1 \(\rightarrow\) 10% of the void radius lenght
checkoverlaptrue \(\rightarrow\) erase all the voids wrt a given criterion, false \(\rightarrow\) skip the step
ol_criterionthe criterion for the overlap step (valid criteria: Var::DensityContrast, Var::CentralDensity)
Examples
cleanVoidCatalogue.cpp.

Definition at line 1328 of file VoidCatalogue.cpp.

◆ clean_void_catalogue() [2/3]

void cbl::catalogue::Catalogue::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_ 
)

function that modifies a void catalogue according to a set of user selected criteria. If all the steps are selected the final result is a catalogue of spherical, not-overlapped voids.

Parameters
par_numdensitycoefficients of the polynomial describing the variation of the number density as a function of the redshift, from the highest to the lowest order. Ex.: par_density = {-0.001, 0.005, -0.01} \(\rightarrow\) numdensity = \( -0.001 \cdot z^2 + 0.005 \cdot z -0.01 \)
initial_radiuserase voids outside a given interval delta_r of initial radius;
delta_rthe interval of accepted radii
thresholdthe density threshold
rescaletrue = for each void finds the larger radius enclosing density = threshold, false = skip the step
tracers_catalogueobject of class Catalogue with the tracers defining the void distribution (necessary if rescale = true)
ChMobject of ChainMesh3D class
ratiodistance from the void centre at which the density contrast is evaluated in units of the void radius. Ex: ratio = 0.1 \(\rightarrow\) 10% of the void radius lenght
checkoverlaptrue \(\rightarrow\) erase all the voids wrt a given criterion, false \(\rightarrow\) skip the step
ol_criterionthe criterion for the overlap step (valid criteria: Var::DensityContrast, Var::CentralDensity)

Definition at line 1605 of file VoidCatalogue.cpp.

◆ clean_void_catalogue() [3/3]

void cbl::catalogue::Catalogue::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_ 
)

function that modifies a void catalogue according to a set of user selected criteria. If all the steps are selected the final result is a catalogue of spherical, not-overlapped voids.

Parameters
data_numdensity2D matrix containing the sampled values of the mean number density as a function of redshift. These data will be interpolated to finf the value of the number desnity of the tracers at a specific redshift
method_interpolationthe type of method used for the interpolation: "Linear" → linear interpolation; "Poly" → polynomial interpolation; "Spline" → cubic spline interpolation; "Rat" → diagonal rational function interpolation; "BaryRat" → barycentric rational interpolation
initial_radiuserase voids outside a given interval delta_r of initial radius;
delta_rthe interval of accepted radii
thresholdthe density threshold
rescaletrue = for each void finds the larger radius enclosing density = threshold, false = skip the step
tracers_catalogueobject of class Catalogue with the tracers defining the void distribution (necessary if rescale = true)
ChMobject of ChainMesh3D class
ratiodistance from the void centre at which the density contrast is evaluated in units of the void radius. Ex: ratio = 0.1 \(\rightarrow\) 10% of the void radius lenght
checkoverlaptrue \(\rightarrow\) erase all the voids wrt a given criterion, false \(\rightarrow\) skip the step
ol_criterionthe criterion for the overlap step (valid criteria: Var::DensityContrast, Var::CentralDensity)

Definition at line 1878 of file VoidCatalogue.cpp.

◆ compute_catalogueProperties_box()

std::vector< double > cbl::catalogue::Catalogue::compute_catalogueProperties_box ( const double  boxside)

compute catalogue volume, number density and mean particle separation

Parameters
boxsideside lenght of the cubic catalogue box
Returns
vector with 5 elements: volume, numdensity, mps, numdensity_error, mps_error;

Definition at line 2571 of file Catalogue.cpp.

◆ compute_catalogueProperties_lightCone()

std::vector< std::vector< double > > cbl::catalogue::Catalogue::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

Parameters
cosmologythe cosmology used to compute the comoving distances
RA_rangerange of coordinate RA of the catalogue (from -pi/2 to pi/2)
DEC_rangerange of coordinate Dec of the catalogue (from 0 to 2pi). if the catalog is located across the zero meridian, the minimum must be negative (e.g. [1.5pi, 0.5pi] -> [-0.5pi, 0.5pi]).
nbinnumber of bin in redshift
Returns
7 vector of nbin elements. One for each of these properties: zbin, nObj, volume, numdensity, mps, numdensity_error, mps_error;

Definition at line 2595 of file Catalogue.cpp.

◆ compute_centralDensity() [1/3]

void cbl::catalogue::Catalogue::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 density contrast computed inside a spherical region grown around the void center, with a radius of \(2\) times the mean particle separation of the tracer catalogue

Parameters
tracers_cataloguethe density field tracers catalogue
ChMa 3D chain mesh object, used to speed-up the search of close pairs
thresholdthe central density threshold

Definition at line 2150 of file VoidCatalogue.cpp.

◆ compute_centralDensity() [2/3]

void cbl::catalogue::Catalogue::compute_centralDensity ( const std::shared_ptr< Catalogue tracers_catalogue,
chainmesh::ChainMesh3D  ChM,
const std::vector< double >  par_numdensity,
const double  threshold 
)

compute the central density of each object in a void catalogue. We define as central density the density contrast computed inside a spherical region grown around the void center, with a radius of \(2\) times the mean particle separation of the tracer catalogue

Parameters
tracers_cataloguethe density field tracers catalogue
ChMa 3D chain mesh object, used to speed-up the search of close pairs
par_numdensitycoefficients of the polynomial describing the variation of the number density as a function of the redshift, from the highest to the lowest order. Ex.: par_density = {-0.001, 0.005, -0.01} \(\rightarrow\) numdensity = \( -0.001 \cdot z^2 + 0.005 \cdot z -0.01 \)
thresholdthe central density threshold

Definition at line 2176 of file VoidCatalogue.cpp.

◆ compute_centralDensity() [3/3]

void cbl::catalogue::Catalogue::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 
)

compute the central density of each object in a void catalogue. We define as central density the density contrast computed inside a spherical region grown around the void center, with a radius of \(2\) times the mean particle separation of the tracer catalogue

Parameters
tracers_cataloguethe density field tracers catalogue
ChMa 3D chain mesh object, used to speed-up the search of close pairs
data_numdensity2D matrix containing the sampled values of the mean number density as a function of redshift. These data will be interpolated to finf the value of the number desnity of the tracers at a specific redshift
method_interpolationthe type of method used for the interpolation: "Linear" → linear interpolation; "Poly" → polynomial interpolation; "Spline" → cubic spline interpolation; "Rat" → diagonal rational function interpolation; "BaryRat" → barycentric rational interpolation
thresholdthe central density threshold

Definition at line 2204 of file VoidCatalogue.cpp.

◆ compute_densityContrast()

void cbl::catalogue::Catalogue::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 sphere grown around the void centre

Parameters
tracers_cataloguethe density field tracers catalogue
ChMa 3D chain mesh object, used to speed-up the search of close pairs
ratiothe ratio \(r\) used to compute the central density
Warning
to obtain the density contrast this function computes the central density of each void in the catalogue using the internal function compute_centralDensity; if the choice of \(r\) is too low to select more than 3 tracers the program will select by dafault the 3 tracers closer to the void centre to map the central density.

Definition at line 2233 of file VoidCatalogue.cpp.

◆ computeComovingCoordinates()

void cbl::catalogue::Catalogue::computeComovingCoordinates ( const cosmology::Cosmology cosm,
const CoordinateUnits  inputUnits = CoordinateUnits::_radians_ 
)

compute the comoving coordinates (x, y, z) from the observed coordinates (R.A., Dec, redshift)

Parameters
cosmobject of class Cosmology
inputUnitsthe units of the input coordinates

Definition at line 1553 of file Catalogue.cpp.

◆ computePolarCoordinates() [1/2]

void cbl::catalogue::Catalogue::computePolarCoordinates ( const CoordinateUnits  outputUnits = CoordinateUnits::_radians_)

compute the polar coordinates (R.A., Dec, dc) from the comoving coordinates (x, y, z)

Parameters
outputUnitsthe units of the output coordinates

Definition at line 1587 of file Catalogue.cpp.

◆ computePolarCoordinates() [2/2]

void cbl::catalogue::Catalogue::computePolarCoordinates ( const cosmology::Cosmology cosmology,
const double  z1 = 0.,
const double  z2 = 10.,
const CoordinateUnits  outputUnits = CoordinateUnits::_radians_ 
)

compute the polar coordinates (R.A., Dec, dc, redshift) from the comoving (x, y, z), and assuming a cosmological model

Parameters
cosmologyobject of class Cosmology
z1the minimum redshift used in the computation
z2the maximum redshift used in the computation
outputUnitsthe units of the output coordinates

Definition at line 1638 of file Catalogue.cpp.

◆ coordinate()

std::vector<double> cbl::catalogue::Catalogue::coordinate ( const int  i) const
inline

get the X, Y, Z coordinates of the i-th object of the catalogue

Parameters
ithe object index
Returns
vector containing the three coordinates

Definition at line 2258 of file Catalogue.h.

◆ counts_in_cell()

data::ScalarField3D cbl::catalogue::Catalogue::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

Parameters
cell_sizethe minimum size of the density field
interpolation_typethe type of interpolation false → nearest-grid-point; true → cloud-in-cell
useMassgenerate the density field using the mass information
minXminimum value of the x coordinate
maxXmaximum value of the x coordinate
minYminimum value of the y coordinate
maxYmaximum value of the y coordinate
minZminimum value of the z coordinate
maxZmaximum value of the z coordinate
Returns
the density field

Definition at line 2266 of file Catalogue.cpp.

◆ dc()

double cbl::catalogue::Catalogue::dc ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_dc

Parameters
ithe object index
Returns
the comoving distance of the i-th object

Definition at line 1849 of file Catalogue.h.

◆ dec()

double cbl::catalogue::Catalogue::dec ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_dec

Parameters
ithe object index
Returns
the Declination of the i-th object

Definition at line 1863 of file Catalogue.h.

◆ dec_tile()

double cbl::catalogue::Catalogue::dec_tile ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_dec_tile

Parameters
ithe object index
Returns
the Declination of the i-th object

Definition at line 1877 of file Catalogue.h.

◆ density_field()

data::ScalarField3D cbl::catalogue::Catalogue::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

Parameters
cell_sizethe minimum size of the density field
mask_cataloguecatalogue containing points sampling the selecion function of the catalogue
interpolation_typethe type of interpolation false → nearest-grid-point; true → cloud-in-cell
kernel_radiussize of the kernel for the gaussian smoothing
useMassgenerate the density field using the mass information
Returns
the density field

Definition at line 2341 of file Catalogue.cpp.

◆ densityContrast()

double cbl::catalogue::Catalogue::densityContrast ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_densityContrast

Parameters
ithe object index
Returns
density contrast of the i-th object

Definition at line 2072 of file Catalogue.h.

◆ diluted_catalogue()

Catalogue cbl::catalogue::Catalogue::diluted_catalogue ( const double  nSub,
const int  seed = 3213 
) const

create a diluted catalogue

Parameters
nSubthe fracton of objects that will be randomly selected (nSub=1 \( \rightarrow \) all objects are selected)
seedthe seed for random number generation
Returns
object of class Catalogue

Definition at line 2076 of file Catalogue.cpp.

◆ distance()

double cbl::catalogue::Catalogue::distance ( const int  i,
std::shared_ptr< Object obj 
) const

get the distrance between the i-th object of the catalogue and another object

Parameters
ithe object index
objpointer to an object
Returns
distance between the i-th object of the catalogue and the object obj

Definition at line 2103 of file Catalogue.cpp.

◆ equalize_random_box()

void cbl::catalogue::Catalogue::equalize_random_box ( cbl::catalogue::Catalogue  tracer_catalogue,
const int  seed 
)

equalize the number of objects in two Box catalogues

Parameters
tracer_catalogueinput catalogue
seedseed for generating random numbers

Definition at line 694 of file RandomCatalogue.cpp.

◆ equalize_random_lightCone()

void cbl::catalogue::Catalogue::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

Parameters
tracer_catalogueinput catalogue
cosmthe cosmology
RA_rangerange of coordinate RA of the catalogue (from -pi/2 to pi/2)
DEC_rangerange of coordinate Dec of the catalogue (from 0 to 2pi).
seedseed for generating random numbers

Definition at line 650 of file RandomCatalogue.cpp.

◆ field() [1/2]

std::vector< std::string > cbl::catalogue::Catalogue::field ( ) const

get the values of the object fields

Returns
the object fields

Definition at line 436 of file Catalogue.cpp.

◆ field() [2/2]

std::string cbl::catalogue::Catalogue::field ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_field

Parameters
ithe object index
Returns
the field where the i-th object has been observed

Definition at line 1961 of file Catalogue.h.

◆ field_list()

std::vector<std::string> cbl::catalogue::Catalogue::field_list ( ) const
inline

get the list of fields where the objects have been observed

Returns
the list of fields

Definition at line 2008 of file Catalogue.h.

◆ galaxyTag()

double cbl::catalogue::Catalogue::galaxyTag ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_galaxyTag

Parameters
ithe object index
Returns
tag of a galaxy

Definition at line 2116 of file Catalogue.h.

◆ generic()

double cbl::catalogue::Catalogue::generic ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_generic

Parameters
ithe object index
Returns
generic properties of the i-th object

Definition at line 2137 of file Catalogue.h.

◆ ID()

int cbl::catalogue::Catalogue::ID ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_ID

Parameters
ithe object index
Returns
ID of the i-th object

Definition at line 2086 of file Catalogue.h.

◆ IDHost()

int cbl::catalogue::Catalogue::IDHost ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_IDHost

Parameters
ithe object index
Returns
ID of the Host halo i-th object

Definition at line 2109 of file Catalogue.h.

◆ isSetVar() [1/2]

bool cbl::catalogue::Catalogue::isSetVar ( const int  index,
const Var  var_name 
) const

check if the given variable of the i-th object is set

Parameters
indexthe index of the object
var_namethe variable name
Returns
if the variable is set \( \rightarrow \) true; else \( \rightarrow \) false

Definition at line 740 of file Catalogue.cpp.

◆ isSetVar() [2/2]

bool cbl::catalogue::Catalogue::isSetVar ( const Var  var_name) const

check if the given object variables are set

Parameters
var_namethe variable name
Returns
if the given variables are set \( \rightarrow \) true; else \( \rightarrow \) false

Definition at line 918 of file Catalogue.cpp.

◆ lensingCalib()

double cbl::catalogue::Catalogue::lensingCalib ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_lensingCalib

Parameters
ithe object index
Returns
the lensing calibration factor of the i-th object

Definition at line 1940 of file Catalogue.h.

◆ lensingWeight()

double cbl::catalogue::Catalogue::lensingWeight ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_lensingWeight

Parameters
ithe object index
Returns
the lensing weight of the i-th object

Definition at line 1933 of file Catalogue.h.

◆ m_check_it_in()

void cbl::catalogue::Catalogue::m_check_it_in ( std::ifstream &  finr,
const bool  swap 
)
private

Input function to check consistency in reading block-headers in binary GADGET snapshots.

Parameters
finra pointer to an input stream class object
swaptrue \(\rightarrow\) swap endianism, false \(\rightarrow\) do not swap endianism

Definition at line 110 of file GadgetCatalogue.cpp.

◆ m_check_it_out()

void cbl::catalogue::Catalogue::m_check_it_out ( std::ifstream &  finr,
const bool  swap 
)
private

Ouput function to check consistency in reading block-headers in binary GADGET snapshots.

Parameters
finra pointer to an input stream class object
swaptrue \(\rightarrow\) swap endianism, false \(\rightarrow\) do not swap endianism

Definition at line 116 of file GadgetCatalogue.cpp.

◆ m_read_header()

cbl::catalogue::SubFindTab_Header cbl::catalogue::Catalogue::m_read_header ( std::ifstream &  finh,
const bool  swap = false 
)
private

read the GADGET subfind table header

Parameters
finhan object of class std::ifstream
swapwhether to swap or not the header
Returns
an object of type SubFindTab_Header

Definition at line 40 of file GadgetCatalogue.cpp.

◆ m_swap_header() [1/2]

cbl::catalogue::Gadget_Header cbl::catalogue::Catalogue::m_swap_header ( Gadget_Header  header)
private

swap endianism of the GADGET snapshot header

Parameters
headerthe un-swapped header
Returns
an object of type Gadget_Header

Definition at line 67 of file GadgetCatalogue.cpp.

◆ m_swap_header() [2/2]

cbl::catalogue::SubFindTab_Header cbl::catalogue::Catalogue::m_swap_header ( SubFindTab_Header  header)
private

swap endianism of the GADGET subfind table header

Parameters
headerthe un-swapped header
Returns
an object of type SubFindTab_Header

Definition at line 94 of file GadgetCatalogue.cpp.

◆ magnitude()

double cbl::catalogue::Catalogue::magnitude ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_magnitude

Parameters
ithe object index
Returns
the magnitude of the i-th object

Definition at line 2030 of file Catalogue.h.

◆ magnitudeG()

double cbl::catalogue::Catalogue::magnitudeG ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_magnitudeG

Parameters
ithe object index
Returns
the g-band magnitude of the i-th object

Definition at line 2044 of file Catalogue.h.

◆ magnitudeI()

double cbl::catalogue::Catalogue::magnitudeI ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_magnitudeI

Parameters
ithe object index
Returns
the i-band magnitude of the i-th object

Definition at line 2058 of file Catalogue.h.

◆ magnitudeR()

double cbl::catalogue::Catalogue::magnitudeR ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_magnitudeR

Parameters
ithe object index
Returns
the r-band magnitude of the i-th object

Definition at line 2051 of file Catalogue.h.

◆ magnitudeU()

double cbl::catalogue::Catalogue::magnitudeU ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_magnitudeU

Parameters
ithe object index
Returns
the u-band magnitude of the i-th object

Definition at line 2037 of file Catalogue.h.

◆ mangle_cut()

Catalogue cbl::catalogue::Catalogue::mangle_cut ( const std::string  mangle_mask,
const bool  excl = false 
) const

create a sub-catalogue

Parameters
mangle_maskname of the mangle polygon file
exclfalse → create a subcatalogue with objects inside the mask; true → create a subcatalogue outside the mask
Returns
object of class Catalogue

Definition at line 2027 of file Catalogue.cpp.

◆ mass()

double cbl::catalogue::Catalogue::mass ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_mass

Parameters
ithe object index
Returns
the mass of the i-th object

Definition at line 2023 of file Catalogue.h.

◆ mass_proxy()

double cbl::catalogue::Catalogue::mass_proxy ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_mass_proxy

Parameters
ithe object index
Returns
the mass proxy of the i-th object

Definition at line 2094 of file Catalogue.h.

◆ mass_proxy_error()

double cbl::catalogue::Catalogue::mass_proxy_error ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_mass_proxy_error

Parameters
ithe object index
Returns
the mass proxy error of the i-th object

Definition at line 2102 of file Catalogue.h.

◆ massinfall()

double cbl::catalogue::Catalogue::massinfall ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_minfall

Parameters
ithe object index
Returns
the infall mass of the i-th object

Definition at line 2130 of file Catalogue.h.

◆ Max()

double cbl::catalogue::Catalogue::Max ( const Var  var_name) const
inline

get the maximum value of a variable of the catalogue objects

Parameters
var_namethe variable name
Returns
the maximum value of the variable
Examples
cleanVoidCatalogue.cpp.

Definition at line 2295 of file Catalogue.h.

◆ Min()

double cbl::catalogue::Catalogue::Min ( const Var  var_name) const
inline

get the minimum value of a variable of the catalogue objects

Parameters
var_namethe variable name
Returns
the minimum value of the variable

Definition at line 2287 of file Catalogue.h.

◆ mps()

double cbl::catalogue::Catalogue::mps ( const double  boxside = par::defaultDouble) const
inline

compute the catalogue's mean particle separation

Parameters
boxsidelength of the side of the box
Returns
mps of the box
Examples
cleanVoidCatalogue.cpp.

Definition at line 2392 of file Catalogue.h.

◆ mps_error()

double cbl::catalogue::Catalogue::mps_error ( const double  boxside = par::defaultDouble) const
inline

compute the catalogue's mean particle separation error

Parameters
boxsidelength of the side of the box
Returns
error of the mps of the box

Definition at line 2402 of file Catalogue.h.

◆ mstar()

double cbl::catalogue::Catalogue::mstar ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_mstar

Parameters
ithe object index
Returns
the stellar mass of the i-th object

Definition at line 2123 of file Catalogue.h.

◆ nearCells()

std::vector<std::vector<unsigned int> > cbl::catalogue::Catalogue::nearCells ( const int  index) const
inline

get the private member Catalogue::m_object[index]->m_nearCells of ChainMeshCell

Parameters
indexthe object index
Returns
the matrix of the cells near the i-th object

Definition at line 2177 of file Catalogue.h.

◆ nFields()

size_t cbl::catalogue::Catalogue::nFields ( ) const
inline

get the total number of fields where the objects have been observed

Returns
the total number of fields

Definition at line 2016 of file Catalogue.h.

◆ nObjects()

size_t cbl::catalogue::Catalogue::nObjects ( ) const
inline

get the number of objects of the catalogue

Returns
the number of objects
Examples
catalogue.cpp.

Definition at line 2264 of file Catalogue.h.

◆ nObjects_condition()

int cbl::catalogue::Catalogue::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

Parameters
var_namethe variable name
downminimum variable used to cut the catalogue
upmaximum variable used to cut the catalogue
exclfalse → count objects inside down-up; true → count objects outside down-up;
Returns
number of objects following the condition

Definition at line 2229 of file Catalogue.cpp.

◆ nObjects_lightCone()

std::vector<size_t> cbl::catalogue::Catalogue::nObjects_lightCone ( const int  nbin) const
inline

get the number of objects of the catalogue for Light Cones

Parameters
nbinbins in redshift (number of centres: so, if 100 bins are requested, insert 100)
Returns
the number of objects in each shell

Definition at line 2271 of file Catalogue.h.

◆ normalizeComovingCoordinates()

void cbl::catalogue::Catalogue::normalizeComovingCoordinates ( )

normalize comoving coordinates

function to normalize comoving coordinates, that is it transforms (x, y, z) into (x/dc, y/dc, z/dc))

Definition at line 1684 of file Catalogue.cpp.

◆ nRegions()

size_t cbl::catalogue::Catalogue::nRegions ( )

get the private member m_nRegions

Returns
the total number of regions

Definition at line 396 of file Catalogue.cpp.

◆ numdensity()

double cbl::catalogue::Catalogue::numdensity ( const double  boxside = par::defaultDouble) const
inline

compute the catalogue's number density

Parameters
boxsidelength of the side of the box
Returns
numdensity of the box

Definition at line 2372 of file Catalogue.h.

◆ numdensity_error()

double cbl::catalogue::Catalogue::numdensity_error ( const double  boxside = par::defaultDouble) const
inline

compute the catalogue's number density error

Parameters
boxsidelength of the side of the box
Returns
error of the numdensity of the box

Definition at line 2382 of file Catalogue.h.

◆ odds()

double cbl::catalogue::Catalogue::odds ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_odds

Parameters
ithe object index
Returns
the odds of the i-th object

Definition at line 1926 of file Catalogue.h.

◆ operator+=() [1/2]

Catalogue cbl::catalogue::Catalogue::operator+= ( const Catalogue  cc)
inline

overloading of the += operator, to sum two catalogues

Parameters
ccobject of class Catalogue
Returns
object of class Catalogue

Definition at line 2864 of file Catalogue.h.

◆ operator+=() [2/2]

Catalogue cbl::catalogue::Catalogue::operator+= ( std::shared_ptr< Catalogue cc)
inline

overloading of the += operator, to sum two catalogues

Parameters
ccobject of class Catalogue
Returns
object of class Catalogue

Definition at line 2852 of file Catalogue.h.

◆ operator=() [1/2]

Catalogue& cbl::catalogue::Catalogue::operator= ( Catalogue &&  obj)
inlinenoexcept

move assignment for the Catalogue class

Parameters
objcatalogue to be moved
Returns
object of type Catalogue

Definition at line 805 of file Catalogue.h.

◆ operator=() [2/2]

Catalogue& cbl::catalogue::Catalogue::operator= ( const Catalogue obj)
inline

copy assignment for the Catalogue class

Parameters
objcatalogue to be copied
Returns
object of type Catalogue

Definition at line 786 of file Catalogue.h.

◆ operator[]()

std::shared_ptr<Object> cbl::catalogue::Catalogue::operator[] ( const size_t  i) const
inline

access the i-th Catalogue object

Parameters
iobject index
Returns
reference to Catalogue object

Definition at line 2243 of file Catalogue.h.

◆ Order()

void cbl::catalogue::Catalogue::Order ( const std::vector< int >  vv)

order the catalogue according to the input vector

Parameters
vvvector used to order the catalogue

Definition at line 1710 of file Catalogue.cpp.

◆ part()

std::vector<unsigned int> cbl::catalogue::Catalogue::part ( const int  index) const
inline

get the private member Catalogue::m_object[index]->m_part of ChainMeshCell

Parameters
indexthe object index
Returns
the vector of particles of the i-th object

Definition at line 2170 of file Catalogue.h.

◆ ra()

double cbl::catalogue::Catalogue::ra ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_ra

Parameters
ithe object index
Returns
the Right Ascension of the i-th object

Definition at line 1856 of file Catalogue.h.

◆ ra_tile()

double cbl::catalogue::Catalogue::ra_tile ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_ra_tile

Parameters
ithe object index
Returns
the Right Ascension of the i-th object

Definition at line 1870 of file Catalogue.h.

◆ radius()

double cbl::catalogue::Catalogue::radius ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_radius

Parameters
ithe object index
Returns
radius of the i-th object

Definition at line 2065 of file Catalogue.h.

◆ redshift()

double cbl::catalogue::Catalogue::redshift ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_redshift

Parameters
ithe object index
Returns
the redshift of the i-th object

Definition at line 1891 of file Catalogue.h.

◆ redshiftMax()

double cbl::catalogue::Catalogue::redshiftMax ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_redshiftMax

Parameters
ithe object index
Returns
the maximum redshift of the i-th object

Definition at line 1905 of file Catalogue.h.

◆ redshiftMin()

double cbl::catalogue::Catalogue::redshiftMin ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_redshiftMin

Parameters
ithe object index
Returns
the minimum redshift of the i-th object

Definition at line 1898 of file Catalogue.h.

◆ region() [1/2]

std::vector< long > cbl::catalogue::Catalogue::region ( ) const

get the values of the object regions

Returns
the object regions

Definition at line 423 of file Catalogue.cpp.

◆ region() [2/2]

long cbl::catalogue::Catalogue::region ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_region

Parameters
ithe object index
Returns
the index of the region of the i-th object

Definition at line 1954 of file Catalogue.h.

◆ region_list()

std::vector< long > cbl::catalogue::Catalogue::region_list ( ) const

get the list of regions in which the catalogue is divided

Returns
the list of regions

Definition at line 411 of file Catalogue.cpp.

◆ remove_object()

void cbl::catalogue::Catalogue::remove_object ( const int  index)
inline

remove an existing object

Parameters
indexthe index of the object to be removed

Definition at line 2699 of file Catalogue.h.

◆ remove_objects()

void cbl::catalogue::Catalogue::remove_objects ( const std::vector< bool >  index)

remove a set of existing objects

Parameters
indexvector of boolean variables

Definition at line 2494 of file Catalogue.cpp.

◆ replace_objects() [1/2]

void cbl::catalogue::Catalogue::replace_objects ( std::vector< std::shared_ptr< Object > >  sample)
inline

replace existing objects with new ones

Parameters
samplevector of pointers to objects of type Object

Definition at line 2683 of file Catalogue.h.

◆ replace_objects() [2/2]

template<typename T >
void cbl::catalogue::Catalogue::replace_objects ( std::vector< T >  sample)
inline

replace existing objects with new ones

Parameters
samplevector of objects of type T

Definition at line 2674 of file Catalogue.h.

◆ restoreComovingCoordinates()

void cbl::catalogue::Catalogue::restoreComovingCoordinates ( )

restore comoving coordinates

function to normalize comoving coordinates, that is it transforms (x/dc, y/dc, z/dc)) into (x, y, z)

Definition at line 1697 of file Catalogue.cpp.

◆ sample()

std::vector<std::shared_ptr<Object> > cbl::catalogue::Catalogue::sample ( ) const
inline

get the private member Catalogue::m_object

Returns
the vector containing the objects of the catalogue

Definition at line 1800 of file Catalogue.h.

◆ satellites()

std::vector<std::shared_ptr<Object> > cbl::catalogue::Catalogue::satellites ( const int  index) const
inline

get the private member Catalogue::m_object[ii]->m_satellites

Parameters
indexthe object index
Returns
the vector of pointers to the satellite objects of the i-th object

Definition at line 2163 of file Catalogue.h.

◆ set_field()

void cbl::catalogue::Catalogue::set_field ( const std::vector< std::string >  field)

set a private variable

Parameters
fieldvector containing the object fields

Definition at line 969 of file Catalogue.cpp.

◆ set_nearCells()

void cbl::catalogue::Catalogue::set_nearCells ( const int  index,
const std::vector< std::vector< unsigned int >>  nearCells = {} 
)
inline

set the private member ChainMeshCell::m_nearCells

Parameters
indexindex of the variable to set
nearCellsthe matrix of the cells near the i-th object

Definition at line 2537 of file Catalogue.h.

◆ set_part()

void cbl::catalogue::Catalogue::set_part ( const int  index,
const std::vector< unsigned int >  part = {} 
)
inline

set the private member ChainMeshCell::m_part

Parameters
indexindex of the variable to set
partthe vector of particles of the i-th object

Definition at line 2529 of file Catalogue.h.

◆ set_ra_dec_tile()

void cbl::catalogue::Catalogue::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

Parameters
RA_tiletile central R.A.
Dec_tiletile central Dec
inputUnitsinput units of R.A. and Dec

Definition at line 957 of file Catalogue.cpp.

◆ set_region()

void cbl::catalogue::Catalogue::set_region ( const std::vector< long >  region,
const int  nRegions = -1 
)

set a private variable

Parameters
regionvector containing the object regions
nRegionsthe total number of regions; if this parameter is \(<0\), its value will be set to the size of the region vector

Definition at line 933 of file Catalogue.cpp.

◆ set_region_number()

void cbl::catalogue::Catalogue::set_region_number ( const size_t  nRegions)

set the private variable m_nRegion

Parameters
nRegionsthe total number of regions

Definition at line 944 of file Catalogue.cpp.

◆ set_satellite()

void cbl::catalogue::Catalogue::set_satellite ( const int  index,
const std::shared_ptr< Object satellite = {} 
)
inline

set the private member HostHalo::m_satellites

Parameters
indexindex of the variable to set
satellitethe vector of shared pointers to satellite objects

Definition at line 2509 of file Catalogue.h.

◆ set_satellites()

void cbl::catalogue::Catalogue::set_satellites ( const int  index,
const std::vector< std::shared_ptr< Object >>  satellites = {} 
)
inline

set the private member HostHalo::m_satellites

Parameters
indexindex of the variable to set
satellitesthe vector of shared pointers to satellite objects

Definition at line 2519 of file Catalogue.h.

◆ set_var() [1/4]

void cbl::catalogue::Catalogue::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

Parameters
indexindex of the variable to set
var_namename of the variable
valuevariable value
cosmologyobject of class Cosmology, used to estimate the comoving distance from the given redshift
update_coordinatesif true the function cbl::catalogue::Object::set_redshift update the coordinates according to the redshift value

Definition at line 978 of file Catalogue.cpp.

◆ set_var() [2/4]

void cbl::catalogue::Catalogue::set_var ( const int  index,
const Var  var_name,
const int  value,
const cosmology::Cosmology  cosmology = {} 
)

set a private variable

Parameters
indexindex of the variable to set
var_namename of the variable
valuevariable value
cosmologyobject of class Cosmology

Definition at line 1204 of file Catalogue.cpp.

◆ set_var() [3/4]

void cbl::catalogue::Catalogue::set_var ( const Var  var_name,
const std::vector< double >  var,
const cosmology::Cosmology  cosmology = {},
const bool  update_coordinates = true 
)

set a private variable

Parameters
var_namename of the variable
varvector of variables
cosmologyobject of class Cosmology, used to estimate the comoving distance from the given redshift
update_coordinatesif true the function cbl::catalogue::Object::set_redshift update the coordinates according to the redshift value

Definition at line 1246 of file Catalogue.cpp.

◆ set_var() [4/4]

void cbl::catalogue::Catalogue::set_var ( const Var  var_name,
const std::vector< int >  var,
const cosmology::Cosmology  cosmology = {} 
)

set a private variable

Parameters
var_namename of the variable
varvector of variables
cosmologyobject of class Cosmology

Definition at line 1477 of file Catalogue.cpp.

◆ shear1()

double cbl::catalogue::Catalogue::shear1 ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_shear1

Parameters
ithe object index
Returns
the first shear component of the i-th object

Definition at line 1912 of file Catalogue.h.

◆ shear2()

double cbl::catalogue::Catalogue::shear2 ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_shear2

Parameters
ithe object index
Returns
the second shear component of the i-th object

Definition at line 1919 of file Catalogue.h.

◆ shuffle()

void cbl::catalogue::Catalogue::shuffle ( const int  seed)

shuffle objects in the catalogue

Parameters
seedthe seed for random number generation

pseudo-random numbers generator

Definition at line 2556 of file Catalogue.cpp.

◆ smooth()

shared_ptr< Catalogue > cbl::catalogue::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

defalut averaged quantities are X, Y, Z, RA, DEC, REDSHIFT, WEIGHT; others quantities must be passed trough a vector

Parameters
gridsizethe cell size
cosmologyobject of class Cosmology, used to estimate the comoving distance from the given redshift
varsthe vector of variable to average on
SUBthe number of sub-catalogue used to create the chain-mesh (use SUB>1 when there could be memory problems)
Returns
pointer to an object of class Catalogue

Definition at line 2125 of file Catalogue.cpp.

◆ sn()

double cbl::catalogue::Catalogue::sn ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_sn

Parameters
ithe object index
Returns
the signal-to-noise ratio of the i-th object

Definition at line 1884 of file Catalogue.h.

◆ sort()

void cbl::catalogue::Catalogue::sort ( const Var  var_name,
const bool  increasing = false 
)

bubble sort of a catalogue wrt a variable

Parameters
var_namethe name of the variable to use in order to sort the catalogue
increasingif true order from lower to higher, if false from higher to lower

Definition at line 2521 of file Catalogue.cpp.

◆ stats_var() [1/2]

std::vector< std::vector< double > > cbl::catalogue::Catalogue::stats_var ( const std::vector< Var var_name) const

get the mean, the median, the standard deviation, and the difference between the third and first quartiles of a vector of variables

Parameters
var_namethe variable name
Returns
vector of vectors containing the mean, the median, the standard deviation and the difference between the third and first quartiles of the input vector of variables

Definition at line 1530 of file Catalogue.cpp.

◆ stats_var() [2/2]

std::vector< double > cbl::catalogue::Catalogue::stats_var ( const Var  var_name) const

get the mean, the median, the standard deviation, and the difference between the third and first quartiles of a variable

Parameters
var_namethe variable name
Returns
vector containing the mean, the median, the standard deviation and the difference between the third and first quartiles of the variable

Definition at line 1521 of file Catalogue.cpp.

◆ sub_catalogue() [1/4]

Catalogue cbl::catalogue::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" 
)

find the Catalogue objects falling in the tiles of an input data catalogue, given the R.A.-Dec centres of the tiles.

The user must set in the input data catalogue the identification number of the tiles (cbl::catalogue::Var::_Region_) with cbl::catalogue::Catalogue::set_region() and the central R.A. and Dec (cbl::catalogue::Var::_TileRA_ / _TileDec_) of the tiles with cbl::catalogue::Catalogue::set_ra_dec_tile().

If requested, this function writes on file the coordinates of the edges of the tiles (in degrees). The tiles can be easily plotted with the plot function of matplotlib, e.g.:

import matplotlib.pyplot as plt
fig, ax = plt.subplots()
for i in range(len(ra_min)):
ax.plot([ra_min[i],ra_min[i]], [dec_min[i],dec_max[i]], color="k")
ax.plot([ra_max[i],ra_max[i]], [dec_min[i],dec_max[i]], color="k")
if (ra_min[i] < ra_max[i]):
ax.plot([ra_min[i],ra_max[i]], [dec_min[i],dec_min[i]], color="k")
ax.plot([ra_min[i],ra_max[i]], [dec_max[i],dec_max[i]], color="k")
else:
ax.plot([ra_max[i],0], [dec_min[i],dec_min[i]], color="k")
ax.plot([ra_max[i],0], [dec_max[i],dec_max[i]], color="k")
ax.plot([360,ra_min[i]], [dec_min[i],dec_min[i]], color="k")
ax.plot([360,ra_min[i]], [dec_max[i],dec_max[i]], color="k")
Author
Giorgio Lesci (giorg.nosp@m.io.l.nosp@m.esci2.nosp@m.@uni.nosp@m.bo.it)
Parameters
datainput catalogue
tile_width_RAthe width of each tile, in degrees (from side to side), along R.A. direction
tile_width_Decthe width of each tile, in degrees (from side to side), along Dec direction
write_tilesif true, write RA and Dec edges of the tiles on file (in degrees)
dir_tilesdirectory of the tile edges file
file_tilestile edges file
Returns
object of class Catalogue
Warning
This function cannot manage the situations in which a tile crosses one of the poles, i.e. if it has a side after the pole and the opposite side in the other side.

Definition at line 1913 of file Catalogue.cpp.

◆ sub_catalogue() [2/4]

Catalogue cbl::catalogue::Catalogue::sub_catalogue ( const mask_function  mask,
const bool  excl = false 
) const

create a sub-catalogue

Parameters
maskfunction of type std::function<bool(shared_ptr<Object>)> to flag objects
exclfalse → create a subcatalogue inside down-up; true → create a subcatalogue outside down-up
Returns
object of class Catalogue

Definition at line 1848 of file Catalogue.cpp.

◆ sub_catalogue() [3/4]

Catalogue cbl::catalogue::Catalogue::sub_catalogue ( const MaskObject mask,
const bool  excl = false 
) const

create a sub-catalogue

Parameters
maskobject of type cbl::catalogue::MaskObject
exclfalse → create a subcatalogue inside down-up; true → create a subcatalogue outside down-up
Returns
object of class Catalogue

Definition at line 1869 of file Catalogue.cpp.

◆ sub_catalogue() [4/4]

Catalogue cbl::catalogue::Catalogue::sub_catalogue ( const Var  var_name,
const double  down,
const double  up,
const bool  excl = false 
) const

create a sub-catalogue

Parameters
var_namethe variable name
downminimum variable used to cut the catalogue
upmaximum variable used to cut the catalogue
exclfalse → create a subcatalogue inside down-up; true → create a subcatalogue outside down-up
Returns
object of class Catalogue
Examples
catalogue.cpp.

Definition at line 1890 of file Catalogue.cpp.

◆ swap_objects()

void cbl::catalogue::Catalogue::swap_objects ( const int  ind1,
const int  ind2 
)

swap two existing objects

Parameters
ind1the index of the first object to swap
ind2the index of the second object to swap

Definition at line 2510 of file Catalogue.cpp.

◆ tot_mass()

double cbl::catalogue::Catalogue::tot_mass ( const int  i) const
inline

get the private member Catalogue::m_object[ii]->m_tot_mass

Parameters
ithe object index
Returns
the total mass of the i-th object (sum over all contributions)

Definition at line 2144 of file Catalogue.h.

◆ var() [1/2]

double cbl::catalogue::Catalogue::var ( const int  index,
const Var  var_name 
) const

get the value of the i-th object variable

Parameters
indexthe index of the object
var_namethe variable name
Returns
i-th variable Var
Examples
cleanVoidCatalogue.cpp.

Definition at line 449 of file Catalogue.cpp.

◆ var() [2/2]

std::vector< double > cbl::catalogue::Catalogue::var ( const Var  var_name) const

get the values of the object variables

Parameters
var_namethe variable name
Returns
the vector of the variable Var

Definition at line 727 of file Catalogue.cpp.

◆ var_distr()

void cbl::catalogue::Catalogue::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

Parameters
[in]var_namethe variable name
[out]_varvector of variables
[out]distvector of values of f(varibles)
[out]errvector of Poissonian errors of f(varibles)
[in]nbinnumber of bins
[in]lineartrue → linear binning; false → logarithmic binning
[in]file_outthe output file where the distribution is stored
[in]Volumethe volume of the catalogue
[in]normtrue → normalize to the number of objects; false → do not normalize
[in]V1the minimum limit of the distribution
[in]V2the maximum limit of the distribution
[in]bin_type"Linear" → dn/dvar; "Log10" → dn/dlog(var); "Log" → dn/dln(var)
[in]convolutionfalse → don't convolve the distribution; true → convolve the distribution with a gaussian function
[in]sigmaσ: the standard deviation of the gaussian function used to convolve the distribution

Definition at line 1544 of file Catalogue.cpp.

◆ var_int() [1/2]

int cbl::catalogue::Catalogue::var_int ( const int  index,
const Var  var_name 
) const

get the value of the i-th object integer variable

Parameters
indexthe index of the object
var_namethe variable name
Returns
i-th variable Var

Definition at line 697 of file Catalogue.cpp.

◆ var_int() [2/2]

std::vector< int > cbl::catalogue::Catalogue::var_int ( const Var  var_name) const

get the values of the object integer variables

Parameters
var_namethe variable name
Returns
the vector of the variable Var

Definition at line 716 of file Catalogue.cpp.

◆ volume()

double cbl::catalogue::Catalogue::volume ( const double  boxside = par::defaultDouble) const
inline

compute the catalogue's comoving volume

Parameters
boxsidelength of the side of the box
Returns
volume of the box

Definition at line 2359 of file Catalogue.h.

◆ vx()

double cbl::catalogue::Catalogue::vx ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_vx

Parameters
ithe object index
Returns
the velocity along the x direction of the i-th object

Definition at line 1828 of file Catalogue.h.

◆ vy()

double cbl::catalogue::Catalogue::vy ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_vy

Parameters
ithe object index
Returns
the velocity along the y direction of the i-th object

Definition at line 1835 of file Catalogue.h.

◆ vz()

double cbl::catalogue::Catalogue::vz ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_vz

Parameters
ithe object index
Returns
the velocity along the z direction of the i-th object

Definition at line 1842 of file Catalogue.h.

◆ weight()

double cbl::catalogue::Catalogue::weight ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_weight

Parameters
ithe object index
Returns
the weight of the i-th object

Definition at line 1947 of file Catalogue.h.

◆ weightedN()

double cbl::catalogue::Catalogue::weightedN ( ) const

get the total weight of the objects of the catalogue

Returns
the total weight

Definition at line 1753 of file Catalogue.cpp.

◆ weightedN_condition()

double cbl::catalogue::Catalogue::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

Parameters
var_namethe variable name
downminimum variable used to cut the catalogue
upmaximum variable used to cut the catalogue
exclfalse → count objects inside down-up; true → count objects outside down-up;
Returns
weighted number of objects following the condition

Definition at line 2248 of file Catalogue.cpp.

◆ write_comoving_coordinates()

void cbl::catalogue::Catalogue::write_comoving_coordinates ( const std::string  outputFile) const

write the comoving coordinates of the catalogue to an output file

Parameters
outputFilethe name of the output file

Definition at line 1765 of file Catalogue.cpp.

◆ write_data()

void cbl::catalogue::Catalogue::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 output file

Parameters
outputFilethe name of the output file
var_namevector containing the variable names to be written
sep[optional parameter] specifies the file separator, default is " " for retrocompatibility. Is strongly raccomanded to use standard values like: "\t" or ",".
header[optional parameter] string with the header of the file. Default is "".
Examples
cleanVoidCatalogue.cpp.

Definition at line 1804 of file Catalogue.cpp.

◆ write_obs_coordinates()

void cbl::catalogue::Catalogue::write_obs_coordinates ( const std::string  outputFile) const

write the polar coordinates of the catalogue to an output file

Parameters
outputFilethe name of the output file

Definition at line 1783 of file Catalogue.cpp.

◆ x_displacement()

double cbl::catalogue::Catalogue::x_displacement ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_x_displacement

Parameters
ithe object index
Returns
the displacement of the i-th object along the x-axis

Definition at line 1969 of file Catalogue.h.

◆ xx()

double cbl::catalogue::Catalogue::xx ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_xx

Parameters
ithe object index
Returns
the coordinate x of the i-th object

Definition at line 1807 of file Catalogue.h.

◆ y_displacement()

double cbl::catalogue::Catalogue::y_displacement ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_y_displacement

Parameters
ithe object index
Returns
the displacement of the i-th object along the x-axis

Definition at line 1977 of file Catalogue.h.

◆ yy()

double cbl::catalogue::Catalogue::yy ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_yy

Parameters
ithe object index
Returns
the coordinate y of the i-th object

Definition at line 1814 of file Catalogue.h.

◆ z_bins()

std::vector<double> cbl::catalogue::Catalogue::z_bins ( const int  nbin) const
inline

get the catalogue's redshift bins

Parameters
nbinnumber of bins on which to fit the redshift
Returns
private variable z_bins

Definition at line 2412 of file Catalogue.h.

◆ z_displacement()

double cbl::catalogue::Catalogue::z_displacement ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_z_displacement

Parameters
ithe object index
Returns
the displacement of the i-th object along the x-axis

Definition at line 1985 of file Catalogue.h.

◆ zz()

double cbl::catalogue::Catalogue::zz ( const int  i) const
inline

get the private member Catalogue::m_object[i]->m_zz

Parameters
ithe object index
Returns
the coordinate z of the i-th object

Definition at line 1821 of file Catalogue.h.


The documentation for this class was generated from the following files: