CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
Func.h File Reference

Useful generic functions. More...

#include "RandomNumbers.h"
#include "EigenWrapper.h"
#include "ChainMesh.h"
Include dependency graph for Func.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 cbl
 The global namespace of the CosmoBolognaLib
 
 cbl::glob
 The namespace of the functions and classes of internal auxiliary use
 

Functions

Functions of generic use
double cbl::interpolated (const double _xx, const std::vector< double > xx, const std::vector< double > yy, const std::string type)
 1D interpolation More...
 
double cbl::interpolated_2D (const double _x1, const double _x2, const std::vector< double > x1, const std::vector< double > x2, const std::vector< std::vector< double >> yy, const std::string type)
 2D interpolation More...
 
std::vector< double > cbl::linear_interpolation_3D (const std::vector< double > min, std::vector< double > max, std::vector< int > steps, std::vector< std::vector< std::vector< double >>> func, const std::vector< std::vector< double >> pos)
 3D interpolation on a 3D regular grid
More...
 
double cbl::Filter (const double r, const double rc)
 filter W(r/rc), used e.g. for filtering the correlation function More...
 
double cbl::legendre_polynomial (const double mu, const int l)
 the order l Legendre polynomial More...
 
double cbl::legendre_polynomial_integral (double mu, void *params)
 the order l Legendre polynomial integrand More...
 
double cbl::Legendre_polynomial_mu_average (const int ll, const double mu, const double delta_mu)
 the average of the Legendre polynomial of the l-th order over the mu range More...
 
double cbl::Legendre_polynomial_mu_average (const double mu_min, const double mu_max, const int ll)
 the average of the Legendre polynomial of the l-th order over the \(\mu=\cos(\theta)\) range More...
 
double cbl::Legendre_polynomial_theta_average (const double theta_min, const double theta_max, const int ll)
 the average of the Legendre polynomial of the l-th order over the \(\theta\) range More...
 
double cbl::Legendre_polynomial_triangles_average (const double r12_min, const double r12_max, const double r13_min, const double r13_max, const double r23_min, const double r23_max, const int ll, const double rel_err=1.e-5, const double abs_err=1.e-8, const int nevals=100)
 the average of the Legendre polynomial of the l-th order over the \(r_{12}, r_{13}, r_{23} \) More...
 
std::vector< std::vector< double > > cbl::Legendre_polynomial_triangles_average (const double r12, const double r13, const double deltaR, const int lMax, const double rel_err=1.e-5, const double abs_err=1.e-8, const int nevals=100)
 the average of the Legendre polynomial up to a maximum order lMax of all triangles with sides r12, r13 More...
 
std::complex< double > cbl::spherical_harmonics (cbl::CoordinateType coordinate_type, const int l, const int m, const double coord1, const double coord2, const double coord3)
 the order l, degree m spherical harmonics More...
 
std::vector< std::vector< std::complex< double > > > cbl::spherical_harmonics (const int lmax, const double xx, const double yy, const double zz)
 the spherical harmonics up to \(l_{max}\) More...
 
std::vector< std::complex< double > > cbl::spherical_harmonics_array (const int lmax, const double xx, const double yy, const double zz)
 the spherical harmonics up to \(l_{max}\) More...
 
double cbl::j0 (const double xx)
 the l=0 spherical Bessel function More...
 
double cbl::j2 (const double xx)
 the l=2 spherical Bessel function More...
 
double cbl::j4 (const double xx)
 the l=4 spherical Bessel function More...
 
double cbl::jl (const double xx, const int order)
 the order l spherical Bessel function More...
 
double cbl::j0_distance_average (const double kk, const double r_down, const double r_up)
 the distance average l=0 spherical Bessel function this function is used to obtain the analytic twop monopole covariance More...
 
double cbl::j2_distance_average (const double kk, const double r_down, const double r_up)
 the distance average l=2 spherical Bessel function this function is used to obtain the analytic twop quadrupole covariance More...
 
double cbl::jl_spherical_integrand (double rr, void *params)
 the generic integrand to obtain the distance average spherical Bessel function of order l More...
 
double cbl::jl_distance_average (const double kk, const int order, const double r_down, const double r_up)
 the distance average for the order l-th spherical Bessel function More...
 
double cbl::trapezoid_integration (const std::vector< double > xx, const std::vector< double > yy)
 integral, computed with the trapezoid rule, using ordered data More...
 
double cbl::coupling_3j (const int l, const int l_prime, const int l2)
 compute the Wigner 3-j symbol More...
 
void cbl::read_vector (const std::string file_vector, std::vector< double > &xx, std::vector< double > &vector, const std::vector< int > col={})
 read a vector from file More...
 
void cbl::read_matrix (const std::string file_matrix, std::vector< double > &xx, std::vector< double > &yy, std::vector< std::vector< double >> &matrix, const std::vector< int > col={})
 read a matrix from file More...
 
double cbl::determinant_matrix (const std::vector< std::vector< double >> mat)
 compute the determinant of a matrix More...
 
void cbl::invert_matrix (const std::vector< std::vector< double >> mat, std::vector< std::vector< double >> &mat_inv, const double prec=1.e-10, const int Nres=-1)
 function to invert a matrix More...
 
void cbl::invert_matrix (const std::vector< std::vector< double >> mat, std::vector< std::vector< double >> &mat_inv, const int i1, const int i2, const double prec=1.e-10, const int Nres=-1)
 function to invert a sub-matrix, extracted from a given matrix More...
 
void cbl::covariance_matrix (const std::vector< std::vector< double >> mat, std::vector< std::vector< double >> &cov, const bool JK=false)
 compute the covariance matrix from an input dataset More...
 
void cbl::covariance_matrix (const std::vector< std::string > file, std::vector< double > &rad, std::vector< double > &mean, std::vector< std::vector< double >> &cov, const bool JK=false)
 compute the covariance matrix, reading the dataset from files More...
 
void cbl::covariance_matrix (const std::vector< std::string > file, const std::string covariance_matrix_file, const bool JK=0)
 compute the covariance matrix, reading the dataset from files, and store it in a file More...
 
void cbl::read_invert_covariance (const std::string filecov, std::vector< std::vector< double >> &cov, std::vector< std::vector< double >> &cov_inv, const size_t i1, const size_t i2, const double prec=1.e-10, const int Nres=-1)
 read and invert the covariance matrix More...
 
double cbl::number_from_distribution (const std::vector< double > xx, const std::vector< double > fx, const double xmin, const double xmax, const int seed)
 return a number sampled from a given distribution More...
 
std::vector< double > cbl::vector_from_distribution (const int nRan, const std::vector< double > xx, const std::vector< double > fx, const double xmin, const double xmax, const int seed)
 return a std::vector of numbers sampled from a given distribution More...
 
std::vector< size_t > cbl::minimum_maximum_indexes (const std::vector< double > xx, const double x_min, const double x_max)
 return the std::vector indexes corresponding to a given interval More...
 
double cbl::get_mu (const double r1, const double r2, const double r3)
 get the cosine of the angle between two sides of a triangle More...
 
double cbl::window_function (const double x, const double min=-1, const double max=1)
 the unnormalized window function More...
 
double cbl::binomial_coefficient (const int n, const int m)
 get the binomial coefficient More...
 
double cbl::clebsh_gordan (const int j1, const int j2, const int m1, const int m2, const int j3, const int m3)
 get the Clebsh-Gordan coefficient in the notation \( \sum_{l}\left\langle l_1 l_2 m_1 m_2 | l_3 m_3 \right\rangle \) More...
 
template<typename T >
double cbl::sgn (T val)
 sgn the sign function More...
 
double cbl::wigner3j_auxA (double l1, double l2, double l3, double m1, double m2, double m3)
 Wigner \(3-j\) auxiliar function A. More...
 
double cbl::wigner3j_auxB (double l1, double l2, double l3, double m1, double m2, double m3)
 Wigner \(3-j\) auxiliar function B. More...
 
std::vector< double > cbl::wigner3j (double l2, double l3, double m1, double m2, double m3)
 Wigner \(3-j\) symbol. More...
 
double cbl::wigner3j (double l1, double l2, double l3, double m1, double m2, double m3)
 Wigner \(3-j\) symbol. More...
 
double cbl::wigner_3j (int j1, int j2, int j3, int m1, int m2, int m3)
 Wigner \(3-j\) symbol, use it for l<100. More...
 
double cbl::wigner_6j (const int j1, const int j2, const int j3, const int j4, const int j5, const int j6)
 Wigner \(6-j\) symbol. More...
 
double cbl::three_spherical_bessel_integral (const double r1, const double r2, const double r3, const int L1, const int L2, const int L3)
 compute the integral of three spherical bessel function, from Mehrem (2011) More...
 
double cbl::average_three_spherical_bessel_integral (const double r1_min, const double r1_max, const double r2_min, const double r2_max, const double r3, const int L1, const int L2, const int L3)
 compute the integral of three spherical bessel function, from Mehrem (2011), averaged on r1-r2 shells More...
 
std::vector< double > cbl::generate_correlated_data (const std::vector< double > mean, const std::vector< std::vector< double >> covariance, const int idum=213123)
 generate a covariant sample of n points using a covariance matrix More...
 
std::vector< std::vector< double > > cbl::generate_correlated_data (const int nExtractions, const std::vector< double > mean, const std::vector< std::vector< double >> covariance, const int idum=12312)
 generate a covariant sample of n points using a covariance matrix More...
 
template<typename T >
void cbl::vectorReadFromBinary (std::ifstream &fin, std::vector< T > &vec, size_t NN)
 reads a vector from a binary file More...
 
Functions for statistical analyses
double cbl::Average (const std::vector< double > vect)
 the average of a std::vector More...
 
double cbl::Average (const std::vector< double > vect, const std::vector< double > weight)
 the weighted average of a std::vector More...
 
double cbl::Sigma (const std::vector< double > vect)
 the standard deviation of a std::vector More...
 
double cbl::Sigma (const std::vector< double > vect, const std::vector< double > weight)
 the weighted standard deviation of a std::vector More...
 
std::vector< double > cbl::Quartile (const std::vector< double > Vect)
 the first, second and third quartiles of a std::vector More...
 
void cbl::Moment (const std::vector< double > data, double &ave, double &adev, double &sdev, double &var, double &skew, double &curt)
 compute the moments of a set of data More...
 
Special functions
template<typename T >
cbl::Pol2 (T xx, std::shared_ptr< void > pp, std::vector< double > par)
 the quadratic function More...
 
template<typename T >
cbl::Pol3 (T xx, void *pp, std::vector< double > par)
 the cubic function More...
 
std::vector< double > cbl::linearfit (const double xx)
 linear function More...
 
std::vector< double > cbl::quadratic (const double xx)
 quadratic function More...
 
std::vector< double > cbl::cubicfit (const double xx)
 cubic function More...
 
template<typename T >
cbl::identity (T xx, std::shared_ptr< void > pp, std::vector< double > par)
 the Identity function More...
 
template<typename T >
cbl::rectangular (T xx, std::shared_ptr< void > pp, std::vector< double > par)
 the rectangular distribution More...
 
double cbl::closest_probability (double xx, std::shared_ptr< void > pp, std::vector< double > par)
 probability of the closest element to x from a list with weights More...
 
double cbl::distribution_probability (double xx, std::shared_ptr< void > pp, std::vector< double > par)
 probability of an interpolated distribution More...
 
double cbl::chainMeshInterpolate (std::vector< double > xx, std::shared_ptr< void > pars)
 a multidimension interpolator More...
 
double cbl::multivariateGaussian (std::vector< double > xx, std::shared_ptr< void > pars)
 the multivariate Gaussian function More...
 
template<typename T >
cbl::gaussian (T xx, std::shared_ptr< void > pp, std::vector< double > par)
 the Gaussian function More...
 
template<typename T >
cbl::poisson (T xx, std::shared_ptr< void > pp, std::vector< double > par)
 the poisson distribution More...
 
template<typename T >
cbl::maxwellian_distr (const T vel, const T sigma)
 the Maxwellian distribution More...
 
template<typename T >
cbl::powerlaw (const T xx, const T x0, const T gamma)
 the power-law function More...
 
template<typename T >
cbl::double_powerlaw (const T xx, const T x0, const T alpha, const T beta)
 the double power-law function More...
 
template<typename T >
cbl::TopHat_WF (const T kR)
 the top-hat window function More...
 
template<typename T >
cbl::TopHat_WF_D1 (const T kR)
 the derivative of the top-hat window function More...
 
template<typename T >
cbl::Radius (const T Mass, const T Rho)
 the radius of a sphere of a given mass and density More...
 
template<typename T >
cbl::volume_sphere (const T RR)
 the volume of a sphere of a given radius More...
 
template<typename T >
cbl::Mass (const T RR, const T Rho)
 the mass of a sphere of a given radius and density More...
 
template<typename T >
cbl::radial_velocity (const T vx, const T vy, const T vz, const T ra, const T dec)
 the radial velocity More...
 
template<typename T >
cbl::P_2 (const T x)
 the Legendre polynomial P2 More...
 
template<typename T >
cbl::P_4 (const T x)
 the Legendre polynomial P4 More...
 
template<typename T >
cbl::P_6 (const T x)
 the Legendre polynomial P6 More...
 
Generic operations on functions
void cbl::measure_var_function (const std::vector< double > var, const int bin, const double V_min, const double V_max, const double Volume, std::vector< double > &Var, std::vector< double > &Phi, std::vector< double > &err)
 measure the var function (where "var" could be the mass, the luminosity, the radius, etc.) More...
 
void cbl::distribution (std::vector< double > &xx, std::vector< double > &fx, std::vector< double > &err, const std::vector< double > FF, const std::vector< double > WW, const int nbin, const bool linear=true, const std::string file_out=par::defaultString, const double fact=1., const double V1=par::defaultDouble, const double V2=par::defaultDouble, const std::string bin_type="Linear", const bool conv=false, const double sigma=0.)
 derive and store the number distribution of a given std::vector More...
 
double cbl::MC_Int (double func(const double), const double x1, const double x2, const int seed=3213)
 simple Monte Carlo integration of f(x) More...
 
double cbl::MC_Int (double func(const double, const double AA), const double AA, const double x1, double x2, const int seed=3213)
 simple Monte Carlo integration of f(x,A) More...
 
double cbl::MC_Int (double func(const double, const double AA, const double BB, const double CC, const double DD, const double EE), const double AA, const double BB, const double CC, const double DD, const double EE, const double x1, const double x2, const int seed=3213)
 simple Monte Carlo integration of f(x,A,B,C,D,E) More...
 
void cbl::bin_function (const std::string file_grid, double func(double, void *), void *par, const int bin, const double x_min, const double x_max, const std::string binning, std::vector< double > &xx, std::vector< double > &yy)
 create a 1D grid given an input function More...
 
void cbl::bin_function_2D (const std::string file_grid, double func(double *, size_t, void *), void *par, const int bin, const double x1_min, const double x1_max, const double x2_min, const double x2_max, const std::string binning, std::vector< double > &xx1, std::vector< double > &xx2, std::vector< std::vector< double >> &yy)
 create a 2D grid given an input function More...
 
void cbl::convolution (const std::vector< double > f1, const std::vector< double > f2, std::vector< double > &res, const double deltaX)
 convolution of two functions More...
 
Functions to calculate distances
double cbl::degrees (const double angle, const CoordinateUnits inputUnits=CoordinateUnits::_radians_)
 conversion to degrees More...
 
double cbl::radians (const double angle, const CoordinateUnits inputUnits=CoordinateUnits::_degrees_)
 conversion to radians More...
 
double cbl::arcseconds (const double angle, const CoordinateUnits inputUnits=CoordinateUnits::_radians_)
 conversion to arcseconds More...
 
double cbl::arcminutes (const double angle, const CoordinateUnits inputUnits=CoordinateUnits::_radians_)
 conversion to arcminutes More...
 
double cbl::converted_angle (const double angle, const CoordinateUnits inputUnits=CoordinateUnits::_radians_, const CoordinateUnits outputUnits=CoordinateUnits::_degrees_)
 conversion to angle units More...
 
void cbl::polar_coord (const double XX, const double YY, const double ZZ, double &ra, double &dec, double &dd)
 conversion from Cartesian coordinates to polar coordinates More...
 
void cbl::cartesian_coord (const double ra, const double dec, const double dd, double &XX, double &YY, double &ZZ)
 conversion from polar coordinates to Cartesian coordinates More...
 
void cbl::polar_coord (const std::vector< double > XX, const std::vector< double > YY, const std::vector< double > ZZ, std::vector< double > &ra, std::vector< double > &dec, std::vector< double > &dd)
 conversion from Cartesian coordinates to polar coordinates used for a set of objects More...
 
void cbl::cartesian_coord (const std::vector< double > ra, const std::vector< double > dec, const std::vector< double > dd, std::vector< double > &XX, std::vector< double > &YY, std::vector< double > &ZZ)
 conversion from polar coordinates to Cartesian coordinates used for a set of objects More...
 
double cbl::Euclidean_distance (const double x1, const double x2, const double y1, const double y2, const double z1, const double z2)
 the Euclidean distance in 3D relative to the origin (0,0,0), i.e. the Euclidean norm More...
 
double cbl::perpendicular_distance (const double ra1, const double ra2, const double dec1, const double dec2, const double d1, const double d2)
 the perpendicular separation, rp More...
 
double cbl::angular_distance (const double x1, const double x2, const double y1, const double y2, const double z1, const double z2)
 the angular separation in 3D More...
 
double cbl::haversine_distance (const double ra1, const double ra2, const double dec1, const double dec2)
 the haversine angular separation More...
 
void cbl::sdss_atbound (double &angle, const double minval, const double maxval)
 check if ra coordinate is inside the boundaries More...
 
void cbl::sdss_atbound2 (double &theta, double &phi)
 set the angular coordinates in the SDSS boundaries More...
 
void cbl::eq2sdss (const std::vector< double > ra, const std::vector< double > dec, std::vector< double > &lambda, std::vector< double > &eta)
 convert from equatorial coordinates R.A., Dec to sdss coordinates \( \lambda, \eta \) More...
 
void cbl::sdss2eq (const std::vector< double > lambda, const std::vector< double > eta, std::vector< double > &ra, std::vector< double > &dec)
 convert sdss coordinates \( \lambda, \eta \) to R.A., Dec. More...
 
void cbl::sdss_stripe (const std::vector< double > eta, const std::vector< double > lambda, std::vector< int > &stripe, std::vector< int > &str_u)
 compute the SDSS stripe given SDSS coordinates \( \lambda, \eta \) More...
 
Functions to model the correlation function
double cbl::xi_from_Pk (const double rr, const std::vector< double > lgkk, const std::vector< double > lgPk, const double k_min=0., const double k_max=100., const double aa=0., const double prec=1.e-2)
 the two-point correlation function computed from the Fourier transform of the power spectrum More...
 
double cbl::xi_from_Pk (const double rr, const std::string file, const int c1=1, const int c2=2, const double k_min=0., const double k_max=100., const double aa=0., const double prec=1.e-2)
 the two-point correlation function computed from the Fourier transform of the power spectrum read from a file More...
 
double cbl::Pk_from_xi (const double kk, const std::vector< double > lgrr, const std::vector< double > lgxi, const double r_min=0.03, const double r_max=100.)
 the power spectrum computed from the Fourier transform of the two-point correlation function More...
 
double cbl::Pk_from_xi (const double kk, const std::string file, const int c1=1, const int c2=2, const double r_min=0.03, const double r_max=100.)
 the power spectrum computed from the Fourier transform of the two-point correlation function read from a file More...
 
double cbl::wp (const double rp, const std::vector< double > rr, const std::vector< double > xi, const double r_max=100.)
 the projected two-point correlation function More...
 
double cbl::wp (const double rp, const std::string file, const double r_max=100.)
 the projected two-point correlation function More...
 
double cbl::sigmaR (const double RR, const int corrType, const std::vector< double > rr, const std::vector< double > corr)
 the rms mass fluctuation within a given radius More...
 
double cbl::xi_projected_powerlaw (const double rp, const double r0, const double gamma)
 the projected correlation function, wp(rp), computed by modelling the two-point correlation function, ξ(r), as a power-law More...
 
double cbl::xi_ratio (const double beta)
 the ratio between the redshift-space and real-space correlation functions More...
 
double cbl::xi_ratio (const double f_sigma8, const double bias_sigma8)
 the ratio between the redshift-space and real-space correlation functions More...
 
double cbl::error_xi_ratio (const double beta, const double error_beta)
 error on the ratio between the redshift-space and real-space correlation functions More...
 
double cbl::barred_xi_direct (const double RR, const std::vector< double > rr, const std::vector< double > xi, const double rAPP=0., const double r0=-1., const double gamma=1.)
 the barred correlation function More...
 
double cbl::barred_xi__direct (const double RR, const std::vector< double > rr, const std::vector< double > xi, const double rAPP=0., const double r0=-1., const double gamma=1.)
 the double barred correlation function More...
 
double cbl::barred_xi_ (const double RR, const std::vector< double > rr, const std::vector< double > xi, const double rAPP=0., const double r0=-1., const double gamma=1.)
 the barred correlation function More...
 
double cbl::barred_xi__ (const double RR, const std::vector< double > rr, const std::vector< double > xi, const double rAPP=0., const double r0=-1., const double gamma=1.)
 the double barred correlation function More...
 
double cbl::multipole_xi0 (const int indexR, const std::vector< double > mu, const std::vector< std::vector< double >> xi)
 xi0(s) from ξ(r,μ) More...
 
double cbl::multipole_xi2 (const int indexR, const std::vector< double > mu, const std::vector< std::vector< double >> xi)
 xi2(s) from ξ(r,μ) More...
 
double cbl::multipole_xi4 (const int indexR, const std::vector< double > mu, const std::vector< std::vector< double >> xi)
 xi4(s) from ξ(r,μ) More...
 
double cbl::error_multipole_xi0 (const int indexR, const std::vector< double > mu, const std::vector< std::vector< double >> error)
 error on xi0(s) from ξ(r,μ) More...
 
double cbl::error_multipole_xi2 (const int indexR, const std::vector< double > mu, const std::vector< std::vector< double >> error)
 error on xi2(s) from ξ(r,μ) More...
 
double cbl::error_multipole_xi4 (const int indexR, const std::vector< double > mu, const std::vector< std::vector< double >> error)
 error on xi4(s) from ξ(r,μ) More...
 
double cbl::multipole_xi0 (const double ss, const std::vector< double > rp, const std::vector< double > pi, const std::vector< std::vector< double >> xi, const double delta_s)
 xi0(s) from ξ(rp,π) More...
 
double cbl::multipole_xi2 (const double ss, const std::vector< double > rp, const std::vector< double > pi, const std::vector< std::vector< double >> xi, const double delta_s)
 xi2(s) from ξ(rp,π) More...
 
double cbl::multipole_xi4 (const double ss, const std::vector< double > rp, const std::vector< double > pi, const std::vector< std::vector< double >> xi, const double delta_s)
 xi4(s) from ξ(rp,π) More...
 
double cbl::error_multipole_xi0 (const double ss, const std::vector< double > rp, const std::vector< double > pi, const std::vector< std::vector< double >> error, const double delta_s)
 error on xi0(s) from ξ(rp,π) More...
 
double cbl::error_multipole_xi2 (const double ss, const std::vector< double > rp, const std::vector< double > pi, const std::vector< std::vector< double >> error, const double delta_s)
 error on xi2(s) from ξ(rp,π) More...
 
double cbl::error_multipole_xi4 (const double ss, const std::vector< double > rp, const std::vector< double > pi, const std::vector< std::vector< double >> error, const double delta_s)
 error on xi4(s) from ξ(rp,π) More...
 
double cbl::multipole_xi0_model (const double beta, const double xi_real)
 the model multipole ξ0 of the two-point correlation function More...
 
double cbl::multipole_xi0_model (const double f_sigma8, const double bias_sigma8, const double sigma8z, const double xi_matter)
 the model multipole ξ0 of the two-point correlation function More...
 
double cbl::multipole_xi2_model (const double beta, const double xi_real, const double xi_)
 the model multipole ξ2 of the two-point correlation function More...
 
double cbl::multipole_xi4_model (const double beta, const double xi_real, const double xi_, const double xi__)
 the model multipole ξ4 of the two-point correlation function More...
 
double cbl::xi2D_lin_model (const double beta, const double bias, const double xi_real, const double xi_, const double xi__, const double P_2, const double P_4)
 the linear dispersion model for ξ(rp,π) More...
 
double cbl::xi2D_lin_model (const double rp, const double pi, const double beta, const double bias, const std::vector< double > rad_real, const std::vector< double > xi_real, const std::vector< double > xi_, const std::vector< double > xi__, const int index=-1, const bool bias_nl=0, const double bA=0.)
 the linear dispersion model for ξ(rp,π) More...
 
double cbl::xi2D_model (const double rp, const double pi, const double beta, const double bias, const double sigmav, const std::vector< double > rad_real, const std::vector< double > xi_real, const std::vector< double > xi_, const std::vector< double > xi__, const double var, const int FV, int index=-1, const bool bias_nl=0, const double bA=0., const double v_min=-3000., const double v_max=3000., const int step_v=500)
 the non-linear dispersion model for ξ(rp,π) More...
 
double cbl::xi2D_lin_model (const double rp, const double pi, const double beta, const double bias, const std::shared_ptr< void > funcXiR, const std::shared_ptr< void > funcXiR_, const std::shared_ptr< void > funcXiR__, const bool bias_nl=0, const double bA=0.)
 the linear dispersion model for ξ(rp,π) More...
 
double cbl::xi2D_model (const double rp, const double pi, const double beta, const double bias, const double sigmav, const std::shared_ptr< void > funcXiR, const std::shared_ptr< void > funcXiR_, const std::shared_ptr< void > funcXiR__, const double var, const int FV, const bool bias_nl=0, const double bA=0., const double v_min=-3000., const double v_max=3000., const int step_v=500)
 the non-linear dispersion model for ξ(rp,π) More...
 
double cbl::f_v (const double vel, const double sigmav, const int FV)
 pairwise velocity distribution More...
 
double cbl::f_v (const double vel, const double rp, const double pi, const double var, const double sigmav0, const double cmu, const double cs1, const double cs2)
 pairwise velocity distribution More...
 
double cbl::f_star (const double xx, const double f_g, const double k_star)
 velocity distribution used to model BAO More...
 
double cbl::b_nl (const double rr, const double bA, const double bB=10., const double bC=4.)
 a possible parameterization of the non-linear bias More...
 
double cbl::relative_error_beta (const double bias, const double Volume, const double density)
 estimated relative error on \(\beta=f/b\) More...
 
double cbl::Pkl_Kaiser_integrand (const double mu, void *parameters)
 integrand of the 2d power spectrum to obtain power spectrum multipole More...
 
double cbl::sigma2_integrand (const double mu, void *parameters)
 integrand of the 2d power spectrum to obtain sigma^2(k) More...
 
double cbl::covariance_XiMultipoles_integrand (const double kk, void *parameters)
 integrand to obtain the 2PCF multipoles More...
 
double cbl::XiMultipoles_integrand (const double kk, void *parameters)
 integrand to obtain covariance for the 2PCF multipoles More...
 
double cbl::XiMultipoles_from_Xi2D_integrand (const double mu, void *parameters)
 integrand to obtain the 2PCF multipoles from 2D 2pcf in polar coordinates More...
 
double cbl::Pkl_Kaiser_integral (const int order, const double bias, const double f)
 function to obtain the Kaiser factor More...
 
std::vector< double > cbl::Pk0_Kaiser (const std::vector< double > kk, const std::vector< double > Pk, const double bias, const double f)
 function to obtain the linear RSD power spectrum monopole More...
 
std::vector< double > cbl::Pk2_Kaiser (const std::vector< double > kk, const std::vector< double > Pk, const double bias, const double f)
 function to obtain the linear RSD power spectrum quadrupole More...
 
std::vector< double > cbl::Pk4_Kaiser (const std::vector< double > kk, const std::vector< double > Pk, const double bias, const double f)
 function to obtain the linear RSD power spectrum hexadecapole More...
 
std::vector< std::vector< double > > cbl::Pkl_Kaiser (const std::vector< int > orders, const std::vector< double > kk, const std::vector< double > Pk, const double bias, const double f)
 function to obtain Pk multipoles from linear RSD (Kaiser) More...
 
std::vector< double > cbl::Xi0 (const std::vector< double > r, const std::vector< double > kk, const std::vector< double > Pk0, const double k_cut=0.7, const double cut_pow=2, const int IntegrationMethod=1)
 function to obtain the two point correlation funciton monopole More...
 
std::vector< double > cbl::Xi2 (const std::vector< double > rr, const std::vector< double > kk, const std::vector< double > Pk2, const double k_cut=0.58, const double cut_pow=4, const int IntegrationMethod=1)
 function to obtain the two point correlation function quadrupole More...
 
std::vector< double > cbl::Xi4 (const std::vector< double > rr, const std::vector< double > kk, const std::vector< double > Pk4, const double k_cut=0.6, const double cut_pow=2, const int IntegrationMethod=1)
 function to obtain the two point correlation function hexadecapole More...
 
std::vector< std::vector< double > > cbl::Xi02_AP (const double alpha_perpendicular, const double alpha_parallel, const std::vector< double > rr, const std::vector< double > rl, const std::vector< double > Xi0, const std::vector< double > Xi2)
 function to obtain the monopole and quadrupole of the two point correlation function More...
 
std::vector< std::vector< double > > cbl::Xi024_AP (const double alpha_perpendicular, const double alpha_parallel, const std::vector< double > rr, const std::vector< double > rl, const std::vector< double > Xi0, const std::vector< double > Xi2, const std::vector< double > Xi4)
 function to obtain the monopole, quadrupole and hexadecapole of the two-point correlation function More...
 
std::vector< std::vector< double > > cbl::XiWedges_AP (const std::vector< double > mu_min, const std::vector< double > delta_mu, const double alpha_perpendicular, const double alpha_parallel, const std::vector< double > rr, const std::vector< double > rl, const std::vector< double > Xi0, const std::vector< double > Xi2, const std::vector< double > Xi4)
 function to obtain the 2pcf wedges More...
 
std::vector< std::vector< double > > cbl::sigma2_k (const double nObjects, const double Volume, const std::vector< double > kk, const std::vector< std::vector< double >> Pk_multipoles, const std::vector< int > orders)
 multipole expansion of the per-mode covariance sigma2_k (see Grieb et al. 2016, eq. 15 https://arxiv.org/pdf/1509.04293) More...
 
void cbl::Covariance_XiMultipoles (std::vector< double > &rr, std::vector< std::vector< double >> &covariance, const int nbins, const double rMin, const double rMax, const double nObjects, const double Volume, const std::vector< double > kk, const std::vector< std::vector< double >> Pk_multipoles, const std::vector< int > orders, const cbl::BinType bin_type=cbl::BinType::_linear_)
 Covariance matrix for two-point correlation multipoles (see Grieb et al. 2016, Eq. 18 https://arxiv.org/pdf/1509.04293) More...
 
void cbl::Covariance_XiWedges (std::vector< double > &rr, std::vector< std::vector< double >> &covariance, const std::vector< double > mu, const std::vector< double > delta_mu, const int nbins, const double rMin, const double rMax, const double nObjects, const double Volume, const std::vector< double > kk, const std::vector< std::vector< double >> Pk_multipoles, const std::vector< int > orders, const cbl::BinType bin_type=cbl::BinType::_linear_)
 Covariance matrix for two-point correlation wedges (see Grieb et al. 2016, Eq. 19 https://arxiv.org/pdf/1509.04293) More...
 
std::vector< std::vector< double > > cbl::Xi02_AP (const double alpha_perpendicular, const double alpha_parallel, const std::vector< double > rr, const std::shared_ptr< glob::FuncGrid > xi0_interp, const std::shared_ptr< glob::FuncGrid > xi2_interp)
 function to obtain the monopole and quadrupole of the two point correlation function More...
 
std::vector< std::vector< double > > cbl::Xi024_AP (const double alpha_perpendicular, const double alpha_parallel, const std::vector< double > rr, const std::shared_ptr< glob::FuncGrid > xi0_interp, const std::shared_ptr< glob::FuncGrid > xi2_interp, const std::shared_ptr< glob::FuncGrid > xi4_interp)
 function to obtain the monopole, quadrupole and hexadecapole of the two-point correlation function More...
 
std::vector< std::vector< double > > cbl::XiWedges_AP (const std::vector< double > mu_min, const std::vector< double > delta_mu, const double alpha_perpendicular, const double alpha_parallel, const std::vector< double > rr, const std::shared_ptr< glob::FuncGrid > xi0_interp, const std::shared_ptr< glob::FuncGrid > xi2_interp, const std::shared_ptr< glob::FuncGrid > xi4_interp)
 function to obtain the 2pcf wedges More...
 

Detailed Description

Useful generic functions.

This file contains the prototypes of a large set of useful functions of wide used

Author
Federico Marulli
feder.nosp@m.ico..nosp@m.marul.nosp@m.li3@.nosp@m.unibo.nosp@m..it

Definition in file Func.h.