48 double beta = ff/
bias;
54 double rsd_term = 3*beta/(7+3*beta);
71 for (
int i=0; i<density_field.
nx(); i++) {
72 double kx = (i<=density_field.
nx()/2) ? xfact*i : -(density_field.
nx()-i)*xfact;
73 for (
int j=0; j<density_field.
ny(); j++) {
74 double ky =(j<=density_field.
ny()/2) ? yfact*j : -(density_field.
ny()-j)*yfact;
75 for (
int k=0; k<density_field.
nzFourier(); k++) {
77 double kk = pow(kx*kx+ky*ky+kz*kz, 0.5);
96 for (
int i=0; i<density_field.
nx(); i++)
97 for (
int j=0; j<density_field.
ny(); j++)
98 for (
int k=0; k<density_field.
nz(); k++) {
100 double rx = density_field.
XX(i), ry = density_field.
YY(j), rz = density_field.
ZZ(k);
101 double rr = (sqrt(rx*rx+ry*ry+rz*rz)==0) ? 1 : sqrt(rx*rx+ry*ry+rz*rz);
103 vector<double> displ = displacement_field.
VectorField(i, j, k);
104 double scalar_product = (rr==0) ? 0. : (displ[0]*rx+displ[1]*ry+displ[2]*rz)/rr;
106 double displ_x_rsd = displ[0]+rsd_term*scalar_product*rx/rr;
107 double displ_y_rsd = displ[1]+rsd_term*scalar_product*ry/rr;
108 double displ_z_rsd = displ[2]+rsd_term*scalar_product*rz/rr;
110 displacement_field_RSD.
set_VectorField({displ_x_rsd, displ_y_rsd, displ_z_rsd}, i, j, k);
116 for (
size_t i=0; i<data.
nObjects(); i++) {
117 int i1 = min(
int((data.
xx(i)-density_field.
MinX())/density_field.
deltaX()), density_field.
nx()-1);
118 int j1 = min(
int((data.
yy(i)-density_field.
MinY())/density_field.
deltaY()), density_field.
ny()-1);
119 int k1 = min(
int((data.
zz(i)-density_field.
MinZ())/density_field.
deltaZ()), density_field.
nz()-1);
121 vector<double> displacement = displacement_field_RSD.
VectorField(i1, j1, k1);
128 for (
size_t i=0; i<random.
nObjects(); i++) {
129 int i1 = min(
int((random.
xx(i)-density_field.
MinX())/density_field.
deltaX()), density_field.
nx()-1);
130 int j1 = min(
int((random.
yy(i)-density_field.
MinY())/density_field.
deltaY()), density_field.
ny()-1);
131 int k1 = min(
int((random.
zz(i)-density_field.
MinZ())/density_field.
deltaZ()), density_field.
nz()-1);
133 vector<double> displacement = (random_RSD) ? displacement_field_RSD.
VectorField(i1, j1, k1) : displacement_field.
VectorField(i1, j1, k1);
151 for (
size_t i=0; i<displaced_cat.
nObjects(); i++) {
153 double xx = displaced_cat.
xx(i);
154 double yy = displaced_cat.
yy(i);
155 double zz = displaced_cat.
zz(i);
168 return displaced_cat;
Generic functions that use one or more classes of the CosmoBolognaLib.
double z_displacement(const int i) const
get the private member Catalogue::m_object[i]->m_z_displacement
double yy(const int i) const
get the private member Catalogue::m_object[i]->m_yy
size_t nObjects() const
get the number of objects of the catalogue
double xx(const int i) const
get the private member Catalogue::m_object[i]->m_xx
std::shared_ptr< Object > catalogue_object(const int i) const
get the i-th object of the catalogue
double y_displacement(const int i) const
get the private member Catalogue::m_object[i]->m_y_displacement
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
double zz(const int i) const
get the private member Catalogue::m_object[i]->m_zz
double x_displacement(const int i) const
get the private member Catalogue::m_object[i]->m_x_displacement
void computePolarCoordinates(const CoordinateUnits outputUnits=CoordinateUnits::_radians_)
compute the polar coordinates (R.A., Dec, dc) from the comoving coordinates (x, y,...
double linear_growth_rate(const double redshift, const double prec=1.e-4) const
the linear growth rate at a given redshift,
double deltaX() const
get the private member m_deltaX
double MaxY() const
get the private member m_MaxY
double MinY() const
get the private member m_MinY
int nzFourier() const
get the private member m_nZF
double XX(const int i) const
get the value of the X coordinates at the i-th cell
double deltaZ() const
get the private member m_deltaZ
int ny() const
get the private member m_nY
double MinX() const
get the private member m_MinX
int nx() const
get the private member m_nX
double MaxZ() const
get the private member m_MaxZ
double ZZ(const int i) const
get the value of the Z coordinates at the i-th cell
double deltaY() const
get the private member m_deltaY
int nz() const
get the private member m_nZ
double MinZ() const
get the private member m_MinZ
double YY(const int i) const
get the value of the Y coordinates at the i-th cell
double MaxX() const
get the private member m_MaxX
void FourierTransformField()
perform the Fourier transform on the field
double ScalarField_FourierSpace_real(const int i, const int j, const int k) const
get the value of the scalar field, Fourier space, real part
double ScalarField_FourierSpace_complex(const int i, const int j, const int k) const
get the value of the scalar field, Fourier space, complex part
void set_VectorField_FourierSpace_real(const std::vector< double > value, const int i, const int j, const int k, const bool add=0)
set the value of the vector field, Fourier space, real part
void set_VectorField_FourierSpace_complex(const std::vector< double > value, const int i, const int j, const int k, const bool add=0)
set the value of the vector field, Fourier space, complex part
void set_VectorField(const std::vector< double > value, const int i, const int j, const int k, const bool add=0)
set the value of the vectorr field
std::vector< double > VectorField(const int i, const int j, const int k) const
get the value of the vector field
void FourierAntiTransformField()
perform the anti-Fourier transform on the field
static const double pi
: the ratio of a circle's circumference to its diameter
double bias(const double Mmin, const double sigmalgM, const double M0, const double M1, const double alpha, const std::shared_ptr< void > inputs)
the mean galaxy bias
The global namespace of the CosmoBolognaLib
catalogue::Catalogue displaced_catalogue(const catalogue::Catalogue input_catalogue)
return a sample with objects displaced, according to the internal variables m_x_displacement,...
void reconstruction_fourier_space(const catalogue::Catalogue data, const catalogue::Catalogue random, const bool random_RSD, const cosmology::Cosmology cosmology, const double redshift, const double bias, const double cell_size, const double smoothing_radius, const int interpolation_type=0)
compute the non linear displacements of the density field