![]() |
CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
|
The class StackedDensityProfile. More...
#include <StackedDensityProfile.h>
Public Member Functions | |
Constructors/destructors | |
StackedDensityProfile ()=default | |
default constructor | |
virtual | ~StackedDensityProfile ()=default |
default destructor | |
StackedDensityProfile (cosmology::Cosmology cosm, const catalogue::Catalogue gal_cat, const catalogue::Catalogue clu_cat, const double delta_redshift, std::vector< double > z_binEdges, std::vector< std::vector< double >> proxy_binEdges, const double rad_min, const double rad_max, const int nRad, const bool log_rad, const double SN_min, const double pix_size, const std::vector< std::vector< double >> multiplicative_calibration_stats={}, const std::vector< std::vector< double >> multiplicative_calibration_zEdges={}, const double rad_alpha=1., const double obs_gamma=1.) | |
constructor performing the stacking by reading a .fits galaxy file and a cluster file More... | |
Member functions to measure the stacked profile | |
void | set_colour_selection (const std::string colour_space, const int z_bin, const double C1, const double C2, const double C3, const double C4, const double z_min) |
Set the colour selection in the i-th cluster redshift bin. More... | |
void | set_colour_selection (const std::string colour_space, const double C1, const double C2, const double C3, const double C4, const double z_min) |
Set the colour selection in all cluster redshift bins. More... | |
void | set_zphot_selection (const int z_bin, const double deltaz, const double zgal_min, const double zgal_max, const double ODDS_min) |
Set the redshift selection in the i-th cluster redshift bin. More... | |
void | set_zphot_selection (const double deltaz, const double zgal_min, const double zgal_max, const double ODDS_min) |
Set the redshift selection in all cluster redshift bins. More... | |
void | set_logic_selection (const int z_bin, const std::string sel) |
Set the logic operator linking redshift and colour selections in the i-th cluster redshift bin. More... | |
void | set_logic_selection (const std::string sel) |
Set the logic operator linking redshift and colour selections in the all the cluster redshift bins. More... | |
void | measure (const std::vector< int > z_proxy_bin, const std::string output_dir, const std::string output_file_root, const ErrorType errorType=ErrorType::_Bootstrap_, const int n_resampling=10000, const bool write_background=false) |
measure the stacked profiles in all the bins of redshift and mass proxy, providing in output the stacked profile in the redshift and proxy bins chosen through the parameter z_proxy_bin. More... | |
input/output member functions (customized in all the derived classes) | |
void | write (const std::string dir, const std::string file) |
write on file the measure in a given bin of redshift and mass proxy More... | |
![]() | |
Measure ()=default | |
default constructor | |
virtual | ~Measure ()=default |
default destructor | |
virtual std::shared_ptr< data::Data > | dataset () const |
get the protected member dataset More... | |
Protected member functions and members to measure the cluster stacked density profile | |
bool | m_write_background |
if true, create the folder containing the background galaxies indices | |
std::shared_ptr< cosmology::Cosmology > | m_cosm |
input cosmology | |
std::shared_ptr< catalogue::Catalogue > | m_galData |
input galaxy catalogue | |
std::shared_ptr< catalogue::Catalogue > | m_cluData |
input cluster catalogue | |
std::vector< bool(StackedDensityProfile::*)(const int, const int)> | m_colourSel |
vector of pointers to the colour selection function s | |
std::vector< bool(StackedDensityProfile::*)(const int, const int, const int)> | m_photzSel |
vector of pointers to the photo-z selection functions | |
std::vector< std::function< bool(const std::vector< bool >)> > | m_logicSel |
logic operator between colour and photo-z selection | |
std::vector< bool > | m_isSet_colourSel |
vector for checking if the colour selection is set in all the z bins | |
std::vector< bool > | m_isSet_photzSel |
vector for checking if the photo-z selection is set in all the z bins | |
std::vector< bool > | m_isSet_logicSel |
vector for checking if the logic selection linking colour and z selections is set in all the z bins | |
std::vector< std::vector< int > > | m_background_idx_z |
vector of indices of the background galaxies selected through the redshift selection | |
std::vector< std::vector< int > > | m_background_idx_colour |
vector of indices of the background galaxies selected through the colour selection | |
bool | m_measure_is_read |
bool stating if the measure is read from file | |
double | m_delta_redshift |
minimum interval between the cluster and the source redshifts | |
double | m_SN_min |
minimum signal-to-noise | |
double | m_pix_size |
pixel size (in deg) | |
std::vector< std::vector< double > > | m_m_calib |
the multiplicative calibration bias mean and standard deviation in the z bins | |
std::vector< std::vector< double > > | m_m_calib_zEdges |
the redshift edges within which the multiplicative calibration bias is evaluated | |
double | m_n_resampling |
number of regions for the resampling | |
std::vector< std::string > | m_inputs_to_str |
vector of the inputs stored as strings | |
double | m_rad_alpha |
slope for the observable weighted mean | |
double | m_obs_gamma |
gamma slope for lensing-weighted observables | |
std::vector< std::vector< double > > | m_colour_sel_pars |
the parameters for the colour selection | |
std::vector< std::vector< double > > | m_zphot_sel_pars |
the parameters for the redshift selection | |
std::vector< std::vector< std::string > > | m_logic_sel_par |
the logic selection linking redshift and colour selections | |
std::vector< double > | m_rad_arr |
radius bin edges | |
std::vector< double > | m_z_binEdges |
phot-z bin edges | |
std::vector< std::vector< double > > | m_proxy_binEdges |
mass proxy bin edges | |
std::vector< std::vector< int > > | m_first |
a "first" for each pixel | |
std::vector< std::vector< int > > | m_last |
a "last" for each pixel | |
std::vector< int > | m_next |
a "next" for each galaxy | |
std::vector< std::vector< double > > | m_nClu_inBin |
number of clusters in a bin of z and mass proxy | |
std::vector< int > | m_ngal_arr |
number of galaxies for annulus | |
std::vector< std::vector< std::vector< std::vector< int > > > > | m_single_ngal_arr |
number of galaxies for annulus for cluster | |
std::vector< std::vector< std::vector< int > > > | m_stacked_ngal_arr |
stacked number of galaxies for annulus | |
std::vector< double > | m_deltasigma_t |
tangential surface density | |
std::vector< std::vector< std::vector< std::vector< double > > > > | m_single_deltasigma_t |
tangential surface density, stored for each single cluster | |
std::vector< std::vector< std::vector< double > > > | m_stacked_deltasigma_t |
tangential stacked surface density | |
std::vector< std::vector< std::vector< double > > > | m_stacked_deltasigma_t_err |
tangential stacked surface density error | |
std::vector< double > | m_deltasigma_x |
cross surface density | |
std::vector< std::vector< std::vector< std::vector< double > > > > | m_single_deltasigma_x |
cross surface density, stored for each single cluster | |
std::vector< std::vector< std::vector< double > > > | m_stacked_deltasigma_x |
cross stacked surface density | |
std::vector< std::vector< std::vector< double > > > | m_stacked_deltasigma_x_err |
cross stacked surface density error | |
std::vector< double > | m_deltasigma_err |
error on the surface density | |
std::vector< std::vector< std::vector< std::vector< double > > > > | m_single_deltasigma_err |
error on the surface density, stored for each single cluster | |
std::vector< std::vector< std::vector< double > > > | m_stacked_deltasigma_err |
error on the stacked surface density | |
std::vector< double > | m_wetasquareSum |
wetasquareSum | |
std::vector< std::vector< std::vector< double > > > | m_stacked_wetasquareSum |
stacked wetasquareSum | |
std::vector< double > | m_wSum |
wSum | |
std::vector< std::vector< std::vector< double > > > | m_stacked_wSum |
stacked wSum | |
std::vector< double > | m_wetaSum |
wetaSum | |
std::vector< std::vector< std::vector< double > > > | m_stacked_wetaSum |
stacked wetaSum | |
std::vector< double > | m_deltasigmaSum |
deltasigmaSum | |
std::vector< std::vector< std::vector< double > > > | m_stacked_deltasigmaSum |
stacked deltasigmaSum | |
std::vector< std::vector< std::vector< double > > > | m_stacked_deltasigma_wei |
stacked deltasigma_wei | |
std::vector< double > | m_rad_eff_arr |
effective radii | |
std::vector< std::vector< std::vector< double > > > | m_stacked_rad_eff_arr |
stacked effective radii | |
std::vector< double > | m_rad_sigma_arr |
effective radii errors | |
std::vector< std::vector< std::vector< double > > > | m_stacked_rad_sigma_arr |
stacked effective radii errors | |
double | m_sigma_fac |
constant factor for lensing quantities (c*c/(4piG) in M_sun/Mpc) | |
double | m_ra_start |
starting RA | |
double | m_dec_start |
starting Dec | |
std::vector< int > | m_nPix |
number of pixels in RA and Dec | |
std::vector< std::vector< double > > | m_proxy_eff |
effective mass proxy linked to the stacked signal | |
std::vector< std::vector< double > > | m_proxy_sigma |
error on the effective mass proxy linked to the stacked signal | |
std::vector< std::vector< double > > | m_z_eff |
effective redshift linked to the stacked signal | |
std::vector< std::vector< double > > | m_z_sigma |
error on the effective redshift linked to the stacked signal | |
std::vector< std::vector< std::vector< std::vector< double > > > > | m_deltasigma_cov_matr |
Bootstrap covariance matrix for the stacked signal. | |
void | m_set_multiplicative_calib () |
set the multiplicative shear calibration, m | |
bool | m_colourSelection_gri (const int i_gal, const int clu_zbin) |
colour selection function in the colour-colour space ( \(r-i\)) vs ( \(g-r\)) More... | |
bool | m_photzSelection (const int i_clu, const int i_gal, const int clu_zbin) |
redshift selection function More... | |
void | m_check_catalogue_variables () |
check if all the necessary variables in the galaxy and cluster catalogues are set | |
void | m_resize (const double rad_min, const double rad_max, const int nRad, const bool log_rad) |
resize the private member arrays More... | |
void | m_linked_list () |
linked galaxy list | |
void | m_add_galaxy (const int i_gal, const int clu_index, const double coscludec, const double clu_dist) |
add galaxies to profiles More... | |
void | m_profile (const int clu_index) |
compute a single cluster profile More... | |
void | m_stacker () |
perform the stacking | |
std::shared_ptr< data::Data > | m_make_bootstrap (const std::vector< int > z_proxy_bin) |
bootstrap resampling to retrieve the covariance matrix of the stacked signal, providing the stacked profile measurement in output More... | |
bool | m_check_file (const std::string checked_file, const std::vector< int > z_proxy_bin) |
check if the results obtained from the stacking have already been written to a file More... | |
void | m_write (const std::string output_dir, const std::string output_file) |
write the results obtained from the stacking on file More... | |
Additional Inherited Members | |
![]() | |
std::shared_ptr< data::Data > | m_dataset |
the dataset of the measure | |
The class StackedDensityProfile.
"Headers/StackedDensityProfile.h"
Class used to measure the stacked surface density profiles of galaxy clusters, i.e. \(\Delta\Sigma(r)\) [ \(h\) M \(_\odot\)/pc \(^2\)]. Cosmological units are forced.
Definition at line 70 of file StackedDensityProfile.h.
cbl::measure::stackprofile::StackedDensityProfile::StackedDensityProfile | ( | cosmology::Cosmology | cosm, |
const catalogue::Catalogue | gal_cat, | ||
const catalogue::Catalogue | clu_cat, | ||
const double | delta_redshift, | ||
std::vector< double > | z_binEdges, | ||
std::vector< std::vector< double >> | proxy_binEdges, | ||
const double | rad_min, | ||
const double | rad_max, | ||
const int | nRad, | ||
const bool | log_rad, | ||
const double | SN_min, | ||
const double | pix_size, | ||
const std::vector< std::vector< double >> | multiplicative_calibration_stats = {} , |
||
const std::vector< std::vector< double >> | multiplicative_calibration_zEdges = {} , |
||
const double | rad_alpha = 1. , |
||
const double | obs_gamma = 1. |
||
) |
constructor performing the stacking by reading a .fits galaxy file and a cluster file
cosm | cosmological model |
gal_cat | catalogue of galaxies |
clu_cat | catalogue of galaxy clusters |
delta_redshift | minimum interval between the cluster and the source redshifts. That is, it is \(\Delta_z\) in the equation \(z_g>z_c+\Delta_z\), where \(z_g\) and \(z_c\) are the galaxy and cluster mean redshifts, respectively. This condition must be satisfied along with \(p(z)\) or/and color conditions. |
z_binEdges | redshift bin edges |
proxy_binEdges | proxy bin edges |
rad_min | minimum distance from the cluster centre considered (in Mpc/h) |
rad_max | maximum distance from the cluster centre considered (in Mpc/h) |
nRad | number of cluster radial bins |
log_rad | if true, the radial bins are logarithmically spaced. Otherwise, a linear binning is used |
SN_min | minimum signal-to-noise considered for the clusters |
pix_size | pixel size in deg |
multiplicative_calibration_stats | a vector of vectors containing mean and standard deviation of the multiplicative shear calibration parameter, usually denoted as m, in all the redshift bins where it is evaluated. If not provided, the galaxy-by-galaxy values of m are used |
multiplicative_calibration_zEdges | vector of vectors containing the lower and upper edge of the redshift bins for each estimate of the multiplicative shear calibration parameter, m |
rad_alpha | slope for the observable weighted mean |
obs_gamma | gamma slope for lensing-weighted observables |
Cluster stacked density profile
Definition at line 882 of file StackedDensityProfile.cpp.
|
protected |
add galaxies to profiles
i_gal | galaxy index |
clu_index | cluster index |
coscludec | cos of cluster Dec |
clu_dist | cluster angular diameter distance |
Definition at line 275 of file StackedDensityProfile.cpp.
|
protected |
check if the results obtained from the stacking have already been written to a file
checked_file | the file to be checked |
z_proxy_bin | vector containing the redshift and proxy bins to be stored, respectively |
Definition at line 538 of file StackedDensityProfile.cpp.
|
protected |
colour selection function in the colour-colour space ( \(r-i\)) vs ( \(g-r\))
i_gal | galaxy index |
clu_zbin | index of the redshift bin of the lensing cluster |
Definition at line 212 of file StackedDensityProfile.cpp.
|
protected |
bootstrap resampling to retrieve the covariance matrix of the stacked signal, providing the stacked profile measurement in output
z_proxy_bin | vector containing the redshift and proxy bins to be stored, respectively |
Definition at line 477 of file StackedDensityProfile.cpp.
|
protected |
redshift selection function
i_clu | cluster index |
i_gal | galaxy index |
clu_zbin | index of the redshift bin of the lensing cluster |
Definition at line 225 of file StackedDensityProfile.cpp.
|
protected |
compute a single cluster profile
clu_index | cluster index |
Definition at line 346 of file StackedDensityProfile.cpp.
|
protected |
resize the private member arrays
rad_min | minimum distance from the cluster centre considered |
rad_max | maximum distance from the cluster centre considered |
nRad | number of cluster radial bins |
log_rad | if true radial bins logarithmically spaced |
Definition at line 57 of file StackedDensityProfile.cpp.
|
protected |
write the results obtained from the stacking on file
output_dir | output directory |
output_file | output file |
Definition at line 636 of file StackedDensityProfile.cpp.
void cbl::measure::stackprofile::StackedDensityProfile::measure | ( | const std::vector< int > | z_proxy_bin, |
const std::string | output_dir, | ||
const std::string | output_file_root, | ||
const ErrorType | errorType = ErrorType::_Bootstrap_ , |
||
const int | n_resampling = 10000 , |
||
const bool | write_background = false |
||
) |
measure the stacked profiles in all the bins of redshift and mass proxy, providing in output the stacked profile in the redshift and proxy bins chosen through the parameter z_proxy_bin.
Note that with this function the stacking is performed in all the redshift and proxy bins, and the results are written on file. In the first line of the header of such file, all the parameters used for the stacking (colour and redshift selections, binnings, ...) are written, as well as the cosmological parameters. If such a file has already been written, the code reads it instead of performing again the stacking procedure.
In addition, this function creates the following folders:
z_proxy_bin | vector containing the indices of the redshift and proxy bins to be stored, respectively |
output_dir | output directory for the output_file |
output_file_root | root name of the output file, which contains the stacked profiles in all the redshift and mass proxy bins |
errorType | the type of error assigned to the density profile (only the diagonal of the covariance matrix is considered) |
n_resampling | number of resampling regions for the bootstrap procedure used to evaluate the uncertainty on \(\Delta\Sigma(r)\) |
write_background | if true, create the background_galaxies/ folder. WARNING: this folder may be very large |
Definition at line 836 of file StackedDensityProfile.cpp.
void cbl::measure::stackprofile::StackedDensityProfile::set_colour_selection | ( | const std::string | colour_space, |
const double | C1, | ||
const double | C2, | ||
const double | C3, | ||
const double | C4, | ||
const double | z_min | ||
) |
Set the colour selection in all cluster redshift bins.
colour_space | the colour space; possibilities are: "ri_gr" ( \(r-i\) vs \(g-r\)) |
C1 | for example, for the colour space \((r-i)\) vs \((g-r)\), it is \(C_1\) in \( (g-r)<C_1 \) |
C2 | for example, for the colour space \((r-i)\) vs \((g-r)\), it is \(C_2\) in \( (r-i)>C_2 \) |
C3 | for example, for the colour space \((r-i)\) vs \((g-r)\), it is \(C_3\) in \( (r-i)>C_3*(g-r)+C_4 \) |
C4 | for example, for the colour space \((r-i)\) vs \((g-r)\), it is \(C_4\) in \( (r-i)>C_3*(g-r)+C_4 \) |
z_min | minimum redshift of the selected galaxies |
Definition at line 767 of file StackedDensityProfile.cpp.
void cbl::measure::stackprofile::StackedDensityProfile::set_colour_selection | ( | const std::string | colour_space, |
const int | z_bin, | ||
const double | C1, | ||
const double | C2, | ||
const double | C3, | ||
const double | C4, | ||
const double | z_min | ||
) |
Set the colour selection in the i-th cluster redshift bin.
colour_space | the colour space; possibilities are: "ri_gr" ( \(r-i\) vs \(g-r\)) |
z_bin | index of the cluster redshift bin |
C1 | for example, for the colour space \((r-i)\) vs \((g-r)\), it is \(C_1\) in \( (g-r)<C_1 \) |
C2 | for example, for the colour space \((r-i)\) vs \((g-r)\), it is \(C_2\) in \( (r-i)>C_2 \) |
C3 | for example, for the colour space \((r-i)\) vs \((g-r)\), it is \(C_3\) in \( (r-i)>C_3*(g-r)+C_4 \) |
C4 | for example, for the colour space \((r-i)\) vs \((g-r)\), it is \(C_4\) in \( (r-i)>C_3*(g-r)+C_4 \) |
z_min | minimum redshift of the selected galaxies |
Definition at line 749 of file StackedDensityProfile.cpp.
void cbl::measure::stackprofile::StackedDensityProfile::set_logic_selection | ( | const int | z_bin, |
const std::string | sel | ||
) |
Set the logic operator linking redshift and colour selections in the i-th cluster redshift bin.
z_bin | index of the cluster redshift bin |
sel | "and" or "or" |
Definition at line 797 of file StackedDensityProfile.cpp.
void cbl::measure::stackprofile::StackedDensityProfile::set_logic_selection | ( | const std::string | sel | ) |
Set the logic operator linking redshift and colour selections in the all the cluster redshift bins.
sel | "and" or "or" |
Definition at line 828 of file StackedDensityProfile.cpp.
void cbl::measure::stackprofile::StackedDensityProfile::set_zphot_selection | ( | const double | deltaz, |
const double | zgal_min, | ||
const double | zgal_max, | ||
const double | ODDS_min | ||
) |
Set the redshift selection in all cluster redshift bins.
deltaz | additive term, \(\Delta z\), to the cluster redshift, i.e. how much the minimum galaxy redshift, \(z_{\rm g,\,min}\), (in the tail of the relative posterior) must be higher than the cluster redshift, \(z_c\), that is \(z_{\rm g,\,min} > z_c+\Delta z\) |
zgal_min | minimum value for the galaxy mean redshift |
zgal_max | maximum value for the galaxy mean redshift |
ODDS_min | minimum value for the ODDS parameter |
Definition at line 789 of file StackedDensityProfile.cpp.
void cbl::measure::stackprofile::StackedDensityProfile::set_zphot_selection | ( | const int | z_bin, |
const double | deltaz, | ||
const double | zgal_min, | ||
const double | zgal_max, | ||
const double | ODDS_min | ||
) |
Set the redshift selection in the i-th cluster redshift bin.
z_bin | index of the cluster redshift bin |
deltaz | additive term, \(\Delta z\), to the cluster redshift, i.e. how much the minimum galaxy redshift, \(z_{\rm g,\,min}\), (in the tail of the relative posterior) must be higher than the cluster redshift, \(z_c\), that is \(z_{\rm g,\,min} > z_c+\Delta z\) |
zgal_min | minimum value for the galaxy mean redshift |
zgal_max | maximum value for the galaxy mean redshift |
ODDS_min | minimum value for the ODDS parameter |
Definition at line 775 of file StackedDensityProfile.cpp.
void cbl::measure::stackprofile::StackedDensityProfile::write | ( | const std::string | dir, |
const std::string | file | ||
) |
write on file the measure in a given bin of redshift and mass proxy
dir | output directory |
file | name of the output file |
Definition at line 870 of file StackedDensityProfile.cpp.