![]() |
CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
|
The class NumberCounts2D. More...
#include <NumberCounts2D.h>
Public Member Functions | |
Constructors/destructors | |
NumberCounts2D () | |
default constructor More... | |
virtual | ~NumberCounts2D ()=default |
default destructor | |
NumberCounts2D (const catalogue::Var var1, const BinType bin_type1, const catalogue::Var var2, const BinType bin_type2, const catalogue::Catalogue data, const size_t nbins1, const size_t nbins2, const double minVar1=par::defaultDouble, const double maxVar1=par::defaultDouble, const double minVar2=par::defaultDouble, const double maxVar2=par::defaultDouble, const double shift1=0.5, const double shift2=0.5, const glob::HistogramType hist_type=glob::HistogramType::_N_V_, const double fact=1.) | |
constructor More... | |
NumberCounts2D (const catalogue::Var var1, const catalogue::Var var2, const std::vector< double > vec_edges1, const std::vector< double > vec_edges2, const catalogue::Catalogue data, const glob::HistogramType hist_type=glob::HistogramType::_N_V_, const double fact=1.) | |
constructor More... | |
Member functions to measure the number counts | |
void | measure (const ErrorType errorType=ErrorType::_Poisson_, const std::string dir_output_resample=par::defaultString, const int nResamplings=0, const int seed=3213, const bool conv=false, const double sigma=0.) override |
measure the number counts More... | |
void | compute_covariance (const std::vector< std::shared_ptr< glob::Histogram >> histo, const bool JK) override |
compute the covariance matrix More... | |
std::shared_ptr< data::Data > | Gaussian_smoothing (const double sigma) override |
apply a Gaussian filter to the distribution More... | |
Input/Output member functions (customized in all the derived classes) | |
void | write (const std::string dir=par::defaultString, const std::string file=par::defaultString, const int rank=0) const override |
write the measured number counts More... | |
void | write_covariance (const std::string dir, const std::string file) const override |
write measured covariance matrix More... | |
![]() | |
NumberCounts ()=default | |
default constructor | |
virtual | ~NumberCounts ()=default |
default destructor | |
void | set_data (const catalogue::Catalogue data) |
add a data catalogue More... | |
std::shared_ptr< catalogue::Catalogue > | catalogue () |
function to get the protected member m_data More... | |
std::shared_ptr< glob::Histogram > | histogram () |
return the binned counts More... | |
glob::HistogramType | HistogramType () |
return the type of histogram normalization More... | |
double | fact () |
return the normalization factor 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 | |
Protected member functions to measure the number counts | |
std::shared_ptr< data::Data > | m_measurePoisson () override |
measure the number counts with Poisson errors More... | |
std::shared_ptr< data::Data > | m_measureJackknife (const std::string dir_output_resample=par::defaultString) override |
measure the number counts with Jackknife covariance matrix More... | |
std::shared_ptr< data::Data > | m_measureBootstrap (const std::string dir_output_resample=par::defaultString, const int nResamplings=0, const int seed=3213) override |
measure the number counts with Bootstrap covariance matrix More... | |
Protected member functions to measure the number counts |
Protected Attributes | |
catalogue::Var | m_Var1 |
the first catalogue variable to bin | |
catalogue::Var | m_Var2 |
the second catalogue variable to bin | |
![]() | |
std::shared_ptr< catalogue::Catalogue > | m_data |
input data catalogue | |
glob::HistogramType | m_HistogramType |
the histogram type | |
double | m_fact |
the normalization factor | |
std::shared_ptr< glob::Histogram > | m_histogram |
number counts type | |
![]() | |
std::shared_ptr< data::Data > | m_dataset |
the dataset of the measure | |
The class NumberCounts2D.
"Headers/NumberCounts2D.h"
This is the base class used to measure the number counts of one variable
Definition at line 67 of file NumberCounts2D.h.
|
inline |
cbl::measure::numbercounts::NumberCounts2D::NumberCounts2D | ( | const catalogue::Var | var1, |
const BinType | bin_type1, | ||
const catalogue::Var | var2, | ||
const BinType | bin_type2, | ||
const catalogue::Catalogue | data, | ||
const size_t | nbins1, | ||
const size_t | nbins2, | ||
const double | minVar1 = par::defaultDouble , |
||
const double | maxVar1 = par::defaultDouble , |
||
const double | minVar2 = par::defaultDouble , |
||
const double | maxVar2 = par::defaultDouble , |
||
const double | shift1 = 0.5 , |
||
const double | shift2 = 0.5 , |
||
const glob::HistogramType | hist_type = glob::HistogramType::_N_V_ , |
||
const double | fact = 1. |
||
) |
constructor
var1 | the first variable type |
bin_type1 | the first bin type |
var2 | the second variable type |
bin_type2 | the second bin type |
data | object of class Catalogue |
nbins1 | the number of bins for the first variable |
nbins2 | the number of bins for the second variable |
minVar1 | minimum range for the first variable |
maxVar1 | maximmum range for the first variable |
minVar2 | minimum range for the second variable |
maxVar2 | maximmum range for the second variable |
shift1 | bin shift for the first variable |
shift2 | bin shift for the second variable |
hist_type | the type of histogram |
fact | factor used to normalized the distribution |
Definition at line 47 of file NumberCounts2D.cpp.
cbl::measure::numbercounts::NumberCounts2D::NumberCounts2D | ( | const catalogue::Var | var1, |
const catalogue::Var | var2, | ||
const std::vector< double > | vec_edges1, | ||
const std::vector< double > | vec_edges2, | ||
const catalogue::Catalogue | data, | ||
const glob::HistogramType | hist_type = glob::HistogramType::_N_V_ , |
||
const double | fact = 1. |
||
) |
constructor
var1 | the first variable type |
var2 | the second variable type |
vec_edges1 | the bin edges for var1 |
vec_edges2 | the bin edges for var2 |
data | object of class Catalogue |
hist_type | the type of histogram |
fact | factor used to normalized the distribution |
Definition at line 71 of file NumberCounts2D.cpp.
|
overridevirtual |
compute the covariance matrix
histo | vector containing the measures used to compute the covariance matrix |
JK | true → compute the jackknife covariance matrix; false compute the standard covariance matrix |
Reimplemented from cbl::measure::numbercounts::NumberCounts.
Definition at line 254 of file NumberCounts2D.cpp.
|
overridevirtual |
apply a Gaussian filter to the distribution
σ | of the Gaussian kernel |
Reimplemented from cbl::measure::numbercounts::NumberCounts.
Definition at line 295 of file NumberCounts2D.cpp.
|
overrideprotectedvirtual |
measure the number counts with Bootstrap covariance matrix
dir_output_resample | output directory of the resampling correlation functions |
nResamplings | number of resampling used for bootstrap |
seed | the seed for random number generation |
Reimplemented from cbl::measure::numbercounts::NumberCounts.
Definition at line 189 of file NumberCounts2D.cpp.
|
overrideprotectedvirtual |
measure the number counts with Jackknife covariance matrix
dir_output_resample | output directory of the resampling correlation functions |
Reimplemented from cbl::measure::numbercounts::NumberCounts.
Definition at line 151 of file NumberCounts2D.cpp.
|
overrideprotectedvirtual |
measure the number counts with Poisson errors
Reimplemented from cbl::measure::numbercounts::NumberCounts.
Definition at line 98 of file NumberCounts2D.cpp.
|
overridevirtual |
measure the number counts
errorType | type of error |
dir_output_resample | output directory of the resampling correlation functions |
nResamplings | number of resampling used for bootstrap |
seed | the seed for random number generation |
conv | true → compute the Gaussian convolvolution of the distribution; false → do not convolve |
sigma | σ of the Gaussian kernel |
Reimplemented from cbl::measure::numbercounts::NumberCounts.
Definition at line 231 of file NumberCounts2D.cpp.
|
overridevirtual |
write the measured number counts
dir | output directory |
file | output file |
rank | cpu index (for MPI usage) |
Reimplemented from cbl::measure::numbercounts::NumberCounts.
Definition at line 272 of file NumberCounts2D.cpp.
|
overridevirtual |
write measured covariance matrix
dir | output directory |
file | output file |
Reimplemented from cbl::measure::numbercounts::NumberCounts.
Definition at line 286 of file NumberCounts2D.cpp.