![]() |
CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
|
The class SuperSampleCovariance. More...
#include <SuperSampleCovariance.h>
Public Member Functions | |
Constructors/destructors | |
| SuperSampleCovariance (cbl::cosmology::Cosmology cosm, const std::vector< cbl::cosmology::CosmologicalParameter > cosmo_param, const std::vector< double > redshift_edges, const double area, const std::string method_Pk="EisensteinHu", const double delta_z=0.001, const double precision=10, const bool NL=false, const bool store_output=false) | |
| Default constructor, used to compute the \(S_{ij}\) matrix, assuming top-hat window functions. The top-hat window function can be used when the redshift errors are smaller than the width of the redshift bins. More... | |
| SuperSampleCovariance (cbl::cosmology::Cosmology cosm, const std::vector< cbl::cosmology::CosmologicalParameter > cosmo_param, const double area, const std::vector< double > W_mean, const std::vector< double > W_std, const std::string method_Pk="EisensteinHu", const double delta_z=0.001, const double precision=10, const bool NL=false, const bool store_output=false) | |
| Default constructor, used to compute the \(S_{ij}\) matrix, assuming top-hat window functions. The top-hat window function can be used when the redshift errors are smaller than the width of the redshift bins. More... | |
| virtual | ~SuperSampleCovariance ()=default |
| default destructor | |
Member functions to compute \f$S_{ij}\f$ | |
| std::vector< std::vector< double > > | operator() (std::vector< double > ¶meter) const |
| get \(S_{ij}\) More... | |
Member functions to get the private members of the class | |
| std::vector< std::vector< double > > | get_window_function () |
| return the window functions More... | |
| int | Sij_dimension () |
| return the dimension of the Sij matrix More... | |
Member functions that write on file the products of the class | |
| void | write_window_function (const std::string dir, const std::string file) |
| write the window functions on file More... | |
| void | write_Sij (const std::string dir, const std::string file) |
| Write the \(S_{ij}\) matrix on file. More... | |
Protected Member Functions | |
| void | m_compute_topHat_window (const double delta_z, const std::vector< double > redshift_edges) |
| compute the top-hat window functions in the redshift bins More... | |
| void | m_compute_gaussian_window (const double delta_z, const std::vector< double > W_mean, const std::vector< double > W_std) |
| compute the Gaussian window functions in the redshift bins More... | |
| std::vector< std::vector< double > > | m_compute_Sij (cbl::cosmology::Cosmology cosmo) const |
| compute the S_ij matrix More... | |
Protected Attributes | |
| std::vector< std::shared_ptr< statistics::Model > > | m_response_func |
| pointer to the response function of the probe | |
| std::shared_ptr< cosmology::Cosmology > | m_cosmo |
| pointer to the Cosmology object | |
| std::vector< cbl::cosmology::CosmologicalParameter > | m_cosmo_param |
| names of the cosmological parameters | |
| std::string | m_method_Pk |
| method used to compute the power spectrum | |
| bool | m_NL |
| linear o non-linear power-spectrum | |
| bool | m_store_output |
| store Pk output | |
| int | m_nbins |
| number of redshift bins | |
| int | m_nsteps |
| number of redshift steps where the S matrix is computed | |
| std::vector< double > | m_redshifts |
| vector containing the redshift values where the S matrix is computed | |
| double | m_area |
| survey area in steradians | |
| double | m_precision |
| precision of the \(log k\) array | |
| std::vector< std::vector< double > > | m_windows |
| window functions in the redshift bins | |
The class SuperSampleCovariance.
"Headers/SuperSampleCovariance.h"
This is the base class used to manage the super-sample covariance matrix
Definition at line 77 of file SuperSampleCovariance.h.
| cbl::cosmology::SuperSampleCovariance::SuperSampleCovariance | ( | cbl::cosmology::Cosmology | cosm, |
| const std::vector< cbl::cosmology::CosmologicalParameter > | cosmo_param, | ||
| const std::vector< double > | redshift_edges, | ||
| const double | area, | ||
| const std::string | method_Pk = "EisensteinHu", |
||
| const double | delta_z = 0.001, |
||
| const double | precision = 10, |
||
| const bool | NL = false, |
||
| const bool | store_output = false |
||
| ) |
Default constructor, used to compute the \(S_{ij}\) matrix, assuming top-hat window functions. The top-hat window function can be used when the redshift errors are smaller than the width of the redshift bins.
Given two redshift bins, labelled as \(i\) and \(j\), \(S_{ij}\) is:
\( S_{ij} = \frac{1}{\Omega} \frac{1}{2\pi^2} \int {\rm d} k\,\, k^2 P(k) \frac{U_i(k)}{I_i} \frac{U_j(k)}{I_j}, \)
where \(\Omega\) is the survey area, \(P(k)\) is the power spectrum, and \(U_i(k)\) and \(I_i\) are expressed as:
\( U_i(k) = \int {\rm d} V_i \,\, W^2_i g(z_j) j_0(kr_j), \)
\( I_i = \int {\rm d} V_i \,\, W^2_i, \)
where \(V_i\) is the comoving volume within the \(i\)-th redshift bin, \(g\) is the growth factor, \(j_0\) the Bessel spherical function, and \(W_i\) is the window function.
Physical units are forced.
| cosm | the Cosmology object |
| cosmo_param | the cosmological parameters set in the modelling (useful only if a modelling is performed) |
| redshift_edges | redshift bin edges |
| area | effective area of the survey, expressed in squared degrees |
| method_Pk | the method used to compute the power spectrum |
| delta_z | redshift step used to construct the window function |
| precision | precision of the \(\log k\) array, defined by \(2^{\rm precision}\) |
| NL | false \(\rightarrow\) linear power spectrum; true \(\rightarrow\) non-linear power spectrum |
| store_output | if true the output files created by the Boltzmann solver are stored; if false the output files are removed |
Definition at line 40 of file SuperSampleCovariance.cpp.
| cbl::cosmology::SuperSampleCovariance::SuperSampleCovariance | ( | cbl::cosmology::Cosmology | cosm, |
| const std::vector< cbl::cosmology::CosmologicalParameter > | cosmo_param, | ||
| const double | area, | ||
| const std::vector< double > | W_mean, | ||
| const std::vector< double > | W_std, | ||
| const std::string | method_Pk = "EisensteinHu", |
||
| const double | delta_z = 0.001, |
||
| const double | precision = 10, |
||
| const bool | NL = false, |
||
| const bool | store_output = false |
||
| ) |
Default constructor, used to compute the \(S_{ij}\) matrix, assuming top-hat window functions. The top-hat window function can be used when the redshift errors are smaller than the width of the redshift bins.
Given two redshift bins, labelled as \(i\) and \(j\), \(S_{ij}\) is:
\( S_{ij} = \frac{1}{\Omega} \frac{1}{2\pi^2} \int {\rm d} k\,\, k^2 P(k) \frac{U_i(k)}{I_i} \frac{U_j(k)}{I_j}, \)
where \(\Omega\) is the survey area, \(P(k)\) is the power spectrum, and \(U_i(k)\) and \(I_i\) are expressed as:
\( U_i(k) = \int {\rm d} V_i \,\, W^2_i g(z_j) j_0(kr_j), \)
\( I_i = \int {\rm d} V_i \,\, W^2_i, \)
where \(V_i\) is the comoving volume within the \(i\)-th redshift bin, \(g\) is the growth factor, \(j_0\) the Bessel spherical function, and \(W_i\) is the window function.
Physical units are forced.
| cosm | the Cosmology object |
| cosmo_param | the cosmological parameters set in the modelling (useful only if a modelling is performed) |
| area | effective area of the survey, expressed in squared degrees |
| W_mean | vector of mean values for the Gaussian window functions, corresponding to the centre of the redshift bins |
| W_std | vector of standard deviation values for the Gaussian window functions |
| method_Pk | the method used to compute the power spectrum |
| delta_z | redshift step used to construct the window function |
| precision | precision of the \(\log k\) array, defined by \(2^{\rm precision}\) |
| NL | false \(\rightarrow\) linear power spectrum; true \(\rightarrow\) non-linear power spectrum |
| store_output | if true the output files created by the Boltzmann solver are stored; if false the output files are removed |
Definition at line 64 of file SuperSampleCovariance.cpp.
| std::vector< std::vector< double > > cbl::cosmology::SuperSampleCovariance::get_window_function | ( | ) |
return the window functions
Definition at line 259 of file SuperSampleCovariance.cpp.
|
protected |
compute the Gaussian window functions in the redshift bins
| delta_z | redshift step used to construct the window function |
| W_mean | vector of mean values for the Gaussian window functions |
| W_std | vector of standard deviation values for the Gaussian window functions |
Definition at line 114 of file SuperSampleCovariance.cpp.
|
protected |
compute the S_ij matrix
| cosmo | the cosmological model |
Definition at line 138 of file SuperSampleCovariance.cpp.
|
protected |
compute the top-hat window functions in the redshift bins
| delta_z | redshift step used to construct the window function |
| redshift_edges | redshift bin edges |
Definition at line 88 of file SuperSampleCovariance.cpp.
| std::vector< std::vector< double > > cbl::cosmology::SuperSampleCovariance::operator() | ( | std::vector< double > & | parameter | ) | const |
get \(S_{ij}\)
| parameter | the parameters of interest in the covariance matrix |
Definition at line 241 of file SuperSampleCovariance.cpp.
| int cbl::cosmology::SuperSampleCovariance::Sij_dimension | ( | ) |
return the dimension of the Sij matrix
Definition at line 325 of file SuperSampleCovariance.cpp.
| void cbl::cosmology::SuperSampleCovariance::write_Sij | ( | const std::string | dir, |
| const std::string | file | ||
| ) |
Write the \(S_{ij}\) matrix on file.
Since the objects of the class SuperSampleCovariance are used in parallelized MCMC computations, \(S_{ij}\) is not set as a member of this class. Therefore, this function calculates \(S_{ij}\)
| dir | output directory |
| file | output file |
Definition at line 296 of file SuperSampleCovariance.cpp.
| void cbl::cosmology::SuperSampleCovariance::write_window_function | ( | const std::string | dir, |
| const std::string | file | ||
| ) |
write the window functions on file
| dir | output directory |
| file | output file |
Definition at line 269 of file SuperSampleCovariance.cpp.